How to set properly suspend function

Hello everyone!
Seems like my keeb rebooting recursively after my laptop falls asleep;
but i want to prevent it. I’ve try to use following defines in my firmware (QMK) :

#define NO_USB_WAKE_FROM_SUSPEND
#define RGB_MATRIX_SLEEP

but it’s not work. Because QMK is powerful and i can try another way, i’ve try to make something like custom behaviour while computer is sleeping, in keymap.c:

void suspend_power_down_kb(void) {
    suspend_power_down_user();
}

void suspend_wakeup_init_kb(void) {
    suspend_wakeup_init_user();
}

but after closing my laptop it has same behaviour.

I use RP2040 in my project, and have one OLED on my board. I think it’s not a great idea to take out usb from my board any time when i power off the computer or it goes sleep. But it would be great if i will be able to wake up laptop from sleep by my board.
I’d appreciate any help and advices!

Unspecific, but there was a change in QMK at about the same time (within a few days, at least release-wise).

This may or may not be related:

For example

“After resuming from suspend a host might immediately poll an IN endpoint but the 2nd poll has a gap of multiple seconds.”

It was in the QMK 2024-05-26 change log: QMK breaking changes:

For most users, this change will mean suspend and resume on ARM-based boards works correctly. … a whole host of hard-to-reproduce issues are mitigated by this change.

1 Like

Good to know! I remember that I played with NO_SUSPEND_POWER_DOWN in file rules.mk and my keyboard changes behaviour. You must set this value to yes and then recompile and flash your board. Now i has changed my working area, and it seems that i need my “wake up” possibility of keyboard back :sweat_smile:

I hope my topic would be handy if someone else will searching this info. Even if we talking about this after months of topic creation.

1 Like