Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Question about housekeeping_task_XXX() function. #12206

Closed
mtei opened this issue Mar 12, 2021 · 1 comment
Closed

Question about housekeeping_task_XXX() function. #12206

mtei opened this issue Mar 12, 2021 · 1 comment

Comments

@mtei
Copy link
Contributor

mtei commented Mar 12, 2021

The housekeeping_task_{kb,user}() function appears to be called twice in the main loop. Is this correct?

// tmk_core/protocol/lufa/lufa.c
int main(void) {
    ....
    print("Keyboard start.\n");
    while (1) {
        ....
        keyboard_task();
        ....
        housekeeping_task_kb();
        housekeeping_task_user();
    }
}
// tmk_core/common/keyboard.c
void keyboard_task(void) {
    ....
    housekeeping_task_kb();
    housekeeping_task_user();

    uint8_t matrix_changed = matrix_scan();
    if (matrix_changed) last_matrix_activity_trigger();

    for (uint8_t r = 0; r < MATRIX_ROWS; r++) {
        ....
    }
    ....
    action_exec(TICK);
    ....
}
@mtei mtei changed the title The question about housekeeping_task_XXX() function. Question about housekeeping_task_XXX() function. Mar 12, 2021
@tzarc
Copy link
Member

tzarc commented Mar 19, 2021

Should be once per loop. If it's doing it more often, then yes, should be rectified.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants