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
a9fccb5d
Commit
a9fccb5d
authored
Aug 18, 2021
by
Robey Pointer
Browse files
finally fix uppercase filenames
parent
7ff5495a
Changes
14
Hide whitespace changes
Inline
Side-by-side
reform2-keyboard-fw/Makefile
View file @
a9fccb5d
...
...
@@ -17,8 +17,8 @@ BOARD = USBKEY
F_CPU
=
16000000
F_USB
=
$(F_CPU)
OPTIMIZATION
=
s
TARGET
=
K
eyboard
SRC
=
$(TARGET)
.c controller.c
D
escriptors.c display.c hid_report.c i2c.c menu.c ssd1306.c ux.c
$(LUFA_SRC_USB)
$(LUFA_SRC_USBCLASS)
TARGET
=
k
eyboard
SRC
=
$(TARGET)
.c controller.c
d
escriptors.c display.c hid_report.c i2c.c menu.c ssd1306.c ux.c
$(LUFA_SRC_USB)
$(LUFA_SRC_USBCLASS)
LUFA_PATH
=
./lufa-master/LUFA
CC_FLAGS
=
-DUSE_LUFA_CONFIG_HEADER
$(REFORM_KBD_OPTIONS)
-IConfig
/
LD_FLAGS
=
-Wl
,-u,vfprintf
-lprintf_flt
...
...
reform2-keyboard-fw/controller.c
View file @
a9fccb5d
...
...
@@ -12,7 +12,7 @@
#include
"LUFA/Drivers/Peripheral/Serial.h"
#include
"controller.h"
#include
"display.h"
#include
"
K
eyboard.h"
#include
"
k
eyboard.h"
#include
"ux.h"
// how long do we wait (busy loops) before giving up on a response
...
...
@@ -69,12 +69,13 @@ const char *controller_request(const char *command) {
}
}
void
controller_probe_batteries
(
battery_info_t
*
info
)
{
bool
controller_probe_batteries
(
battery_info_t
*
info
)
{
memset
(
info
->
decivolts
,
0
,
8
);
info
->
total_amps
=
info
->
total_volts
=
0
;
info
->
total_percent
=
0
;
const
char
*
response
=
controller_request
(
"c"
);
if
(
response
==
NULL
)
return
false
;
// lpc format: 32 32 32 32 32 32 32 32 mA 0256mV26143 ???%
// | | | | | | | | | | | |
...
...
@@ -96,18 +97,20 @@ void controller_probe_batteries(battery_info_t *info) {
info
->
total_amps
=
((
float
)
atoi
(
&
response
[
amps_offset
]))
/
1000
.
0
;
info
->
total_volts
=
((
float
)
atoi
(
&
response
[
volts_offset
]))
/
1000
.
0
;
info
->
total_percent
=
atoi
(
bat_gauge
);
return
true
;
}
// is the battery "alarmingly low"?
bool
controller_battery_is_low
(
void
)
{
battery_info_t
info
;
controller_probe_batteries
(
&
info
);
if
(
!
controller_probe_batteries
(
&
info
)
)
return
false
;
for
(
int
i
=
0
;
i
<
8
;
i
++
)
{
if
(
info
.
decivolts
[
i
]
<
30
)
return
true
;
}
if
(
info
.
total_percent
>
0
&&
info
.
total_percent
<
10
)
return
true
;
return
false
;
}
void
controller_turn_on_som
(
void
)
{
...
...
reform2-keyboard-fw/controller.h
View file @
a9fccb5d
...
...
@@ -19,7 +19,7 @@ typedef struct {
void
controller_init
(
void
);
const
char
*
controller_request
(
const
char
*
command
);
void
controller_probe_batteries
(
battery_info_t
*
info
);
bool
controller_probe_batteries
(
battery_info_t
*
info
);
bool
controller_battery_is_low
(
void
);
void
controller_turn_on_som
(
void
);
void
controller_turn_off_som
(
void
);
...
...
reform2-keyboard-fw/
D
escriptors.c
→
reform2-keyboard-fw/
d
escriptors.c
View file @
a9fccb5d
...
...
@@ -37,7 +37,7 @@
#include
"Config/LUFAConfig.h"
#include
"
D
escriptors.h"
#include
"
d
escriptors.h"
/** HID class report descriptor. This is a special descriptor constructed with values from the
...
...
@@ -216,4 +216,3 @@ uint16_t CALLBACK_USB_GetDescriptor(const uint16_t wValue,
*
DescriptorAddress
=
Address
;
return
Size
;
}
reform2-keyboard-fw/
D
escriptors.h
→
reform2-keyboard-fw/
d
escriptors.h
View file @
a9fccb5d
File moved
reform2-keyboard-fw/display.c
View file @
a9fccb5d
...
...
@@ -7,8 +7,8 @@
#include
<string.h>
#include
<avr/pgmspace.h>
#include
"ssd1306.h"
#include
"display.h"
#include
"ssd1306.h"
#include
"assets/oranj_reform.h"
#include
"assets/bizcat_reform.h"
...
...
reform2-keyboard-fw/flash.sh
View file @
a9fccb5d
dfu-programmer atmega32u4 erase
--suppress-bootloader-mem
dfu-programmer atmega32u4 erase
--suppress-bootloader-mem
dfu-programmer atmega32u4 flash ./
K
eyboard.hex
--suppress-bootloader-mem
dfu-programmer atmega32u4 flash ./
k
eyboard.hex
--suppress-bootloader-mem
dfu-programmer atmega32u4 start
dfu-programmer atmega32u4 start
reform2-keyboard-fw/hid_report.c
View file @
a9fccb5d
...
...
@@ -10,6 +10,8 @@
#include
<LUFA/Platform/Platform.h>
#include
"controller.h"
#include
"display.h"
#include
"keyboard.h"
#include
"menu.h"
#include
"ux.h"
// hid commands are all 4-letter
...
...
reform2-keyboard-fw/
K
eyboard.c
→
reform2-keyboard-fw/
k
eyboard.c
View file @
a9fccb5d
...
...
@@ -37,13 +37,14 @@
#include
<avr/sleep.h>
#include
"Config/LUFAConfig.h"
#include
"LUFA/Drivers/Peripheral/Serial.h"
#include
"ssd1306.h"
#include
"scancodes.h"
#include
"controller.h"
#include
"display.h"
#include
"hid_report.h"
#include
"keyboard.h"
#include
"menu.h"
#include
"scancodes.h"
#include
"ssd1306.h"
#include
"ux.h"
#include
"Keyboard.h"
//#define KBD_VARIANT_STANDALONE
#define KBD_VARIANT_QWERTY_US
...
...
@@ -335,11 +336,6 @@ int main(void) {
Delay_MS
(
10
);
}
// FIXME testing
// 16MHz clock (1)
// TCCR1B = (1);
int
counter
=
0
;
while
(
true
)
{
// do our own (non-usb) scan, too, so we can handle the circle menu
...
...
reform2-keyboard-fw/
K
eyboard.h
→
reform2-keyboard-fw/
k
eyboard.h
View file @
a9fccb5d
...
...
@@ -44,7 +44,7 @@
#include
<stdbool.h>
#include
<string.h>
#include
"
D
escriptors.h"
#include
"
d
escriptors.h"
#include
<LUFA/Drivers/Board/Joystick.h>
#include
<LUFA/Drivers/Board/LEDs.h>
...
...
@@ -68,6 +68,7 @@
/* Function Prototypes: */
void
SetupHardware
(
void
);
void
kbd_brightness_init
(
void
);
void
kbd_brightness_set
(
uint8_t
brite
);
void
EVENT_USB_Device_Connect
(
void
);
void
EVENT_USB_Device_Disconnect
(
void
);
...
...
reform2-keyboard-fw/menu.c
View file @
a9fccb5d
...
...
@@ -7,7 +7,7 @@
#include
<stdlib.h>
#include
"display.h"
#include
"
K
eyboard.h"
#include
"
k
eyboard.h"
#include
"scancodes.h"
#include
"menu.h"
...
...
reform2-keyboard-fw/ssd1306.c
View file @
a9fccb5d
#include
"ssd1306.h"
#include
"i2c.h"
#include
<string.h>
#include
<avr/pgmspace.h>
#include
"i2c.h"
#include
"ssd1306.h"
// in case you want to rotate the screen 180 degrees (half-tau)
#define ROTATE 0
...
...
reform2-keyboard-fw/ux.c
View file @
a9fccb5d
...
...
@@ -10,7 +10,7 @@
#include
"assets/images.h"
#include
"controller.h"
#include
"display.h"
#include
"
K
eyboard.h"
#include
"
k
eyboard.h"
#include
"ssd1306.h"
#include
"ux.h"
...
...
reform2-keyboard-fw/ux.h
View file @
a9fccb5d
...
...
@@ -7,8 +7,6 @@
#pragma once
#include
"display.h"
void
ux_increase_oled_brightness
(
void
);
void
ux_decrease_oled_brightness
(
void
);
void
ux_show_battery
(
void
);
...
...
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