From 02a3d77940d9b9dcf3af3e8ca9672145155fbfe6 Mon Sep 17 00:00:00 2001 From: Wojciech Siewierski Date: Wed, 13 Apr 2016 22:24:42 +0200 Subject: Optimize source_layers_cache for the cache memory Swapping the array indices should increase the locality of the memory access. --- tmk_core/common/action_layer.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'tmk_core') diff --git a/tmk_core/common/action_layer.c b/tmk_core/common/action_layer.c index fc721a7323..e817c0d515 100644 --- a/tmk_core/common/action_layer.c +++ b/tmk_core/common/action_layer.c @@ -111,7 +111,7 @@ void layer_debug(void) #endif #if !defined(NO_ACTION_LAYER) && defined(PREVENT_STUCK_MODIFIERS) -uint8_t source_layers_cache[MAX_LAYER_BITS][(MATRIX_ROWS * MATRIX_COLS + 7) / 8] = {0}; +uint8_t source_layers_cache[(MATRIX_ROWS * MATRIX_COLS + 7) / 8][MAX_LAYER_BITS] = {0}; void update_source_layers_cache(keypos_t key, uint8_t layer) { @@ -120,9 +120,9 @@ void update_source_layers_cache(keypos_t key, uint8_t layer) const uint8_t storage_bit = key_number % 8; for (uint8_t bit_number = 0; bit_number < MAX_LAYER_BITS; bit_number++) { - source_layers_cache[bit_number][storage_row] ^= + source_layers_cache[storage_row][bit_number] ^= (-((layer & (1U << bit_number)) != 0) - ^ source_layers_cache[bit_number][storage_row]) + ^ source_layers_cache[storage_row][bit_number]) & (1U << storage_bit); } } @@ -136,7 +136,7 @@ uint8_t read_source_layers_cache(keypos_t key) for (uint8_t bit_number = 0; bit_number < MAX_LAYER_BITS; bit_number++) { layer |= - ((source_layers_cache[bit_number][storage_row] + ((source_layers_cache[storage_row][bit_number] & (1U << storage_bit)) != 0) << bit_number; } -- cgit v1.2.3 From 3755ef5ddbdad9f25a53fee951c3eb78035b52c3 Mon Sep 17 00:00:00 2001 From: IBNobody Date: Wed, 13 Apr 2016 20:57:51 -0500 Subject: Compiler Warnings / Atomic TLC Corrected compiler warnings for a number of issues. Gave Atomic some TLC. --- tmk_core/common/action_code.h | 2 +- tmk_core/common/keymap.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'tmk_core') diff --git a/tmk_core/common/action_code.h b/tmk_core/common/action_code.h index 4fe9c1d581..2b0b0b077e 100644 --- a/tmk_core/common/action_code.h +++ b/tmk_core/common/action_code.h @@ -301,7 +301,7 @@ enum backlight_opt { #define ACTION_BACKLIGHT_DECREASE() ACTION(ACT_BACKLIGHT, BACKLIGHT_DECREASE << 8) #define ACTION_BACKLIGHT_TOGGLE() ACTION(ACT_BACKLIGHT, BACKLIGHT_TOGGLE << 8) #define ACTION_BACKLIGHT_STEP() ACTION(ACT_BACKLIGHT, BACKLIGHT_STEP << 8) -#define ACTION_BACKLIGHT_LEVEL(level) ACTION(ACT_BACKLIGHT, BACKLIGHT_LEVEL << 8 | level) +#define ACTION_BACKLIGHT_LEVEL(level) ACTION(ACT_BACKLIGHT, BACKLIGHT_LEVEL << 8 | (level)) /* Command */ #define ACTION_COMMAND(id, opt) ACTION(ACT_COMMAND, (opt)<<8 | (addr)) /* Function */ diff --git a/tmk_core/common/keymap.c b/tmk_core/common/keymap.c index 11f4aa8aaa..8955fc710d 100644 --- a/tmk_core/common/keymap.c +++ b/tmk_core/common/keymap.c @@ -22,7 +22,7 @@ along with this program. If not, see . #include "action_macro.h" #include "wait.h" #include "debug.h" - +#include "bootloader.h" static action_t keycode_to_action(uint8_t keycode); @@ -143,6 +143,7 @@ static action_t keycode_to_action(uint8_t keycode) action.code = ACTION_TRANSPARENT; break; case KC_BOOTLOADER: + action.code = ACTION_NO; clear_keyboard(); wait_ms(50); bootloader_jump(); // not return -- cgit v1.2.3 From f051496f1343259f4da8c5d917b9c9e47b97e38c Mon Sep 17 00:00:00 2001 From: IBNobody Date: Thu, 14 Apr 2016 18:01:29 -0500 Subject: Checkin --- tmk_core/common/action_layer.h | 1 + 1 file changed, 1 insertion(+) (limited to 'tmk_core') diff --git a/tmk_core/common/action_layer.h b/tmk_core/common/action_layer.h index 3a4b1e3349..025cf5420f 100644 --- a/tmk_core/common/action_layer.h +++ b/tmk_core/common/action_layer.h @@ -68,6 +68,7 @@ void layer_xor(uint32_t state); #define layer_and(state) #define layer_xor(state) #define layer_debug() + #endif /* pressed actions cache */ -- cgit v1.2.3 From 63462bf8c12cea1c13ca1bd1f105fe53f556806e Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Thu, 14 Apr 2016 20:42:14 -0400 Subject: changing up the makefile a bit --- tmk_core/common.mk | 26 +++++++++++++------------- tmk_core/protocol/lufa.mk | 4 ++-- 2 files changed, 15 insertions(+), 15 deletions(-) (limited to 'tmk_core') diff --git a/tmk_core/common.mk b/tmk_core/common.mk index 89c366f554..8d028d52ac 100644 --- a/tmk_core/common.mk +++ b/tmk_core/common.mk @@ -17,66 +17,66 @@ SRC += $(COMMON_DIR)/host.c \ # Option modules -ifdef BOOTMAGIC_ENABLE +ifeq ($(BOOTMAGIC_ENABLE), yes) SRC += $(COMMON_DIR)/bootmagic.c SRC += $(COMMON_DIR)/avr/eeconfig.c OPT_DEFS += -DBOOTMAGIC_ENABLE endif -ifdef MOUSEKEY_ENABLE +ifeq ($(MOUSEKEY_ENABLE), yes) SRC += $(COMMON_DIR)/mousekey.c OPT_DEFS += -DMOUSEKEY_ENABLE OPT_DEFS += -DMOUSE_ENABLE endif -ifdef EXTRAKEY_ENABLE +ifeq ($(EXTRAKEY_ENABLE), yes) OPT_DEFS += -DEXTRAKEY_ENABLE endif -ifdef CONSOLE_ENABLE +ifeq ($(CONSOLE_ENABLE), yes) OPT_DEFS += -DCONSOLE_ENABLE else OPT_DEFS += -DNO_PRINT OPT_DEFS += -DNO_DEBUG endif -ifdef COMMAND_ENABLE +ifeq ($(COMMAND_ENABLE), yes) SRC += $(COMMON_DIR)/command.c OPT_DEFS += -DCOMMAND_ENABLE endif -ifdef NKRO_ENABLE +ifeq ($(NKRO_ENABLE), yes) OPT_DEFS += -DNKRO_ENABLE endif -ifdef MIDI_ENABLE +ifeq ($(MIDI_ENABLE), yes) OPT_DEFS += -DMIDI_ENABLE endif -ifdef AUDIO_ENABLE +ifeq ($(AUDIO_ENABLE), yes) OPT_DEFS += -DAUDIO_ENABLE endif -ifdef USB_6KRO_ENABLE +ifeq ($(USB_6KRO_ENABLE), yes) OPT_DEFS += -DUSB_6KRO_ENABLE endif -ifdef SLEEP_LED_ENABLE +ifeq ($(SLEEP_LED_ENABLE), yes) SRC += $(COMMON_DIR)/sleep_led.c OPT_DEFS += -DSLEEP_LED_ENABLE OPT_DEFS += -DNO_SUSPEND_POWER_DOWN endif -ifdef BACKLIGHT_ENABLE +ifeq ($(BACKLIGHT_ENABLE), yes) SRC += $(COMMON_DIR)/backlight.c OPT_DEFS += -DBACKLIGHT_ENABLE endif -ifdef BLUETOOTH_ENABLE +ifeq ($(BLUETOOTH_ENABLE), yes) OPT_DEFS += -DBLUETOOTH_ENABLE endif -ifdef KEYMAP_SECTION_ENABLE +ifeq ($(KEYMAP_SECTION_ENABLE), yes) OPT_DEFS += -DKEYMAP_SECTION_ENABLE ifeq ($(strip $(MCU)),atmega32u2) diff --git a/tmk_core/protocol/lufa.mk b/tmk_core/protocol/lufa.mk index 4905760bb4..f3209c227e 100644 --- a/tmk_core/protocol/lufa.mk +++ b/tmk_core/protocol/lufa.mk @@ -17,7 +17,7 @@ LUFA_SRC = $(LUFA_DIR)/lufa.c \ $(LUFA_DIR)/descriptor.c \ $(LUFA_SRC_USB) -ifdef MIDI_ENABLE +ifeq ($(MIDI_ENABLE), yes) LUFA_SRC += $(LUFA_DIR)/midi/midi.c \ $(LUFA_DIR)/midi/midi_device.c \ $(LUFA_DIR)/midi/bytequeue/bytequeue.c \ @@ -25,7 +25,7 @@ ifdef MIDI_ENABLE $(LUFA_SRC_USBCLASS) endif -ifdef BLUETOOTH_ENABLE +ifeq ($(BLUETOOTH_ENABLE), yes) LUFA_SRC += $(LUFA_DIR)/bluetooth.c \ $(TMK_DIR)/protocol/serial_uart.c endif -- cgit v1.2.3 From 43a4ffc25971b2aea94b65ca1db66371e653ec5f Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Thu, 14 Apr 2016 23:53:35 -0400 Subject: bootmagic somehow not getting enabled, so adding eeconfig to backlight src include cond --- tmk_core/common.mk | 1 + 1 file changed, 1 insertion(+) (limited to 'tmk_core') diff --git a/tmk_core/common.mk b/tmk_core/common.mk index 8d028d52ac..030767cc3f 100644 --- a/tmk_core/common.mk +++ b/tmk_core/common.mk @@ -69,6 +69,7 @@ endif ifeq ($(BACKLIGHT_ENABLE), yes) SRC += $(COMMON_DIR)/backlight.c + SRC += $(COMMON_DIR)/avr/eeconfig.c OPT_DEFS += -DBACKLIGHT_ENABLE endif -- cgit v1.2.3 From bb0836c62016f482f517771a9f5a8dbc68bd0a1c Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Fri, 15 Apr 2016 00:26:22 -0400 Subject: the spacessss --- tmk_core/common.mk | 26 +++++++++++++------------- tmk_core/protocol/lufa.mk | 4 ++-- 2 files changed, 15 insertions(+), 15 deletions(-) (limited to 'tmk_core') diff --git a/tmk_core/common.mk b/tmk_core/common.mk index 030767cc3f..f8006c6708 100644 --- a/tmk_core/common.mk +++ b/tmk_core/common.mk @@ -17,67 +17,67 @@ SRC += $(COMMON_DIR)/host.c \ # Option modules -ifeq ($(BOOTMAGIC_ENABLE), yes) +ifeq ($(strip $(BOOTMAGIC_ENABLE)), yes) SRC += $(COMMON_DIR)/bootmagic.c SRC += $(COMMON_DIR)/avr/eeconfig.c OPT_DEFS += -DBOOTMAGIC_ENABLE endif -ifeq ($(MOUSEKEY_ENABLE), yes) +ifeq ($(strip $(MOUSEKEY_ENABLE)), yes) SRC += $(COMMON_DIR)/mousekey.c OPT_DEFS += -DMOUSEKEY_ENABLE OPT_DEFS += -DMOUSE_ENABLE endif -ifeq ($(EXTRAKEY_ENABLE), yes) +ifeq ($(strip $(EXTRAKEY_ENABLE)), yes) OPT_DEFS += -DEXTRAKEY_ENABLE endif -ifeq ($(CONSOLE_ENABLE), yes) +ifeq ($(strip $(CONSOLE_ENABLE)), yes) OPT_DEFS += -DCONSOLE_ENABLE else OPT_DEFS += -DNO_PRINT OPT_DEFS += -DNO_DEBUG endif -ifeq ($(COMMAND_ENABLE), yes) +ifeq ($(strip $(COMMAND_ENABLE)), yes) SRC += $(COMMON_DIR)/command.c OPT_DEFS += -DCOMMAND_ENABLE endif -ifeq ($(NKRO_ENABLE), yes) +ifeq ($(strip $(NKRO_ENABLE)), yes) OPT_DEFS += -DNKRO_ENABLE endif -ifeq ($(MIDI_ENABLE), yes) +ifeq ($(strip $(MIDI_ENABLE)), yes) OPT_DEFS += -DMIDI_ENABLE endif -ifeq ($(AUDIO_ENABLE), yes) +ifeq ($(strip $(AUDIO_ENABLE)), yes) OPT_DEFS += -DAUDIO_ENABLE endif -ifeq ($(USB_6KRO_ENABLE), yes) +ifeq ($(strip $(USB_6KRO_ENABLE)), yes) OPT_DEFS += -DUSB_6KRO_ENABLE endif -ifeq ($(SLEEP_LED_ENABLE), yes) +ifeq ($(strip $(SLEEP_LED_ENABLE)), yes) SRC += $(COMMON_DIR)/sleep_led.c OPT_DEFS += -DSLEEP_LED_ENABLE OPT_DEFS += -DNO_SUSPEND_POWER_DOWN endif -ifeq ($(BACKLIGHT_ENABLE), yes) +ifeq ($(strip $(BACKLIGHT_ENABLE)), yes) SRC += $(COMMON_DIR)/backlight.c SRC += $(COMMON_DIR)/avr/eeconfig.c OPT_DEFS += -DBACKLIGHT_ENABLE endif -ifeq ($(BLUETOOTH_ENABLE), yes) +ifeq ($(strip $(BLUETOOTH_ENABLE)), yes) OPT_DEFS += -DBLUETOOTH_ENABLE endif -ifeq ($(KEYMAP_SECTION_ENABLE), yes) +ifeq ($(strip $(KEYMAP_SECTION_ENABLE)), yes) OPT_DEFS += -DKEYMAP_SECTION_ENABLE ifeq ($(strip $(MCU)),atmega32u2) diff --git a/tmk_core/protocol/lufa.mk b/tmk_core/protocol/lufa.mk index f3209c227e..9ac6298f11 100644 --- a/tmk_core/protocol/lufa.mk +++ b/tmk_core/protocol/lufa.mk @@ -17,7 +17,7 @@ LUFA_SRC = $(LUFA_DIR)/lufa.c \ $(LUFA_DIR)/descriptor.c \ $(LUFA_SRC_USB) -ifeq ($(MIDI_ENABLE), yes) +ifeq ($(strip $(MIDI_ENABLE)), yes) LUFA_SRC += $(LUFA_DIR)/midi/midi.c \ $(LUFA_DIR)/midi/midi_device.c \ $(LUFA_DIR)/midi/bytequeue/bytequeue.c \ @@ -25,7 +25,7 @@ ifeq ($(MIDI_ENABLE), yes) $(LUFA_SRC_USBCLASS) endif -ifeq ($(BLUETOOTH_ENABLE), yes) +ifeq ($(strip $(BLUETOOTH_ENABLE)), yes) LUFA_SRC += $(LUFA_DIR)/bluetooth.c \ $(TMK_DIR)/protocol/serial_uart.c endif -- cgit v1.2.3 From 0faa18eab996c2cfcc5da0b60b702f52335c5854 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Fri, 15 Apr 2016 23:38:21 -0400 Subject: audio enable stored in eeprom --- tmk_core/common/avr/eeconfig.c | 8 ++++++++ tmk_core/common/eeconfig.h | 6 ++++++ 2 files changed, 14 insertions(+) (limited to 'tmk_core') diff --git a/tmk_core/common/avr/eeconfig.c b/tmk_core/common/avr/eeconfig.c index 5bd47dc6ad..d0c3f4f570 100644 --- a/tmk_core/common/avr/eeconfig.c +++ b/tmk_core/common/avr/eeconfig.c @@ -13,6 +13,9 @@ void eeconfig_init(void) #ifdef BACKLIGHT_ENABLE eeprom_write_byte(EECONFIG_BACKLIGHT, 0); #endif +#ifdef AUDIO_ENABLE + eeprom_write_byte(EECONFIG_AUDIO, 0); +#endif } void eeconfig_enable(void) @@ -43,3 +46,8 @@ void eeconfig_write_keymap(uint8_t val) { eeprom_write_byte(EECONFIG_KEYMAP, val uint8_t eeconfig_read_backlight(void) { return eeprom_read_byte(EECONFIG_BACKLIGHT); } void eeconfig_write_backlight(uint8_t val) { eeprom_write_byte(EECONFIG_BACKLIGHT, val); } #endif + +#ifdef AUDIO_ENABLE +uint8_t eeconfig_read_audio(void) { return eeprom_read_byte(EECONFIG_AUDIO); } +void eeconfig_write_audio(uint8_t val) { eeprom_write_byte(EECONFIG_AUDIO, val); } +#endif \ No newline at end of file diff --git a/tmk_core/common/eeconfig.h b/tmk_core/common/eeconfig.h index 3cd1a174f6..ddefca1347 100644 --- a/tmk_core/common/eeconfig.h +++ b/tmk_core/common/eeconfig.h @@ -31,6 +31,7 @@ along with this program. If not, see . #define EECONFIG_KEYMAP (uint8_t *)4 #define EECONFIG_MOUSEKEY_ACCEL (uint8_t *)5 #define EECONFIG_BACKLIGHT (uint8_t *)6 +#define EECONFIG_AUDIO (uint8_t *)7 /* debug bit */ @@ -72,4 +73,9 @@ uint8_t eeconfig_read_backlight(void); void eeconfig_write_backlight(uint8_t val); #endif +#ifdef AUDIO_ENABLE +uint8_t eeconfig_read_audio(void); +void eeconfig_write_audio(uint8_t val); +#endif + #endif -- cgit v1.2.3 From c294636c666a6c4a9c170a9a7f62607d48081b3c Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Fri, 15 Apr 2016 23:46:35 -0400 Subject: audio on by default --- tmk_core/common/avr/eeconfig.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tmk_core') diff --git a/tmk_core/common/avr/eeconfig.c b/tmk_core/common/avr/eeconfig.c index d0c3f4f570..25bb9e849c 100644 --- a/tmk_core/common/avr/eeconfig.c +++ b/tmk_core/common/avr/eeconfig.c @@ -14,7 +14,7 @@ void eeconfig_init(void) eeprom_write_byte(EECONFIG_BACKLIGHT, 0); #endif #ifdef AUDIO_ENABLE - eeprom_write_byte(EECONFIG_AUDIO, 0); + eeprom_write_byte(EECONFIG_AUDIO, 0xFF); // On by default #endif } -- cgit v1.2.3 From ab19ebd08a8b955775e6fa94cdf6b8d128d8b43c Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Sat, 16 Apr 2016 18:51:58 -0400 Subject: MAGIC functionality, AG swap in default layout --- tmk_core/common.mk | 3 +++ tmk_core/common/keyboard.c | 8 +++++++- tmk_core/common/keymap.h | 3 --- tmk_core/common/magic.c | 36 ++++++++++++++++++++++++++++++++++++ tmk_core/common/magic.h | 6 ++++++ 5 files changed, 52 insertions(+), 4 deletions(-) create mode 100644 tmk_core/common/magic.c create mode 100644 tmk_core/common/magic.h (limited to 'tmk_core') diff --git a/tmk_core/common.mk b/tmk_core/common.mk index f8006c6708..9cb2eb8ecd 100644 --- a/tmk_core/common.mk +++ b/tmk_core/common.mk @@ -21,6 +21,9 @@ ifeq ($(strip $(BOOTMAGIC_ENABLE)), yes) SRC += $(COMMON_DIR)/bootmagic.c SRC += $(COMMON_DIR)/avr/eeconfig.c OPT_DEFS += -DBOOTMAGIC_ENABLE +else + SRC += $(COMMON_DIR)/magic.c + SRC += $(COMMON_DIR)/avr/eeconfig.c endif ifeq ($(strip $(MOUSEKEY_ENABLE)), yes) diff --git a/tmk_core/common/keyboard.c b/tmk_core/common/keyboard.c index 302b3ec87c..1d99818481 100644 --- a/tmk_core/common/keyboard.c +++ b/tmk_core/common/keyboard.c @@ -27,7 +27,11 @@ along with this program. If not, see . #include "command.h" #include "util.h" #include "sendchar.h" -#include "bootmagic.h" +#ifdef BOOTMAGIC_ENABLE + #include "bootmagic.h" +#else + #include "magic.h" +#endif #include "eeconfig.h" #include "backlight.h" #ifdef MOUSEKEY_ENABLE @@ -86,6 +90,8 @@ void keyboard_init(void) #ifdef BOOTMAGIC_ENABLE bootmagic(); +#else + magic(); #endif #ifdef BACKLIGHT_ENABLE diff --git a/tmk_core/common/keymap.h b/tmk_core/common/keymap.h index e1a6f992e6..abc9bdb32d 100644 --- a/tmk_core/common/keymap.h +++ b/tmk_core/common/keymap.h @@ -22,8 +22,6 @@ along with this program. If not, see . #include #include "action.h" - -#ifdef BOOTMAGIC_ENABLE /* NOTE: Not portable. Bit field order depends on implementation */ typedef union { uint8_t raw; @@ -39,7 +37,6 @@ typedef union { }; } keymap_config_t; keymap_config_t keymap_config; -#endif /* translates key to keycode */ diff --git a/tmk_core/common/magic.c b/tmk_core/common/magic.c new file mode 100644 index 0000000000..f21d1346c7 --- /dev/null +++ b/tmk_core/common/magic.c @@ -0,0 +1,36 @@ +#include +#include +#include +#include "matrix.h" +#include "bootloader.h" +#include "debug.h" +#include "keymap.h" +#include "host.h" +#include "action_layer.h" +#include "eeconfig.h" +#include "magic.h" + +keymap_config_t keymap_config; + +void magic(void) +{ + /* check signature */ + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } + + /* debug enable */ + debug_config.raw = eeconfig_read_debug(); + + /* keymap config */ + keymap_config.raw = eeconfig_read_keymap(); + +#ifdef NKRO_ENABLE + keyboard_nkro = keymap_config.nkro; +#endif + + uint8_t default_layer = 0; + default_layer = eeconfig_read_default_layer(); + default_layer_set((uint32_t)default_layer); + +} \ No newline at end of file diff --git a/tmk_core/common/magic.h b/tmk_core/common/magic.h new file mode 100644 index 0000000000..3fa2d8b81c --- /dev/null +++ b/tmk_core/common/magic.h @@ -0,0 +1,6 @@ +#ifndef MAGIC_H +#define MAGIC_H + +void magic(void); + +#endif -- cgit v1.2.3 From d5b72e7bde5ede25f7d5699b50b7d9eb6f31ba92 Mon Sep 17 00:00:00 2001 From: IBNobody Date: Sun, 17 Apr 2016 12:54:32 -0500 Subject: Fixed many compiler warnings related to print being disabled --- tmk_core/common/action.c | 8 ++++---- tmk_core/common/action_layer.c | 12 ++++++------ tmk_core/common/action_macro.c | 8 ++++---- tmk_core/common/action_tapping.c | 11 ++++++----- tmk_core/common/command.c | 25 ++++++++++++++++--------- tmk_core/common/print.h | 12 ++++++------ tmk_core/protocol/lufa/lufa.c | 18 +++++++----------- 7 files changed, 49 insertions(+), 45 deletions(-) (limited to 'tmk_core') diff --git a/tmk_core/common/action.c b/tmk_core/common/action.c index f9e6c17dc3..0162fbd632 100644 --- a/tmk_core/common/action.c +++ b/tmk_core/common/action.c @@ -27,11 +27,11 @@ along with this program. If not, see . #include "action_util.h" #include "action.h" -#ifdef DEBUG_ACTION +//#ifdef DEBUG_ACTION #include "debug.h" -#else -#include "nodebug.h" -#endif +//#else +//#include "nodebug.h" +//#endif void action_exec(keyevent_t event) diff --git a/tmk_core/common/action_layer.c b/tmk_core/common/action_layer.c index e817c0d515..845fbbb210 100644 --- a/tmk_core/common/action_layer.c +++ b/tmk_core/common/action_layer.c @@ -4,14 +4,14 @@ #include "util.h" #include "action_layer.h" -#ifdef DEBUG_ACTION +//#ifdef DEBUG_ACTION #include "debug.h" -#else -#include "nodebug.h" -#endif +//#else +//#include "nodebug.h" +//#endif -/* +/* * Default Layer State */ uint32_t default_layer_state = 0; @@ -52,7 +52,7 @@ void default_layer_xor(uint32_t state) #ifndef NO_ACTION_LAYER -/* +/* * Keymap Layer State */ uint32_t layer_state = 0; diff --git a/tmk_core/common/action_macro.c b/tmk_core/common/action_macro.c index 7726b11907..cc78c82327 100644 --- a/tmk_core/common/action_macro.c +++ b/tmk_core/common/action_macro.c @@ -19,11 +19,11 @@ along with this program. If not, see . #include "action_macro.h" #include "wait.h" -#ifdef DEBUG_ACTION +//#ifdef DEBUG_ACTION #include "debug.h" -#else -#include "nodebug.h" -#endif +//#else +//#include "nodebug.h" +//#endif #ifndef NO_ACTION_MACRO diff --git a/tmk_core/common/action_tapping.c b/tmk_core/common/action_tapping.c index 826c233096..6b6fa1dfe2 100644 --- a/tmk_core/common/action_tapping.c +++ b/tmk_core/common/action_tapping.c @@ -6,11 +6,11 @@ #include "keycode.h" #include "timer.h" -#ifdef DEBUG_ACTION +//#ifdef DEBUG_ACTION #include "debug.h" -#else -#include "nodebug.h" -#endif +//#else +//#include "nodebug.h" +//#endif #ifndef NO_ACTION_TAPPING @@ -139,7 +139,7 @@ bool process_tapping(keyrecord_t *keyp) if (event.pressed) { tapping_key.tap.interrupted = true; } - // enqueue + // enqueue return false; } } @@ -324,6 +324,7 @@ bool waiting_buffer_typed(keyevent_t event) return false; } +__attribute__((unused)) bool waiting_buffer_has_anykey_pressed(void) { for (uint8_t i = waiting_buffer_tail; i != waiting_buffer_head; i = (i + 1) % WAITING_BUFFER_SIZE) { diff --git a/tmk_core/common/command.c b/tmk_core/common/command.c index b4cd3ca56b..7572b95979 100644 --- a/tmk_core/common/command.c +++ b/tmk_core/common/command.c @@ -122,7 +122,7 @@ static void command_common_help(void) STR(MAGIC_KEY_VERSION ) ": Version\n" STR(MAGIC_KEY_STATUS ) ": Status\n" STR(MAGIC_KEY_CONSOLE ) ": Activate Console Mode\n" - + #if MAGIC_KEY_SWITCH_LAYER_WITH_CUSTOM STR(MAGIC_KEY_LAYER0 ) ": Switch to Layer 0\n" STR(MAGIC_KEY_LAYER1 ) ": Switch to Layer 1\n" @@ -136,11 +136,11 @@ static void command_common_help(void) STR(MAGIC_KEY_LAYER9 ) ": Switch to Layer 9\n" #endif -#if MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS +#if MAGIC_KEY_SWITCH_LAYER_WITH_FKEYS "F1-F10: Switch to Layer 0-9 (F10 = L0)\n" #endif -#if MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS +#if MAGIC_KEY_SWITCH_LAYER_WITH_NKEYS "0-9: Switch to Layer 0-9\n" #endif @@ -251,6 +251,7 @@ static void print_status(void) #ifdef BOOTMAGIC_ENABLE static void print_eeconfig(void) { +#ifndef NO_PRINT print("default_layer: "); print_dec(eeconfig_read_default_layer()); print("\n"); debug_config_t dc; @@ -279,9 +280,12 @@ static void print_eeconfig(void) print("backlight_config.raw: "); print_hex8(bc.raw); print("\n"); print(".enable: "); print_dec(bc.enable); print("\n"); print(".level: "); print_dec(bc.level); print("\n"); -#endif +#endif /* BACKLIGHT_ENABLE */ + +#endif /* !NO_PRINT */ + } -#endif +#endif /* BOOTMAGIC_ENABLE */ static bool command_common(uint8_t code) { @@ -305,7 +309,7 @@ static bool command_common(uint8_t code) #ifdef BOOTMAGIC_ENABLE // print stored eeprom config - case MAGIC_KC(MAGIC_KEY_EEPROM): + case MAGIC_KC(MAGIC_KEY_EEPROM): print("eeconfig:\n"); print_eeconfig(); break; @@ -369,7 +373,7 @@ static bool command_common(uint8_t code) break; // debug matrix toggle - case MAGIC_KC(MAGIC_KEY_DEBUG_MATRIX): + case MAGIC_KC(MAGIC_KEY_DEBUG_MATRIX): debug_matrix = !debug_matrix; if (debug_matrix) { print("\nmatrix: on\n"); @@ -380,7 +384,7 @@ static bool command_common(uint8_t code) break; // debug keyboard toggle - case MAGIC_KC(MAGIC_KEY_DEBUG_KBD): + case MAGIC_KC(MAGIC_KEY_DEBUG_KBD): debug_keyboard = !debug_keyboard; if (debug_keyboard) { print("\nkeyboard: on\n"); @@ -551,6 +555,7 @@ static uint8_t mousekey_param = 0; static void mousekey_param_print(void) { +#ifndef NO_PRINT print("\n\t- Values -\n"); print("1: delay(*10ms): "); pdec(mk_delay); print("\n"); print("2: interval(ms): "); pdec(mk_interval); print("\n"); @@ -558,6 +563,8 @@ static void mousekey_param_print(void) print("4: time_to_max: "); pdec(mk_time_to_max); print("\n"); print("5: wheel_max_speed: "); pdec(mk_wheel_max_speed); print("\n"); print("6: wheel_time_to_max: "); pdec(mk_wheel_time_to_max); print("\n"); +#endif /* !NO_PRINT */ + } //#define PRINT_SET_VAL(v) print(#v " = "); print_dec(v); print("\n"); @@ -677,7 +684,7 @@ static void mousekey_console_help(void) "pgdown: -10\n" "\n" "speed = delta * max_speed * (repeat / time_to_max)\n"); - xprintf("where delta: cursor=%d, wheel=%d\n" + xprintf("where delta: cursor=%d, wheel=%d\n" "See http://en.wikipedia.org/wiki/Mouse_keys\n", MOUSEKEY_MOVE_DELTA, MOUSEKEY_WHEEL_DELTA); } diff --git a/tmk_core/common/print.h b/tmk_core/common/print.h index c0e9e14309..4f3dde65aa 100644 --- a/tmk_core/common/print.h +++ b/tmk_core/common/print.h @@ -2,17 +2,17 @@ /* Very basic print functions, intended to be used with usb_debug_only.c * http://www.pjrc.com/teensy/ * Copyright (c) 2008 PJRC.COM, LLC - * + * * Permission is hereby granted, free of charge, to any person obtaining a copy * of this software and associated documentation files (the "Software"), to deal * in the Software without restriction, including without limitation the rights * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell * copies of the Software, and to permit persons to whom the Software is * furnished to do so, subject to the following conditions: - * + * * The above copyright notice and this permission notice shall be included in * all copies or substantial portions of the Software. - * + * * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE @@ -91,9 +91,9 @@ void print_set_sendchar(int8_t (*print_sendchar_func)(uint8_t)); #else /* NO_PRINT */ -#define xprintf -#define print -#define println +#define xprintf(fmt, ...) +#define print(s) +#define println(s) #define print_set_sendchar(func) #define print_dec(data) #define print_decs(data) diff --git a/tmk_core/protocol/lufa/lufa.c b/tmk_core/protocol/lufa/lufa.c index 5d40dcf7b2..f03f9a9b92 100644 --- a/tmk_core/protocol/lufa/lufa.c +++ b/tmk_core/protocol/lufa/lufa.c @@ -1,4 +1,4 @@ -/* +/* * Copyright 2012 Jun Wako * This file is based on: * LUFA-120219/Demos/Device/Lowlevel/KeyboardMouse @@ -152,10 +152,10 @@ static void Console_Task(void) { /* Create a temporary buffer to hold the read in report from the host */ uint8_t ConsoleData[CONSOLE_EPSIZE]; - + /* Read Console Report Data */ Endpoint_Read_Stream_LE(&ConsoleData, sizeof(ConsoleData), NULL); - + /* Process Console Report Data */ //ProcessConsoleHIDReport(ConsoleData); } @@ -183,10 +183,6 @@ static void Console_Task(void) Endpoint_SelectEndpoint(ep); } -#else -static void Console_Task(void) -{ -} #endif @@ -216,7 +212,7 @@ void EVENT_USB_Device_Disconnect(void) print("[D]"); /* For battery powered device */ USB_IsInitialized = false; -/* TODO: This doesn't work. After several plug in/outs can not be enumerated. +/* TODO: This doesn't work. After several plug in/outs can not be enumerated. if (USB_IsInitialized) { USB_Disable(); // Disable all interrupts USB_Controller_Enable(); @@ -313,7 +309,7 @@ void EVENT_USB_Device_ConfigurationChanged(void) #ifdef MIDI_ENABLE ConfigSuccess &= Endpoint_ConfigureEndpoint(MIDI_STREAM_IN_EPADDR, EP_TYPE_BULK, MIDI_STREAM_EPSIZE, ENDPOINT_BANK_SINGLE); - ConfigSuccess &= Endpoint_ConfigureEndpoint(MIDI_STREAM_OUT_EPADDR, EP_TYPE_BULK, MIDI_STREAM_EPSIZE, ENDPOINT_BANK_SINGLE); + ConfigSuccess &= Endpoint_ConfigureEndpoint(MIDI_STREAM_OUT_EPADDR, EP_TYPE_BULK, MIDI_STREAM_EPSIZE, ENDPOINT_BANK_SINGLE); #endif } @@ -439,7 +435,7 @@ void EVENT_USB_Device_ControlRequest(void) } /******************************************************************************* - * Host driver + * Host driver ******************************************************************************/ static uint8_t keyboard_leds(void) { @@ -563,7 +559,7 @@ static void send_consumer(uint16_t data) bluefruit_serial_send(0x00); bluefruit_serial_send(0x02); bluefruit_serial_send((bitmap>>8)&0xFF); - bluefruit_serial_send(bitmap&0xFF); + bluefruit_serial_send(bitmap&0xFF); bluefruit_serial_send(0x00); bluefruit_serial_send(0x00); bluefruit_serial_send(0x00); -- cgit v1.2.3 From 5c98ad59606ee95b82c27bf2525383a9ec88542b Mon Sep 17 00:00:00 2001 From: IBNobody Date: Sun, 17 Apr 2016 20:14:37 -0500 Subject: Added extra songs, LED indicator notes --- tmk_core/common/command.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tmk_core') diff --git a/tmk_core/common/command.c b/tmk_core/common/command.c index 7572b95979..f06abaf7f0 100644 --- a/tmk_core/common/command.c +++ b/tmk_core/common/command.c @@ -49,6 +49,10 @@ along with this program. If not, see . # include "usbdrv.h" #endif +#ifdef AUDIO_ENABLE + #include "audio.h" +#endif /* AUDIO_ENABLE */ + static bool command_common(uint8_t code); static void command_common_help(void); @@ -352,6 +356,9 @@ static bool command_common(uint8_t code) case MAGIC_KC(MAGIC_KEY_BOOTLOADER): clear_keyboard(); // clear to prevent stuck keys print("\n\nJumping to bootloader... "); + #ifdef AUDIO_ENABLE + play_goodbye_tone(); + #endif _delay_ms(1000); bootloader_jump(); // not return break; -- cgit v1.2.3 From 4b3358acc270772e5605397bab26fb5db981084d Mon Sep 17 00:00:00 2001 From: IBNobody Date: Mon, 18 Apr 2016 18:58:37 -0500 Subject: Fixed speaker being on during sleep. --- tmk_core/common/avr/suspend.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'tmk_core') diff --git a/tmk_core/common/avr/suspend.c b/tmk_core/common/avr/suspend.c index c07c2801d5..e295dbe18b 100644 --- a/tmk_core/common/avr/suspend.c +++ b/tmk_core/common/avr/suspend.c @@ -9,10 +9,16 @@ #include "suspend.h" #include "timer.h" #include "led.h" + #ifdef PROTOCOL_LUFA -#include "lufa.h" + #include "lufa.h" #endif +#ifdef AUDIO_ENABLE + #include "audio.h" +#endif /* AUDIO_ENABLE */ + + #define wdt_intr_enable(value) \ __asm__ __volatile__ ( \ @@ -72,6 +78,10 @@ static void power_down(uint8_t wdto) // Turn off LED indicators led_set(0); + #ifdef AUDIO_ENABLE + stop_all_notes(); + #endif /* AUDIO_ENABLE */ + // TODO: more power saving // See PicoPower application note // - I/O port input with pullup -- cgit v1.2.3 From 157ddccc2c0b865582fb488ea5346e2996b05468 Mon Sep 17 00:00:00 2001 From: Jack Humbert Date: Wed, 20 Apr 2016 20:11:05 -0400 Subject: start-up sound working, removes tick with some devices --- tmk_core/common/avr/suspend.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tmk_core') diff --git a/tmk_core/common/avr/suspend.c b/tmk_core/common/avr/suspend.c index e295dbe18b..4980680198 100644 --- a/tmk_core/common/avr/suspend.c +++ b/tmk_core/common/avr/suspend.c @@ -79,7 +79,8 @@ static void power_down(uint8_t wdto) led_set(0); #ifdef AUDIO_ENABLE - stop_all_notes(); + // This sometimes disables the start-up noise, so it's been disabled + // stop_all_notes(); #endif /* AUDIO_ENABLE */ // TODO: more power saving -- cgit v1.2.3 From 620ac4b260fa663d12b11a0b15ac50379523c125 Mon Sep 17 00:00:00 2001 From: Eric Tang Date: Thu, 21 Apr 2016 19:35:18 -0700 Subject: Update functions used to write to EEPROM --- tmk_core/common/avr/eeconfig.c | 30 +++++++++++----------- tmk_core/common/backlight.c | 10 ++++---- tmk_core/common/bootmagic.c | 6 ++--- tmk_core/common/eeconfig.h | 10 ++++---- .../lufa/LUFA-git/Bootloaders/CDC/BootloaderCDC.c | 4 +-- .../lufa/LUFA-git/Bootloaders/DFU/BootloaderDFU.c | 2 +- 6 files changed, 31 insertions(+), 31 deletions(-) (limited to 'tmk_core') diff --git a/tmk_core/common/avr/eeconfig.c b/tmk_core/common/avr/eeconfig.c index 25bb9e849c..c5391f5cf5 100644 --- a/tmk_core/common/avr/eeconfig.c +++ b/tmk_core/common/avr/eeconfig.c @@ -5,27 +5,27 @@ void eeconfig_init(void) { - eeprom_write_word(EECONFIG_MAGIC, EECONFIG_MAGIC_NUMBER); - eeprom_write_byte(EECONFIG_DEBUG, 0); - eeprom_write_byte(EECONFIG_DEFAULT_LAYER, 0); - eeprom_write_byte(EECONFIG_KEYMAP, 0); - eeprom_write_byte(EECONFIG_MOUSEKEY_ACCEL, 0); + eeprom_update_word(EECONFIG_MAGIC, EECONFIG_MAGIC_NUMBER); + eeprom_update_byte(EECONFIG_DEBUG, 0); + eeprom_update_byte(EECONFIG_DEFAULT_LAYER, 0); + eeprom_update_byte(EECONFIG_KEYMAP, 0); + eeprom_update_byte(EECONFIG_MOUSEKEY_ACCEL, 0); #ifdef BACKLIGHT_ENABLE - eeprom_write_byte(EECONFIG_BACKLIGHT, 0); + eeprom_update_byte(EECONFIG_BACKLIGHT, 0); #endif #ifdef AUDIO_ENABLE - eeprom_write_byte(EECONFIG_AUDIO, 0xFF); // On by default + eeprom_update_byte(EECONFIG_AUDIO, 0xFF); // On by default #endif } void eeconfig_enable(void) { - eeprom_write_word(EECONFIG_MAGIC, EECONFIG_MAGIC_NUMBER); + eeprom_update_word(EECONFIG_MAGIC, EECONFIG_MAGIC_NUMBER); } void eeconfig_disable(void) { - eeprom_write_word(EECONFIG_MAGIC, 0xFFFF); + eeprom_update_word(EECONFIG_MAGIC, 0xFFFF); } bool eeconfig_is_enabled(void) @@ -34,20 +34,20 @@ bool eeconfig_is_enabled(void) } uint8_t eeconfig_read_debug(void) { return eeprom_read_byte(EECONFIG_DEBUG); } -void eeconfig_write_debug(uint8_t val) { eeprom_write_byte(EECONFIG_DEBUG, val); } +void eeconfig_update_debug(uint8_t val) { eeprom_update_byte(EECONFIG_DEBUG, val); } uint8_t eeconfig_read_default_layer(void) { return eeprom_read_byte(EECONFIG_DEFAULT_LAYER); } -void eeconfig_write_default_layer(uint8_t val) { eeprom_write_byte(EECONFIG_DEFAULT_LAYER, val); } +void eeconfig_update_default_layer(uint8_t val) { eeprom_update_byte(EECONFIG_DEFAULT_LAYER, val); } uint8_t eeconfig_read_keymap(void) { return eeprom_read_byte(EECONFIG_KEYMAP); } -void eeconfig_write_keymap(uint8_t val) { eeprom_write_byte(EECONFIG_KEYMAP, val); } +void eeconfig_update_keymap(uint8_t val) { eeprom_update_byte(EECONFIG_KEYMAP, val); } #ifdef BACKLIGHT_ENABLE uint8_t eeconfig_read_backlight(void) { return eeprom_read_byte(EECONFIG_BACKLIGHT); } -void eeconfig_write_backlight(uint8_t val) { eeprom_write_byte(EECONFIG_BACKLIGHT, val); } +void eeconfig_update_backlight(uint8_t val) { eeprom_update_byte(EECONFIG_BACKLIGHT, val); } #endif #ifdef AUDIO_ENABLE uint8_t eeconfig_read_audio(void) { return eeprom_read_byte(EECONFIG_AUDIO); } -void eeconfig_write_audio(uint8_t val) { eeprom_write_byte(EECONFIG_AUDIO, val); } -#endif \ No newline at end of file +void eeconfig_update_audio(uint8_t val) { eeprom_update_byte(EECONFIG_AUDIO, val); } +#endif diff --git a/tmk_core/common/backlight.c b/tmk_core/common/backlight.c index 558ad9b014..2f6fc1cd6c 100644 --- a/tmk_core/common/backlight.c +++ b/tmk_core/common/backlight.c @@ -37,7 +37,7 @@ void backlight_increase(void) { backlight_config.level++; backlight_config.enable = 1; - eeconfig_write_backlight(backlight_config.raw); + eeconfig_update_backlight(backlight_config.raw); } dprintf("backlight increase: %u\n", backlight_config.level); backlight_set(backlight_config.level); @@ -49,7 +49,7 @@ void backlight_decrease(void) { backlight_config.level--; backlight_config.enable = !!backlight_config.level; - eeconfig_write_backlight(backlight_config.raw); + eeconfig_update_backlight(backlight_config.raw); } dprintf("backlight decrease: %u\n", backlight_config.level); backlight_set(backlight_config.level); @@ -58,7 +58,7 @@ void backlight_decrease(void) void backlight_toggle(void) { backlight_config.enable ^= 1; - eeconfig_write_backlight(backlight_config.raw); + eeconfig_update_backlight(backlight_config.raw); dprintf("backlight toggle: %u\n", backlight_config.enable); backlight_set(backlight_config.enable ? backlight_config.level : 0); } @@ -71,7 +71,7 @@ void backlight_step(void) backlight_config.level = 0; } backlight_config.enable = !!backlight_config.level; - eeconfig_write_backlight(backlight_config.raw); + eeconfig_update_backlight(backlight_config.raw); dprintf("backlight step: %u\n", backlight_config.level); backlight_set(backlight_config.level); } @@ -80,6 +80,6 @@ void backlight_level(uint8_t level) { backlight_config.level ^= level; backlight_config.enable = !!backlight_config.level; - eeconfig_write_backlight(backlight_config.raw); + eeconfig_update_backlight(backlight_config.raw); backlight_set(backlight_config.level); } diff --git a/tmk_core/common/bootmagic.c b/tmk_core/common/bootmagic.c index b002a58562..2c1b1adfc5 100644 --- a/tmk_core/common/bootmagic.c +++ b/tmk_core/common/bootmagic.c @@ -52,7 +52,7 @@ void bootmagic(void) debug_config.enable = !debug_config.enable; } } - eeconfig_write_debug(debug_config.raw); + eeconfig_update_debug(debug_config.raw); /* keymap config */ keymap_config.raw = eeconfig_read_keymap(); @@ -80,7 +80,7 @@ void bootmagic(void) if (bootmagic_scan_keycode(BOOTMAGIC_HOST_NKRO)) { keymap_config.nkro = !keymap_config.nkro; } - eeconfig_write_keymap(keymap_config.raw); + eeconfig_update_keymap(keymap_config.raw); #ifdef NKRO_ENABLE keyboard_nkro = keymap_config.nkro; @@ -97,7 +97,7 @@ void bootmagic(void) if (bootmagic_scan_keycode(BOOTMAGIC_KEY_DEFAULT_LAYER_6)) { default_layer |= (1<<6); } if (bootmagic_scan_keycode(BOOTMAGIC_KEY_DEFAULT_LAYER_7)) { default_layer |= (1<<7); } if (default_layer) { - eeconfig_write_default_layer(default_layer); + eeconfig_update_default_layer(default_layer); default_layer_set((uint32_t)default_layer); } else { default_layer = eeconfig_read_default_layer(); diff --git a/tmk_core/common/eeconfig.h b/tmk_core/common/eeconfig.h index ddefca1347..ca47e0d2fd 100644 --- a/tmk_core/common/eeconfig.h +++ b/tmk_core/common/eeconfig.h @@ -60,22 +60,22 @@ void eeconfig_enable(void); void eeconfig_disable(void); uint8_t eeconfig_read_debug(void); -void eeconfig_write_debug(uint8_t val); +void eeconfig_update_debug(uint8_t val); uint8_t eeconfig_read_default_layer(void); -void eeconfig_write_default_layer(uint8_t val); +void eeconfig_update_default_layer(uint8_t val); uint8_t eeconfig_read_keymap(void); -void eeconfig_write_keymap(uint8_t val); +void eeconfig_update_keymap(uint8_t val); #ifdef BACKLIGHT_ENABLE uint8_t eeconfig_read_backlight(void); -void eeconfig_write_backlight(uint8_t val); +void eeconfig_update_backlight(uint8_t val); #endif #ifdef AUDIO_ENABLE uint8_t eeconfig_read_audio(void); -void eeconfig_write_audio(uint8_t val); +void eeconfig_update_audio(uint8_t val); #endif #endif diff --git a/tmk_core/protocol/lufa/LUFA-git/Bootloaders/CDC/BootloaderCDC.c b/tmk_core/protocol/lufa/LUFA-git/Bootloaders/CDC/BootloaderCDC.c index f66a483e6e..58bb338927 100644 --- a/tmk_core/protocol/lufa/LUFA-git/Bootloaders/CDC/BootloaderCDC.c +++ b/tmk_core/protocol/lufa/LUFA-git/Bootloaders/CDC/BootloaderCDC.c @@ -327,7 +327,7 @@ static void ReadWriteMemoryBlock(const uint8_t Command) else { /* Write the next EEPROM byte from the endpoint */ - eeprom_write_byte((uint8_t*)((intptr_t)(CurrAddress >> 1)), FetchNextCommandByte()); + eeprom_update_byte((uint8_t*)((intptr_t)(CurrAddress >> 1)), FetchNextCommandByte()); /* Increment the address counter after use */ CurrAddress += 2; @@ -581,7 +581,7 @@ static void CDC_Task(void) else if (Command == AVR109_COMMAND_WriteEEPROM) { /* Read the byte from the endpoint and write it to the EEPROM */ - eeprom_write_byte((uint8_t*)((intptr_t)(CurrAddress >> 1)), FetchNextCommandByte()); + eeprom_update_byte((uint8_t*)((intptr_t)(CurrAddress >> 1)), FetchNextCommandByte()); /* Increment the address after use */ CurrAddress += 2; diff --git a/tmk_core/protocol/lufa/LUFA-git/Bootloaders/DFU/BootloaderDFU.c b/tmk_core/protocol/lufa/LUFA-git/Bootloaders/DFU/BootloaderDFU.c index 0385bfc497..00e673268a 100644 --- a/tmk_core/protocol/lufa/LUFA-git/Bootloaders/DFU/BootloaderDFU.c +++ b/tmk_core/protocol/lufa/LUFA-git/Bootloaders/DFU/BootloaderDFU.c @@ -370,7 +370,7 @@ void EVENT_USB_Device_ControlRequest(void) } /* Read the byte from the USB interface and write to to the EEPROM */ - eeprom_write_byte((uint8_t*)StartAddr, Endpoint_Read_8()); + eeprom_update_byte((uint8_t*)StartAddr, Endpoint_Read_8()); /* Adjust counters */ StartAddr++; -- cgit v1.2.3