Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Robey Pointer
reform
Commits
f0324df1
Commit
f0324df1
authored
Sep 06, 2021
by
Robey Pointer
Browse files
fix some things i broke during rebase
parent
8b6a42c6
Changes
3
Hide whitespace changes
Inline
Side-by-side
reform2-keyboard-fw/controller.c
View file @
f0324df1
...
...
@@ -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
// Unfortunat
e
ly 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
{
...
...
reform2-keyboard-fw/flash.sh
View file @
f0324df1
#!/bin/sh
dfu-programmer atmega32u4 erase
--suppress-bootloader-mem
...
...
reform2-keyboard-fw/keyboard.c
View file @
f0324df1
...
...
@@ -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
)
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment