Skip to content

Commit bea79d9

Browse files
committed
hook: Change func name of usb events
1 parent 3e97536 commit bea79d9

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

common/hook.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,18 @@ void hook_early_init(void);
3434
void hook_late_init(void);
3535

3636
/* Called once, on getting SUSPEND event from USB. */
37-
/* Default behaviour: enables sleep LED breathing. */
38-
void hook_suspend_entry(void);
37+
/* Default behaviour: do nothing. */
38+
void hook_usb_suspend_entry(void);
3939

4040
/* Called repeatedly during the SUSPENDed state. */
4141
/* Default behaviour: power down and periodically check
4242
* the matrix, cause wakeup if needed. */
43-
void hook_suspend_loop(void);
43+
void hook_usb_suspend_loop(void);
4444

4545
/* Called once, on getting WAKE event from USB. */
4646
/* Default behaviour: disables sleep LED breathing and restores
4747
* the "normal" indicator LED status by default. */
48-
void hook_wakeup(void);
48+
void hook_usb_wakeup(void);
4949

5050
/* Called once, on checking the bootmagic combos. */
5151
/* Default behaviour: do nothing. */

protocol/chibios/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ __attribute__((weak))
6767
void hook_late_init(void) {}
6868

6969
__attribute__((weak))
70-
void hook_suspend_loop(void) {
70+
void hook_usb_suspend_loop(void) {
7171
/* Do this in the suspended state */
7272
suspend_power_down(); // on AVR this deep sleeps for 15ms
7373
/* Remote wakeup */
@@ -147,7 +147,7 @@ int main(void) {
147147
if(USB_DRIVER.state == USB_SUSPENDED) {
148148
print("[s]");
149149
while(USB_DRIVER.state == USB_SUSPENDED) {
150-
hook_suspend_loop();
150+
hook_usb_suspend_loop();
151151
}
152152
/* Woken up */
153153
// variables have been already cleared

protocol/chibios/usb_main.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131

3232
/* TMK hooks */
3333
__attribute__((weak))
34-
void hook_wakeup(void) {
34+
void hook_usb_wakeup(void) {
3535
#ifdef SLEEP_LED_ENABLE
3636
sleep_led_disable();
3737
// NOTE: converters may not accept this
@@ -40,7 +40,7 @@ void hook_wakeup(void) {
4040
}
4141

4242
__attribute__((weak))
43-
void hook_suspend_entry(void) {
43+
void hook_usb_suspend_entry(void) {
4444
#ifdef SLEEP_LED_ENABLE
4545
sleep_led_enable();
4646
#endif /* SLEEP_LED_ENABLE */
@@ -814,13 +814,13 @@ static void usb_event_cb(USBDriver *usbp, usbevent_t event) {
814814

815815
case USB_EVENT_SUSPEND:
816816
//TODO: from ISR! print("[S]");
817-
hook_suspend_entry();
817+
hook_usb_suspend_entry();
818818
return;
819819

820820
case USB_EVENT_WAKEUP:
821821
//TODO: from ISR! print("[W]");
822822
suspend_wakeup_init();
823-
hook_wakeup();
823+
hook_usb_wakeup();
824824
return;
825825

826826
case USB_EVENT_STALLED:

protocol/lufa/lufa.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -181,13 +181,13 @@ void EVENT_USB_Device_Reset(void)
181181
void EVENT_USB_Device_Suspend()
182182
{
183183
print("[S]");
184-
hook_suspend_entry();
184+
hook_usb_suspend_entry();
185185
}
186186

187187
void EVENT_USB_Device_WakeUp()
188188
{
189189
print("[W]");
190-
hook_wakeup();
190+
hook_usb_wakeup();
191191
}
192192

193193
#ifdef CONSOLE_ENABLE
@@ -585,8 +585,8 @@ int main(void) __attribute__ ((weak));
585585
int main(void)
586586
{
587587
setup_mcu();
588-
keyboard_setup();
589588
hook_early_init();
589+
keyboard_setup();
590590
setup_usb();
591591
sei();
592592

@@ -612,7 +612,7 @@ int main(void)
612612
while (1) {
613613
while (USB_DeviceState == DEVICE_STATE_Suspended) {
614614
print("[s]");
615-
hook_suspend_loop();
615+
hook_usb_suspend_loop();
616616
}
617617

618618
keyboard_task();
@@ -632,15 +632,15 @@ __attribute__((weak))
632632
void hook_late_init(void) {}
633633

634634
__attribute__((weak))
635-
void hook_suspend_entry(void)
635+
void hook_usb_suspend_entry(void)
636636
{
637637
#ifdef SLEEP_LED_ENABLE
638638
sleep_led_enable();
639639
#endif
640640
}
641641

642642
__attribute__((weak))
643-
void hook_suspend_loop(void)
643+
void hook_usb_suspend_loop(void)
644644
{
645645
suspend_power_down();
646646
if (USB_Device_RemoteWakeupEnabled && suspend_wakeup_condition()) {
@@ -649,7 +649,7 @@ void hook_suspend_loop(void)
649649
}
650650

651651
__attribute__((weak))
652-
void hook_wakeup(void)
652+
void hook_usb_wakeup(void)
653653
{
654654
suspend_wakeup_init();
655655
#ifdef SLEEP_LED_ENABLE

0 commit comments

Comments
 (0)