diff options
author | Daniel Friesel <derf@finalrewind.org> | 2016-01-15 20:27:22 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2016-01-15 20:27:22 +0100 |
commit | 4c6cb2e5c4748502cbd26d3bd38e490ebead197f (patch) | |
tree | 4bf36680ef4fb9ee464d1a0699711f3f8bdc3e56 /src/system.cc | |
parent | fd6f265cbc7270bd69b4f8b68d7ec6c436e67d39 (diff) |
turn modem voltage divider off during sleep
needs hw revision >= git commit 71f427bd100963b1aafb545bfca319c50e1c48cd
Diffstat (limited to 'src/system.cc')
-rw-r--r-- | src/system.cc | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/system.cc b/src/system.cc index 9aaa62b..b98e687 100644 --- a/src/system.cc +++ b/src/system.cc @@ -34,6 +34,8 @@ void System::loop() // turn off display to indicate we're about to shut down display.turn_off(); + modem.disable(); + // wait until both buttons are released while (!((PINC & _BV(PC3)) && (PINC & _BV(PC7)))) ; @@ -57,6 +59,9 @@ void System::loop() // turn on display display.turn_on(); + // ... and modem + modem.enable(); + want_shutdown = 0; } } @@ -64,9 +69,9 @@ void System::loop() want_shutdown = 0; } - if (modem.buffer_available()) { + while (modem.buffer_available()) { disp[i++] = modem.buffer_get(); - if (i == 7) + if (i == 8) i = 0; } } |