From 6b4549da8ceed736c85195f3bd16ded40131a29c Mon Sep 17 00:00:00 2001 From: Andrew Kannan Date: Wed, 13 Feb 2019 11:03:26 -0500 Subject: Add Satisfaction75 to QMK, Enable EEPROM on stm32f072 (#5094) * Add stm32f072 base ck4x4 to handwired * add prints * Save these tries * Save changes again * Working hadron oled * OLEd working but ws2812b still iffy: * save another try * Encoder feature + OLED * RTC code * Implement clock setting mode * Whitespace * Encoder hooked up to working LED PWM code * Add missing files * eeprom changes * Save changes * Move i2c master * Move satisfaction75 under cannonkeys * Set proper default folder * Revert some core changes * Undo paved iris changes * Reorganize code for maintainability and prep for new features * Add starting code for clock OLED mode * Clock set mode finished * Add custom encoder modes * Actually add VIA keymap * Gate to only 072 * fix gate for only 072 * Update header guards and includes * Update i2c selection strategy * Update board.c to handle software reset to DFU --- tmk_core/common.mk | 5 +++++ tmk_core/common/chibios/eeprom_stm32.h | 6 ++++-- tmk_core/common/chibios/flash_stm32.c | 5 ++++- 3 files changed, 13 insertions(+), 3 deletions(-) (limited to 'tmk_core') diff --git a/tmk_core/common.mk b/tmk_core/common.mk index 063115acb1..94f3c2380d 100644 --- a/tmk_core/common.mk +++ b/tmk_core/common.mk @@ -41,6 +41,11 @@ ifeq ($(PLATFORM),CHIBIOS) TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/flash_stm32.c TMK_COMMON_DEFS += -DEEPROM_EMU_STM32F103xB TMK_COMMON_DEFS += -DSTM32_EEPROM_ENABLE + else ifeq ($(MCU_SERIES)_$(MCU_LDSCRIPT), STM32F0xx_STM32F072xB) + TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/eeprom_stm32.c + TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/flash_stm32.c + TMK_COMMON_DEFS += -DEEPROM_EMU_STM32F072xB + TMK_COMMON_DEFS += -DSTM32_EEPROM_ENABLE else TMK_COMMON_SRC += $(PLATFORM_COMMON_DIR)/eeprom_teensy.c endif diff --git a/tmk_core/common/chibios/eeprom_stm32.h b/tmk_core/common/chibios/eeprom_stm32.h index 892e417b7e..083eb16ee6 100755 --- a/tmk_core/common/chibios/eeprom_stm32.h +++ b/tmk_core/common/chibios/eeprom_stm32.h @@ -34,6 +34,8 @@ #define MCU_STM32F303CC #elif defined(EEPROM_EMU_STM32F103xB) #define MCU_STM32F103RB +#elif defined(EEPROM_EMU_STM32F072xB) + #define MCU_STM32F072CB #else #error "not implemented." #endif @@ -42,7 +44,7 @@ #if defined (MCU_STM32F103RB) #define FEE_PAGE_SIZE (uint16_t)0x400 // Page size = 1KByte #define FEE_DENSITY_PAGES 2 // How many pages are used - #elif defined (MCU_STM32F103ZE) || defined (MCU_STM32F103RE) || defined (MCU_STM32F103RD) || defined (MCU_STM32F303CC) + #elif defined (MCU_STM32F103ZE) || defined (MCU_STM32F103RE) || defined (MCU_STM32F103RD) || defined (MCU_STM32F303CC) || defined(MCU_STM32F072CB) #define FEE_PAGE_SIZE (uint16_t)0x800 // Page size = 2KByte #define FEE_DENSITY_PAGES 4 // How many pages are used #else @@ -51,7 +53,7 @@ #endif #ifndef EEPROM_START_ADDRESS - #if defined (MCU_STM32F103RB) + #if defined (MCU_STM32F103RB) || defined(MCU_STM32F072CB) #define FEE_MCU_FLASH_SIZE 128 // Size in Kb #elif defined (MCU_STM32F103ZE) || defined (MCU_STM32F103RE) #define FEE_MCU_FLASH_SIZE 512 // Size in Kb diff --git a/tmk_core/common/chibios/flash_stm32.c b/tmk_core/common/chibios/flash_stm32.c index 164654a15e..832bf3908f 100755 --- a/tmk_core/common/chibios/flash_stm32.c +++ b/tmk_core/common/chibios/flash_stm32.c @@ -22,6 +22,9 @@ #elif defined(EEPROM_EMU_STM32F103xB) #define STM32F103xB #include "stm32f1xx.h" +#elif defined(EEPROM_EMU_STM32F072xB) + #define STM32F072xB + #include "stm32f0xx.h" #else #error "not implemented." #endif @@ -193,7 +196,7 @@ void FLASH_Lock(void) * This parameter can be any combination of the following values: * @arg FLASH_FLAG_PGERR: FLASH Programming error flag flag * @arg FLASH_FLAG_WRPERR: FLASH Write protected error flag - * @arg FLASH_FLAG_EOP: FLASH End of Programming flag + * @arg FLASH_FLAG_EOP: FLASH End of Programming flag * @retval None */ void FLASH_ClearFlag(uint32_t FLASH_FLAG) -- cgit v1.2.3