#include "keyboard.h"
#include "led.h"
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/* -------------------------------------
* Protocol hooks
* ------------------------------------- */
* the "normal" indicator LED status by default. */
void hook_usb_wakeup(void);
+/* Called repeatedly until getting to CONFIGURED state */
+/* Default behaviour: do nothing. */
+void hook_usb_startup_wait_loop(void);
+
/* -------------------------------------
* Keyboard hooks
/* Default behaviour: do nothing. */
void hook_bootmagic(void);
+#ifdef __cplusplus
+}
+#endif
#endif /* _HOOKS_H_ */
#include <stdbool.h>
+#ifdef __cplusplus
+extern "C" {
+#endif
+
void suspend_idle(uint8_t timeout);
void suspend_power_down(void);
bool suspend_wakeup_condition(void);
void suspend_wakeup_init(void);
+#ifdef __cplusplus
+}
+#endif
+
#endif
`hook_early_init(void)` | Early in the boot process, before the matrix is initialized and before a connection is made with the host. Thus, this hook has access to very few parameters, but it is a good place to define any custom parameters needed by other early processes.
`hook_late_init(void)` | Near the end of the boot process, after Boot Magic has run and LEDs have been initialized.
`hook_bootmagic(void)` | During the Boot Magic window, after EEPROM and Bootloader checks are made, but before any other built-in Boot Magic checks are made.
+`hook_usb_startup_wait_loop(void)` | Continuously, until the device gets ready and into USB configured state.
+
`hook_usb_wakeup(void)` | When the device wakes up from USB suspend state.
`hook_usb_suspend_entry(void)` | When the device enters USB suspend state.
`hook_usb_suspend_loop(void)` | Continuously, while the device is in USB suspend state. *Default action:* power down and periodically check the matrix, causing wakeup if needed.
#else
USB_USBTask();
#endif
+ hook_usb_startup_wait_loop();
}
print("\nUSB configured.\n");
#endif
// Calling long task here can prevent USB state transition
}
+
+__attribute__((weak))
+void hook_usb_startup_wait_loop(void) {}