Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No wake from USB Suspend #21

Open
tulth opened this issue Mar 7, 2015 · 1 comment
Open

No wake from USB Suspend #21

tulth opened this issue Mar 7, 2015 · 1 comment

Comments

@tulth
Copy link

tulth commented Mar 7, 2015

Problem: Using my Ergodox on Arch Linux, the Ergodox will not wake the computer from suspend.

Attempted fix:

First "fix" caused it to always wake up instantly.

Ultimately ended up with the following diffs and it works great for me:

--- a/common/avr/suspend.c
+++ b/common/avr/suspend.c
@@ -59,6 +59,7 @@ static void power_down(uint8_t wdto)
 #ifdef PROTOCOL_LUFA
     if (USB_DeviceState == DEVICE_STATE_Configured) return;
 #endif
+#ifndef NO_SUSPEND_POWER_DOWN
     wdt_timeout = wdto;

     // Watchdog Interrupt Mode
@@ -78,6 +79,7 @@ static void power_down(uint8_t wdto)

     // Disable watchdog after sleep
     wdt_disable();
+#endif
 }

 void suspend_power_down(void)
@@ -90,8 +92,10 @@ bool suspend_wakeup_condition(void)
     matrix_power_up();
     matrix_scan();
     matrix_power_down();
-    for (uint8_t r = 0; r < MATRIX_ROWS; r++) {
-        if (matrix_get_row(r)) return true;
+    for (uint8_t r = 0; r < MATRIX_ROWS; r++) { 
+      for (uint8_t c = 0; c < MATRIX_COLS; c++) {
+        if (matrix_is_on(r,c)) { return true; }
+      }
     }
     return false;
 }
@cdarken
Copy link

cdarken commented Mar 21, 2015

you should make a pull request. maybe he'll merge it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants