core: NO_KEYBOARD build option
disables USB keyboard interface
This commit is contained in:
parent
86b4d082d9
commit
4964617a31
8 changed files with 104 additions and 21 deletions
|
|
@ -115,21 +115,25 @@ void suspend_power_down(void)
|
|||
|
||||
bool suspend_wakeup_condition(void)
|
||||
{
|
||||
#ifndef NO_KEYBOARD
|
||||
matrix_power_up();
|
||||
matrix_scan();
|
||||
matrix_power_down();
|
||||
for (uint8_t r = 0; r < MATRIX_ROWS; r++) {
|
||||
if (matrix_get_row(r)) return true;
|
||||
}
|
||||
#endif
|
||||
return false;
|
||||
}
|
||||
|
||||
// run immediately after wakeup
|
||||
void suspend_wakeup_init(void)
|
||||
{
|
||||
#ifndef NO_KEYBOARD
|
||||
// clear keyboard state
|
||||
matrix_clear();
|
||||
clear_keyboard();
|
||||
#endif
|
||||
#ifdef BACKLIGHT_ENABLE
|
||||
backlight_init();
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -22,6 +22,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|||
* Definitions of default hooks
|
||||
* ------------------------------------------------- */
|
||||
|
||||
__attribute__((weak))
|
||||
void hook_main_loop(void) {}
|
||||
|
||||
__attribute__((weak))
|
||||
void hook_keyboard_loop(void) {}
|
||||
|
||||
|
|
|
|||
|
|
@ -56,6 +56,10 @@ void hook_usb_wakeup(void);
|
|||
/* Default behaviour: do nothing. */
|
||||
void hook_usb_startup_wait_loop(void);
|
||||
|
||||
/* Called periodically from main loop */
|
||||
/* Default behaviour: do nothing. */
|
||||
void hook_main_loop(void);
|
||||
|
||||
|
||||
/* -------------------------------------
|
||||
* Keyboard hooks
|
||||
|
|
|
|||
|
|
@ -100,6 +100,12 @@ void print_set_sendchar(int8_t (*print_sendchar_func)(uint8_t));
|
|||
#else /* NO_PRINT */
|
||||
|
||||
#define xprintf(s,...) ((void)0)
|
||||
#define xsprintf(s,...) ((void)0)
|
||||
#define xfprintf(s,...) ((void)0)
|
||||
#define xputs(s) ((void)0)
|
||||
#define xputc(c) ((void)0)
|
||||
#define xitoa(v, r, w) ((void)0)
|
||||
#define xatoi(s, r) ((void)0)
|
||||
#define print(s) ((void)0)
|
||||
#define println(s) ((void)0)
|
||||
#define print_set_sendchar(func) ((void)0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue