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

finally fix uppercase filenames

parent 7ff5495a
......@@ -17,8 +17,8 @@ BOARD = USBKEY
F_CPU = 16000000
F_USB = $(F_CPU)
OPTIMIZATION = s
TARGET = Keyboard
SRC = $(TARGET).c controller.c Descriptors.c display.c hid_report.c i2c.c menu.c ssd1306.c ux.c $(LUFA_SRC_USB) $(LUFA_SRC_USBCLASS)
TARGET = keyboard
SRC = $(TARGET).c controller.c descriptors.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
......
......@@ -12,7 +12,7 @@
#include "LUFA/Drivers/Peripheral/Serial.h"
#include "controller.h"
#include "display.h"
#include "Keyboard.h"
#include "keyboard.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) {
......
......@@ -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);
......
......@@ -37,7 +37,7 @@
#include "Config/LUFAConfig.h"
#include "Descriptors.h"
#include "descriptors.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;
}
......@@ -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"
......
dfu-programmer atmega32u4 erase --suppress-bootloader-mem
dfu-programmer atmega32u4 erase --suppress-bootloader-mem
dfu-programmer atmega32u4 flash ./Keyboard.hex --suppress-bootloader-mem
dfu-programmer atmega32u4 flash ./keyboard.hex --suppress-bootloader-mem
dfu-programmer atmega32u4 start
dfu-programmer atmega32u4 start
......@@ -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
......
......@@ -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
......
......@@ -44,7 +44,7 @@
#include <stdbool.h>
#include <string.h>
#include "Descriptors.h"
#include "descriptors.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);
......
......@@ -7,7 +7,7 @@
#include <stdlib.h>
#include "display.h"
#include "Keyboard.h"
#include "keyboard.h"
#include "scancodes.h"
#include "menu.h"
......
#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
......
......@@ -10,7 +10,7 @@
#include "assets/images.h"
#include "controller.h"
#include "display.h"
#include "Keyboard.h"
#include "keyboard.h"
#include "ssd1306.h"
#include "ux.h"
......
......@@ -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);
......
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