Commit f0324df1 authored by Robey Pointer's avatar Robey Pointer
Browse files

fix some things i broke during rebase

parent 8b6a42c6
......@@ -9,10 +9,12 @@
// controller, which has things like battery status.
#include <stdlib.h>
#include <avr/sleep.h>
#include "LUFA/Drivers/Peripheral/Serial.h"
#include "controller.h"
#include "display.h"
#include "keyboard.h"
#include "ssd1306.h"
#include "ux.h"
// how long do we wait (busy loops) before giving up on a response
......@@ -126,7 +128,7 @@ void controller_turn_off_som(void) {
ux_unsplash();
controller_send("0p");
flush();
EnterPowerOff();
controller_turn_off_keyboard();
}
void controller_reset_som(void) {
......@@ -157,8 +159,9 @@ void controller_turn_off_keyboard(void) {
kbd_brightness_set(0);
// Turn off OLED to save power
gfx_clear_screen();
gfx_off();
display_clear();
display_flush();
oled_off();
// Disable ADC to save even more power
ADCSRA = 0;
......@@ -173,9 +176,9 @@ void controller_turn_off_keyboard(void) {
// ROW1 is the only row driven low and left low, thus is always ready to be read out
// We just need to check COL14 (PC6) if it is low (pressed) or high
// Unfortunatly the circle key is on COL14(PC6) which doesn't have pin change interrupt
// Unfortunately the circle key is on COL14(PC6) which doesn't have pin change interrupt
// capabilities, so we need to wake up every so often to check if it is pressed, and
// if so bring us out of power-off
// if so bring us out of power-off.
// We can use the Watchdog timer to do this.
do {
......
#!/bin/sh
dfu-programmer atmega32u4 erase --suppress-bootloader-mem
......
......@@ -201,7 +201,7 @@ const menu_item_t circle_menu[] = {
{ "Key Lights \x1e", "F4", KEY_F4, false, kbd_brightness_inc },
{ "Wake", "SPC", KEY_SPACE, true, controller_wake_som },
{ "System Status", "S", KEY_S, true, ux_show_status },
{ "Keyboard off", "P", KEY_P, true, controller_keyboard_off },
{ "Keyboard off", "P", KEY_P, true, controller_turn_off_keyboard },
{ "", "", KEY_Z, true, local_test },
MENU_END
};
......@@ -339,8 +339,6 @@ int main(void) {
#endif
SetupHardware();
GlobalInterruptEnable();
set_sleep_mode(SLEEP_MODE_IDLE);
// check for safe boot (holding down the circle key for 500msec)...
// this is to cover a case where the firmware is messed up enough that
......@@ -461,6 +459,9 @@ void SetupHardware(void) {
controller_init();
USB_Init();
GlobalInterruptEnable();
set_sleep_mode(SLEEP_MODE_IDLE);
}
ISR(WDT_vect)
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment