2021-08-18 05:11:07 +06:00
|
|
|
/* Copyright 2021 QMK
|
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "keyboard.h"
|
|
|
|
|
|
|
|
void platform_setup(void);
|
|
|
|
|
|
|
|
void protocol_setup(void);
|
2021-11-03 00:53:46 +06:00
|
|
|
void protocol_pre_init(void);
|
|
|
|
void protocol_post_init(void);
|
2021-10-25 01:39:41 +06:00
|
|
|
void protocol_pre_task(void);
|
|
|
|
void protocol_post_task(void);
|
|
|
|
|
2021-11-03 00:53:46 +06:00
|
|
|
// Bodge as refactoring this area sucks....
|
|
|
|
void protocol_init(void) __attribute__((weak));
|
|
|
|
void protocol_init(void) {
|
|
|
|
protocol_pre_init();
|
|
|
|
|
|
|
|
keyboard_init();
|
|
|
|
|
|
|
|
protocol_post_init();
|
|
|
|
}
|
|
|
|
|
2021-10-25 01:39:41 +06:00
|
|
|
void protocol_task(void) __attribute__((weak));
|
|
|
|
void protocol_task(void) {
|
|
|
|
protocol_pre_task();
|
|
|
|
|
|
|
|
keyboard_task();
|
|
|
|
|
|
|
|
protocol_post_task();
|
|
|
|
}
|
2021-08-18 05:11:07 +06:00
|
|
|
|
|
|
|
/** \brief Main
|
|
|
|
*
|
|
|
|
* FIXME: Needs doc
|
|
|
|
*/
|
|
|
|
int main(void) __attribute__((weak));
|
|
|
|
int main(void) {
|
|
|
|
platform_setup();
|
|
|
|
protocol_setup();
|
2021-10-25 01:39:41 +06:00
|
|
|
keyboard_setup();
|
2021-08-18 05:11:07 +06:00
|
|
|
|
|
|
|
protocol_init();
|
|
|
|
|
|
|
|
/* Main loop */
|
|
|
|
while (true) {
|
|
|
|
protocol_task();
|
2021-11-16 00:21:09 +06:00
|
|
|
|
2022-04-13 14:00:18 +06:00
|
|
|
#ifdef QUANTUM_PAINTER_ENABLE
|
|
|
|
// Run Quantum Painter animations
|
|
|
|
void qp_internal_animation_tick(void);
|
|
|
|
qp_internal_animation_tick();
|
|
|
|
#endif
|
|
|
|
|
2021-11-16 00:21:09 +06:00
|
|
|
#ifdef DEFERRED_EXEC_ENABLE
|
|
|
|
// Run deferred executions
|
2022-04-13 14:00:18 +06:00
|
|
|
void deferred_exec_task(void);
|
2021-11-16 00:21:09 +06:00
|
|
|
deferred_exec_task();
|
2022-02-13 00:29:31 +06:00
|
|
|
#endif // DEFERRED_EXEC_ENABLE
|
2021-11-16 00:21:09 +06:00
|
|
|
|
2021-08-18 05:11:07 +06:00
|
|
|
housekeeping_task();
|
|
|
|
}
|
|
|
|
}
|