From 621ce29a53e9e94e085fbd86c0b7134e9df4bfe5 Mon Sep 17 00:00:00 2001 From: yiancar Date: Wed, 29 Aug 2018 23:14:49 +0300 Subject: STM32 EEPROM Emulation (#3741) * STM32 EEPROM Emulation - Added EEPROM emulation libaries from libmaple and Arduino_STM32. https://github.com/rogerclarkmelbourne/Arduino_STM32 and https://github.com/leaflabs/libmaple. - Renamed teensy EEPROM library and added conditional selection of library. - Remapped EEPROM memory map for 16 byte blocks (as is with STM32f3xx MCUs). - Added EEPROM initialization in main.c of Chibios. - Added EEPROM format to clear the emulated pages when EEPROM is marked as invalid. * Fixed ifdef --- tmk_core/protocol/chibios/main.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tmk_core/protocol/chibios/main.c') diff --git a/tmk_core/protocol/chibios/main.c b/tmk_core/protocol/chibios/main.c index f2abc438d..568c1edb2 100644 --- a/tmk_core/protocol/chibios/main.c +++ b/tmk_core/protocol/chibios/main.c @@ -44,6 +44,9 @@ #ifdef MIDI_ENABLE #include "qmk_midi.h" #endif +#ifdef STM32F303xC +#include "eeprom_stm32.h" +#endif #include "suspend.h" #include "wait.h" @@ -109,6 +112,10 @@ int main(void) { halInit(); chSysInit(); +#ifdef STM32F303xC + EEPROM_init(); +#endif + // TESTING // chThdCreateStatic(waThread1, sizeof(waThread1), NORMALPRIO, Thread1, NULL); -- cgit v1.2.3-24-g4f1b From 73a3399d0ef7e06db70fc2964a3f2a35e9aca25d Mon Sep 17 00:00:00 2001 From: yiancar Date: Fri, 24 Aug 2018 15:38:31 +0300 Subject: Add the ability to disable the USB startup check for Chibios - Added support for NO_USB_STARTUP_CHECK. This allows the keyboard do function and not get stuck in a SUSPENDED state loop in case of no USB connection. - Added support for WAIT_FOR_USB. In LUFA no keyboard has this flag enable therefor no keyboard waits for usb to be active. - Added documentation for both configuration flags as they were missing. --- tmk_core/protocol/chibios/main.c | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'tmk_core/protocol/chibios/main.c') diff --git a/tmk_core/protocol/chibios/main.c b/tmk_core/protocol/chibios/main.c index 568c1edb2..dcc6d9d07 100644 --- a/tmk_core/protocol/chibios/main.c +++ b/tmk_core/protocol/chibios/main.c @@ -142,10 +142,15 @@ int main(void) { /* Wait until the USB or serial link is active */ while (true) { +#if defined(WAIT_FOR_USB) || defined(SERIAL_LINK_ENABLE) if(USB_DRIVER.state == USB_ACTIVE) { driver = &chibios_driver; break; } +#else + driver = &chibios_driver; + break; +#endif #ifdef SERIAL_LINK_ENABLE if(is_serial_link_connected()) { driver = get_serial_link_driver(); @@ -178,6 +183,7 @@ int main(void) { /* Main loop */ while(true) { +#if !defined(NO_USB_STARTUP_CHECK) if(USB_DRIVER.state == USB_SUSPENDED) { print("[s]"); #ifdef VISUALIZER_ENABLE @@ -205,6 +211,7 @@ int main(void) { visualizer_resume(); #endif } +#endif keyboard_task(); #ifdef CONSOLE_ENABLE -- cgit v1.2.3-24-g4f1b From f4094930a393ec3dc597e06e95cd3365e3f8cb97 Mon Sep 17 00:00:00 2001 From: Takuya Urakawa Date: Fri, 19 Oct 2018 13:33:23 +0900 Subject: stm32f1xx EEPROM emulation (#3914) * * Add stm32f1xx EEPROM emulation * Fix eeprom update compare bug Squashed commit of the following: commit b8f248ae08cec0cd81ecbb8854d9b39221d4d573 Author: hsgw Date: Sat Sep 15 19:13:48 2018 +0900 fix EEPROM_update wrong compare commit d4ed4e6ea864e967a3e17f7edee4b0c3b4a25541 Author: hsgw Date: Sat Sep 15 17:43:47 2018 +0900 eeprom fix initialization define commit b61aa7c04d70c64df3416d63e5da08b73b6053af Author: hsgw Date: Sat Sep 15 16:33:40 2018 +0900 maybe working * Fix FLASH_KEY defines --- tmk_core/protocol/chibios/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tmk_core/protocol/chibios/main.c') diff --git a/tmk_core/protocol/chibios/main.c b/tmk_core/protocol/chibios/main.c index dcc6d9d07..6cceccd23 100644 --- a/tmk_core/protocol/chibios/main.c +++ b/tmk_core/protocol/chibios/main.c @@ -44,7 +44,7 @@ #ifdef MIDI_ENABLE #include "qmk_midi.h" #endif -#ifdef STM32F303xC +#ifdef STM32_EEPROM_ENABLE #include "eeprom_stm32.h" #endif #include "suspend.h" @@ -112,7 +112,7 @@ int main(void) { halInit(); chSysInit(); -#ifdef STM32F303xC +#ifdef STM32_EEPROM_ENABLE EEPROM_init(); #endif -- cgit v1.2.3-24-g4f1b From 87f06e7297c10020912beaba10013f11d2e8e570 Mon Sep 17 00:00:00 2001 From: yiancar Date: Wed, 21 Nov 2018 15:12:40 -0800 Subject: Fix raw hid define for chibios (#4460) --- tmk_core/protocol/chibios/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'tmk_core/protocol/chibios/main.c') diff --git a/tmk_core/protocol/chibios/main.c b/tmk_core/protocol/chibios/main.c index 6cceccd23..ee9571c95 100644 --- a/tmk_core/protocol/chibios/main.c +++ b/tmk_core/protocol/chibios/main.c @@ -75,7 +75,7 @@ host_driver_t chibios_driver = { void virtser_task(void); #endif -#ifdef RAW_HID_ENABLE +#ifdef RAW_ENABLE void raw_hid_task(void); #endif @@ -220,7 +220,7 @@ int main(void) { #ifdef VIRTSER_ENABLE virtser_task(); #endif -#ifdef RAW_HID_ENABLE +#ifdef RAW_ENABLE raw_hid_task(); #endif } -- cgit v1.2.3-24-g4f1b