From 653a0803e24ea2708dd06b0d06b490a20ad0e617 Mon Sep 17 00:00:00 2001 From: jonasius Date: Sun, 26 May 2024 21:13:09 +0200 Subject: [PATCH 01/31] Add support for Sequre S99, copied S60P settings --- Makefile | 2 +- source/Core/BSP/Sequre_S60/Pins.h | 31 ++++++++++++++++++++ source/Core/BSP/Sequre_S60/configuration.h | 33 +++++++++++++++++++++- source/Core/Drivers/Font.h | 2 +- source/build.sh | 2 +- 5 files changed, 66 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 20b009b5..6eb920d3 100644 --- a/Makefile +++ b/Makefile @@ -52,7 +52,7 @@ DOCKER_CMD=$(DOCKER_BIN) -f $(DOCKER_YML) run --rm builder MKDOCS_YML=$(CURDIR)/scripts/IronOS-mkdocs.yml # supported models -MODELS=TS100 TS80 TS80P Pinecil MHP30 Pinecilv2 S60 TS101 S60P # target names & dir names +MODELS=TS100 TS80 TS80P Pinecil MHP30 Pinecilv2 S60 TS101 S60P S99 # target names & dir names MODELS_ML=Pinecil Pinecilv2 # target names MODELS_MULTILANG=Pinecil_multi-lang Pinecilv2_multi-lang # dir names diff --git a/source/Core/BSP/Sequre_S60/Pins.h b/source/Core/BSP/Sequre_S60/Pins.h index 24b65bb5..c9b31c06 100644 --- a/source/Core/BSP/Sequre_S60/Pins.h +++ b/source/Core/BSP/Sequre_S60/Pins.h @@ -69,5 +69,36 @@ #define MOVEMENT_Pin GPIO_PIN_3 #define MOVEMENT_GPIO_Port GPIOA +#endif + +#ifdef MODEL_S99 + +#define KEY_B_Pin GPIO_PIN_1 +#define KEY_B_GPIO_Port GPIOB +#define TMP36_INPUT_Pin GPIO_PIN_5 +#define TMP36_INPUT_GPIO_Port GPIOA +#define TMP36_ADC1_CHANNEL ADC_CHANNEL_5 +#define TMP36_ADC2_CHANNEL ADC_CHANNEL_5 +#define TIP_TEMP_Pin GPIO_PIN_0 +#define TIP_TEMP_GPIO_Port GPIOA +#define TIP_TEMP_ADC1_CHANNEL ADC_CHANNEL_0 +#define TIP_TEMP_ADC2_CHANNEL ADC_CHANNEL_0 +#define VIN_Pin GPIO_PIN_4 +#define VIN_GPIO_Port GPIOA +#define VIN_ADC1_CHANNEL ADC_CHANNEL_4 +#define VIN_ADC2_CHANNEL ADC_CHANNEL_4 +#define KEY_A_Pin GPIO_PIN_0 +#define KEY_A_GPIO_Port GPIOB +#define PWM_Out_Pin GPIO_PIN_8 +#define PWM_Out_GPIO_Port GPIOB +#define PWM_Out_CHANNEL TIM_CHANNEL_3 // Timer 4; channel 3 +#define SCL2_Pin GPIO_PIN_6 +#define SCL2_GPIO_Port GPIOB +#define SDA2_Pin GPIO_PIN_7 +#define SDA2_GPIO_Port GPIOB +// Pin gets pulled high on movement +#define MOVEMENT_Pin GPIO_PIN_3 +#define MOVEMENT_GPIO_Port GPIOA + #endif #endif /* BSP_MINIWARE_PINS_H_ */ diff --git a/source/Core/BSP/Sequre_S60/configuration.h b/source/Core/BSP/Sequre_S60/configuration.h index 008ce6b5..07e7ae99 100644 --- a/source/Core/BSP/Sequre_S60/configuration.h +++ b/source/Core/BSP/Sequre_S60/configuration.h @@ -119,7 +119,7 @@ // Vin_max = (3.3*(r1+r2))/(r2) // vdiv = (32768*4)/(vin_max*10) -#if defined(MODEL_S60) + defined(MODEL_S60P) == 0 +#if defined(MODEL_S60) + defined(MODEL_S60P)+defined(MODEL_S99) == 0 #error "No model defined!" #endif @@ -197,6 +197,37 @@ #define MODEL_HAS_DCDC // We dont have DC/DC but have reallly fast PWM that gets us roughly the same place #endif /* S60P */ +#ifdef MODEL_S99 +#define VOLTAGE_DIV 460 // Default divider scaler +#define CALIBRATION_OFFSET 200 // Default adc offset in uV +#define PID_POWER_LIMIT 70 // Sets the max pwm power limit +#define POWER_LIMIT 0 // 0 watts default limit +#define MAX_POWER_LIMIT 70 +#define POWER_LIMIT_STEPS 5 +#define OP_AMP_GAIN_STAGE 536 +#define TEMP_uV_LOOKUP_S60 +#define USB_PD_VMAX 20 // Maximum voltage for PD to negotiate + +#define HARDWARE_MAX_WATTAGE_X10 600 + +#define TIP_THERMAL_MASS 8 // X10 watts to raise 1 deg C in 1 second +#define TIP_THERMAL_INERTIA 128 // We use a large inertia value to smooth out the drive to the tip since its stupidly sensitive + +#define TIP_RESISTANCE 20 //(actually 2.5 ish but we need to be more conservative on pwm'ing watt limit) x10 ohms + +#define OLED_128x32 +#define GPIO_VIBRATION +#define POW_PD_EXT 2 +#define USB_PD_EPR_WATTAGE 0 /*No EPR*/ +#define DEBUG_POWER_MENU_BUTTON_B 1 +#define HAS_POWER_DEBUG_MENU +#define TEMP_NTC +#define I2C_SOFT_BUS_2 // For now we are doing software I2C to get around hardware chip issues +#define OLED_I2CBB2 + +#define MODEL_HAS_DCDC // We dont have DC/DC but have reallly fast PWM that gets us roughly the same place +#endif /* S99 */ + #define FLASH_LOGOADDR (0x08000000 + (62 * 1024)) #define SETTINGS_START_PAGE (0x08000000 + (63 * 1024)) diff --git a/source/Core/Drivers/Font.h b/source/Core/Drivers/Font.h index 40f15863..3fbf1340 100644 --- a/source/Core/Drivers/Font.h +++ b/source/Core/Drivers/Font.h @@ -141,7 +141,7 @@ const uint8_t disconnectedTip[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x37, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x04, 0x04, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; #endif -#if defined(MODEL_S60)+defined(MODEL_S60P) > 0 +#if defined(MODEL_S60)+defined(MODEL_S60P)+defined(MODEL_S99) > 0 const uint8_t buttonA[] = { // width = 42 // height = 16 diff --git a/source/build.sh b/source/build.sh index 53671a16..410cfae7 100755 --- a/source/build.sh +++ b/source/build.sh @@ -6,7 +6,7 @@ TRANSLATION_DIR="../Translations" # AVAILABLE_LANGUAGES will be calculating according to json files in $TRANSLATION_DIR AVAILABLE_LANGUAGES=() BUILD_LANGUAGES=() -AVAILABLE_MODELS=("TS100" "TS80" "TS80P" "Pinecil" "MHP30" "Pinecilv2" "S60" "S60P" "TS101") +AVAILABLE_MODELS=("TS100" "TS80" "TS80P" "Pinecil" "MHP30" "Pinecilv2" "S60" "S60P" "S99" "TS101") BUILD_MODELS=() builder_info() { From 1521b5ea31191955111a9cc4b587087c31867170 Mon Sep 17 00:00:00 2001 From: jonasius Date: Sun, 26 May 2024 21:13:41 +0200 Subject: [PATCH 02/31] Add S99 --- .github/workflows/push.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/push.yml b/.github/workflows/push.yml index 663795e8..d6f2fabb 100644 --- a/.github/workflows/push.yml +++ b/.github/workflows/push.yml @@ -29,6 +29,7 @@ jobs: "Pinecilv2", "S60", "S60P", + "S99", "TS101", ] fail-fast: true From a3b7abbf0e5acc7bd4cb850560609f66065c1055 Mon Sep 17 00:00:00 2001 From: jonasius Date: Sun, 26 May 2024 21:14:11 +0200 Subject: [PATCH 03/31] Add Sequre S99 with correct bootloader offset --- source/Makefile | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/Makefile b/source/Makefile index 6016a012..f9b4ca85 100644 --- a/source/Makefile +++ b/source/Makefile @@ -6,7 +6,7 @@ ALL_MINIWARE_MODELS=TS100 TS80 TS80P TS101 ALL_PINECIL_MODELS=Pinecil ALL_PINECIL_V2_MODELS=Pinecilv2 ALL_MHP30_MODELS=MHP30 -ALL_SEQURE_MODELS=S60 S60P +ALL_SEQURE_MODELS=S60 S60P S99 ALL_MODELS=$(ALL_MINIWARE_MODELS) $(ALL_PINECIL_MODELS) $(ALL_MHP30_MODELS) $(ALL_PINECIL_V2_MODELS) $(ALL_SEQURE_MODELS) ifneq ($(model),$(filter $(model),$(ALL_MODELS))) @@ -144,6 +144,9 @@ flash_size=62k ifeq ($(model), S60P) bootldr_size=0x5000 DEVICE_DFU_ADDRESS=0x08005000 +else ifeq ($(model), S99) +bootldr_size=0x4c00 +DEVICE_DFU_ADDRESS=0x08004c00 else bootldr_size=0x4400 DEVICE_DFU_ADDRESS=0x08004400 From 5ea42a8bbf7c46dfb1b90538072e3633a100f3ae Mon Sep 17 00:00:00 2001 From: jonasius Date: Sun, 26 May 2024 23:09:06 +0200 Subject: [PATCH 04/31] Add whitespaces according to coding style Co-authored-by: discip <53649486+discip@users.noreply.github.com> --- source/Core/BSP/Sequre_S60/configuration.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/Core/BSP/Sequre_S60/configuration.h b/source/Core/BSP/Sequre_S60/configuration.h index 07e7ae99..8bbb2f31 100644 --- a/source/Core/BSP/Sequre_S60/configuration.h +++ b/source/Core/BSP/Sequre_S60/configuration.h @@ -119,7 +119,7 @@ // Vin_max = (3.3*(r1+r2))/(r2) // vdiv = (32768*4)/(vin_max*10) -#if defined(MODEL_S60) + defined(MODEL_S60P)+defined(MODEL_S99) == 0 +#if defined(MODEL_S60) + defined(MODEL_S60P) + defined(MODEL_S99) == 0 #error "No model defined!" #endif From 2c5d2a08ed91500c9c74d0ad233baeb623370ef6 Mon Sep 17 00:00:00 2001 From: jonasius Date: Sun, 26 May 2024 23:09:13 +0200 Subject: [PATCH 05/31] Add whitespaces according to coding style Co-authored-by: discip <53649486+discip@users.noreply.github.com> --- source/Core/Drivers/Font.h | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/source/Core/Drivers/Font.h b/source/Core/Drivers/Font.h index 3fbf1340..add87635 100644 --- a/source/Core/Drivers/Font.h +++ b/source/Core/Drivers/Font.h @@ -141,7 +141,8 @@ const uint8_t disconnectedTip[] = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x37, 0x37, 0x00, 0x00, 0x00, 0x00, 0x00, 0x38, 0x04, 0x04, 0x02, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}; #endif -#if defined(MODEL_S60)+defined(MODEL_S60P)+defined(MODEL_S99) > 0 +#if defined(MODEL_S60) + defined(MODEL_S60P) + defined(MODEL_S99) > 0 + const uint8_t buttonA[] = { // width = 42 // height = 16 From e327be5bd8477b5a0484be812c031a9892312c82 Mon Sep 17 00:00:00 2001 From: jonasius Date: Sun, 2 Jun 2024 16:15:46 +0200 Subject: [PATCH 06/31] Correct debug menu "Tip R" to "Tip uV" --- Translations/make_translation.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Translations/make_translation.py b/Translations/make_translation.py index ac9e783b..fc776cf5 100755 --- a/Translations/make_translation.py +++ b/Translations/make_translation.py @@ -163,7 +163,7 @@ def get_debug_menu() -> List[str]: "UpTime ", "Move ", "Tip Res", - "Tip R ", + "Tip uV ", "Tip O ", "HW G ", "HW M ", From a2615a57b8ccf3d68fa63e4c68b27d5896555ba6 Mon Sep 17 00:00:00 2001 From: jonasius Date: Sun, 2 Jun 2024 22:53:34 +0200 Subject: [PATCH 07/31] Use SettingsOptions::PDNegTimeout in FS2711 driver --- source/Core/Drivers/FS2711.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/source/Core/Drivers/FS2711.cpp b/source/Core/Drivers/FS2711.cpp index 1aec92e8..24957121 100644 --- a/source/Core/Drivers/FS2711.cpp +++ b/source/Core/Drivers/FS2711.cpp @@ -2,6 +2,7 @@ #include "FS2711_defines.h" #include "I2CBB2.hpp" #include "configuration.h" +#include "Settings.h" #if POW_PD_EXT == 2 #include "BSP.h" #include "cmsis_os.h" @@ -13,8 +14,6 @@ #error Max PD Voltage must be defined #endif -#define PROTOCOL_TIMEOUT 100 // ms - extern int32_t powerSupplyWattageLimit; fs2711_state_t FS2711::state; @@ -34,10 +33,11 @@ void FS2711::start() { state.req_pdo_num = 0xFF; enable_protocol(false); - osDelay(PROTOCOL_TIMEOUT); + // PDNegTimeout is in 1/100 s, so x10 for ms + osDelay(getSettingValue(SettingsOptions::PDNegTimeout)*10); select_protocol(FS2711_PROTOCOL_PD); enable_protocol(true); - osDelay(PROTOCOL_TIMEOUT); + osDelay(getSettingValue(SettingsOptions::PDNegTimeout)*10); } uint8_t FS2711::selected_protocol() { return i2c_read(FS2711_REG_SELECT_PROTOCOL); } From 31ff3981504241e81aebbb5f36fd4953c8ea43c4 Mon Sep 17 00:00:00 2001 From: jonasius Date: Mon, 3 Jun 2024 22:30:07 +0200 Subject: [PATCH 08/31] Correct debug menu "Tip R" to "Tip uV" --- Documentation/DebugMenu.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/DebugMenu.md b/Documentation/DebugMenu.md index 1b40ad78..c87f2ccf 100644 --- a/Documentation/DebugMenu.md +++ b/Documentation/DebugMenu.md @@ -104,7 +104,7 @@ This can be used for checking performance of the movement detection code. This indicates the tip resistance that the device is currently using. For devices with multiple possible values to choose from (Pinecil V2), the appropriate value is automatically detected at every boot-up. Tip should be installed before boot-up or reading can not be done. -### Tip R +### Tip uV This is the raw tip reading in μV. Tip must be installed or reading will be high/inaccurate. At cool, the range of 700-1000 is normal for larger tips and ~1500 for smaller tips (TS80). This is used to evaluate the calibration routines. From 6e53d85b32518d173a09dc304bd5ddbc1c7dc3e3 Mon Sep 17 00:00:00 2001 From: jonasius Date: Thu, 6 Jun 2024 20:27:08 +0200 Subject: [PATCH 09/31] Rename Sequre_S60 folder to Sequre --- source/Core/BSP/{Sequre_S60 => Sequre}/BSP.cpp | 0 source/Core/BSP/{Sequre_S60 => Sequre}/FreeRTOSConfig.h | 0 source/Core/BSP/{Sequre_S60 => Sequre}/IRQ.cpp | 0 source/Core/BSP/{Sequre_S60 => Sequre}/IRQ.h | 0 source/Core/BSP/{Sequre_S60 => Sequre}/Pins.h | 0 source/Core/BSP/{Sequre_S60 => Sequre}/Power.cpp | 0 source/Core/BSP/{Sequre_S60 => Sequre}/README.md | 0 source/Core/BSP/{Sequre_S60 => Sequre}/Setup.cpp | 0 source/Core/BSP/{Sequre_S60 => Sequre}/Setup.h | 0 source/Core/BSP/{Sequre_S60 => Sequre}/Software_I2C.h | 0 .../{Sequre_S60 => Sequre}/Startup/startup_stm32f103t8ux.S | 0 source/Core/BSP/{Sequre_S60 => Sequre}/ThermoModel.cpp | 0 .../Vendor/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xb.h | 0 .../Vendor/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h | 0 .../CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h | 0 .../Vendor/CMSIS/Include/arm_common_tables.h | 0 .../Vendor/CMSIS/Include/arm_const_structs.h | 0 .../{Sequre_S60 => Sequre}/Vendor/CMSIS/Include/arm_math.h | 0 .../{Sequre_S60 => Sequre}/Vendor/CMSIS/Include/cmsis_armcc.h | 0 .../Vendor/CMSIS/Include/cmsis_armcc_V6.h | 0 .../{Sequre_S60 => Sequre}/Vendor/CMSIS/Include/cmsis_gcc.h | 0 .../{Sequre_S60 => Sequre}/Vendor/CMSIS/Include/core_cm0.h | 0 .../Vendor/CMSIS/Include/core_cm0plus.h | 0 .../{Sequre_S60 => Sequre}/Vendor/CMSIS/Include/core_cm3.h | 0 .../{Sequre_S60 => Sequre}/Vendor/CMSIS/Include/core_cm4.h | 0 .../{Sequre_S60 => Sequre}/Vendor/CMSIS/Include/core_cm7.h | 0 .../{Sequre_S60 => Sequre}/Vendor/CMSIS/Include/core_cmFunc.h | 0 .../Vendor/CMSIS/Include/core_cmInstr.h | 0 .../{Sequre_S60 => Sequre}/Vendor/CMSIS/Include/core_cmSimd.h | 0 .../{Sequre_S60 => Sequre}/Vendor/CMSIS/Include/core_sc000.h | 0 .../{Sequre_S60 => Sequre}/Vendor/CMSIS/Include/core_sc300.h | 0 .../Vendor/STM32F1xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h | 0 .../Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h | 0 .../Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_adc.h | 0 .../Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_adc_ex.h | 0 .../Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_cortex.h | 0 .../Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_def.h | 0 .../Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma.h | 0 .../Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma_ex.h | 0 .../Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash.h | 0 .../Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash_ex.h | 0 .../Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio.h | 0 .../Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio_ex.h | 0 .../Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h | 0 .../Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_iwdg.h | 0 .../Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h | 0 .../Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc.h | 0 .../Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc_ex.h | 0 .../Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim.h | 0 .../Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim_ex.h | 0 .../Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.c | 0 .../Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc.c | 0 .../Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc_ex.c | 0 .../Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.c | 0 .../Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.c | 0 .../Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.c | 0 .../Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c | 0 .../Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.c | 0 .../Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c | 0 .../Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_i2c.c | 0 .../Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_iwdg.c | 0 .../Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c | 0 .../Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c | 0 .../Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c | 0 .../Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.c | 0 .../Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.c | 0 source/Core/BSP/{Sequre_S60 => Sequre}/configuration.h | 0 source/Core/BSP/{Sequre_S60 => Sequre}/flash.c | 0 source/Core/BSP/{Sequre_S60 => Sequre}/port.c | 0 source/Core/BSP/{Sequre_S60 => Sequre}/portmacro.h | 0 source/Core/BSP/{Sequre_S60 => Sequre}/postRTOS.cpp | 0 source/Core/BSP/{Sequre_S60 => Sequre}/preRTOS.cpp | 0 source/Core/BSP/{Sequre_S60 => Sequre}/stm32f103.ld | 0 source/Core/BSP/{Sequre_S60 => Sequre}/stm32f1xx_hal_msp.c | 0 .../BSP/{Sequre_S60 => Sequre}/stm32f1xx_hal_timebase_TIM.c | 0 source/Core/BSP/{Sequre_S60 => Sequre}/stm32f1xx_it.c | 0 source/Core/BSP/{Sequre_S60 => Sequre}/system_stm32f1xx.c | 0 source/Makefile | 4 ++-- 78 files changed, 2 insertions(+), 2 deletions(-) rename source/Core/BSP/{Sequre_S60 => Sequre}/BSP.cpp (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/FreeRTOSConfig.h (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/IRQ.cpp (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/IRQ.h (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Pins.h (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Power.cpp (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/README.md (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Setup.cpp (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Setup.h (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Software_I2C.h (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Startup/startup_stm32f103t8ux.S (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/ThermoModel.cpp (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Vendor/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xb.h (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Vendor/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Vendor/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Vendor/CMSIS/Include/arm_common_tables.h (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Vendor/CMSIS/Include/arm_const_structs.h (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Vendor/CMSIS/Include/arm_math.h (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Vendor/CMSIS/Include/cmsis_armcc.h (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Vendor/CMSIS/Include/cmsis_armcc_V6.h (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Vendor/CMSIS/Include/cmsis_gcc.h (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Vendor/CMSIS/Include/core_cm0.h (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Vendor/CMSIS/Include/core_cm0plus.h (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Vendor/CMSIS/Include/core_cm3.h (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Vendor/CMSIS/Include/core_cm4.h (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Vendor/CMSIS/Include/core_cm7.h (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Vendor/CMSIS/Include/core_cmFunc.h (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Vendor/CMSIS/Include/core_cmInstr.h (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Vendor/CMSIS/Include/core_cmSimd.h (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Vendor/CMSIS/Include/core_sc000.h (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Vendor/CMSIS/Include/core_sc300.h (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Vendor/STM32F1xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_adc.h (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_adc_ex.h (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_cortex.h (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_def.h (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma.h (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma_ex.h (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash.h (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash_ex.h (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio.h (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio_ex.h (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_iwdg.h (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc.h (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc_ex.h (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim.h (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim_ex.h (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.c (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc.c (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc_ex.c (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.c (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.c (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.c (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.c (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_i2c.c (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_iwdg.c (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.c (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.c (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/configuration.h (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/flash.c (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/port.c (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/portmacro.h (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/postRTOS.cpp (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/preRTOS.cpp (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/stm32f103.ld (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/stm32f1xx_hal_msp.c (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/stm32f1xx_hal_timebase_TIM.c (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/stm32f1xx_it.c (100%) rename source/Core/BSP/{Sequre_S60 => Sequre}/system_stm32f1xx.c (100%) diff --git a/source/Core/BSP/Sequre_S60/BSP.cpp b/source/Core/BSP/Sequre/BSP.cpp similarity index 100% rename from source/Core/BSP/Sequre_S60/BSP.cpp rename to source/Core/BSP/Sequre/BSP.cpp diff --git a/source/Core/BSP/Sequre_S60/FreeRTOSConfig.h b/source/Core/BSP/Sequre/FreeRTOSConfig.h similarity index 100% rename from source/Core/BSP/Sequre_S60/FreeRTOSConfig.h rename to source/Core/BSP/Sequre/FreeRTOSConfig.h diff --git a/source/Core/BSP/Sequre_S60/IRQ.cpp b/source/Core/BSP/Sequre/IRQ.cpp similarity index 100% rename from source/Core/BSP/Sequre_S60/IRQ.cpp rename to source/Core/BSP/Sequre/IRQ.cpp diff --git a/source/Core/BSP/Sequre_S60/IRQ.h b/source/Core/BSP/Sequre/IRQ.h similarity index 100% rename from source/Core/BSP/Sequre_S60/IRQ.h rename to source/Core/BSP/Sequre/IRQ.h diff --git a/source/Core/BSP/Sequre_S60/Pins.h b/source/Core/BSP/Sequre/Pins.h similarity index 100% rename from source/Core/BSP/Sequre_S60/Pins.h rename to source/Core/BSP/Sequre/Pins.h diff --git a/source/Core/BSP/Sequre_S60/Power.cpp b/source/Core/BSP/Sequre/Power.cpp similarity index 100% rename from source/Core/BSP/Sequre_S60/Power.cpp rename to source/Core/BSP/Sequre/Power.cpp diff --git a/source/Core/BSP/Sequre_S60/README.md b/source/Core/BSP/Sequre/README.md similarity index 100% rename from source/Core/BSP/Sequre_S60/README.md rename to source/Core/BSP/Sequre/README.md diff --git a/source/Core/BSP/Sequre_S60/Setup.cpp b/source/Core/BSP/Sequre/Setup.cpp similarity index 100% rename from source/Core/BSP/Sequre_S60/Setup.cpp rename to source/Core/BSP/Sequre/Setup.cpp diff --git a/source/Core/BSP/Sequre_S60/Setup.h b/source/Core/BSP/Sequre/Setup.h similarity index 100% rename from source/Core/BSP/Sequre_S60/Setup.h rename to source/Core/BSP/Sequre/Setup.h diff --git a/source/Core/BSP/Sequre_S60/Software_I2C.h b/source/Core/BSP/Sequre/Software_I2C.h similarity index 100% rename from source/Core/BSP/Sequre_S60/Software_I2C.h rename to source/Core/BSP/Sequre/Software_I2C.h diff --git a/source/Core/BSP/Sequre_S60/Startup/startup_stm32f103t8ux.S b/source/Core/BSP/Sequre/Startup/startup_stm32f103t8ux.S similarity index 100% rename from source/Core/BSP/Sequre_S60/Startup/startup_stm32f103t8ux.S rename to source/Core/BSP/Sequre/Startup/startup_stm32f103t8ux.S diff --git a/source/Core/BSP/Sequre_S60/ThermoModel.cpp b/source/Core/BSP/Sequre/ThermoModel.cpp similarity index 100% rename from source/Core/BSP/Sequre_S60/ThermoModel.cpp rename to source/Core/BSP/Sequre/ThermoModel.cpp diff --git a/source/Core/BSP/Sequre_S60/Vendor/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xb.h b/source/Core/BSP/Sequre/Vendor/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xb.h similarity index 100% rename from source/Core/BSP/Sequre_S60/Vendor/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xb.h rename to source/Core/BSP/Sequre/Vendor/CMSIS/Device/ST/STM32F1xx/Include/stm32f103xb.h diff --git a/source/Core/BSP/Sequre_S60/Vendor/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h b/source/Core/BSP/Sequre/Vendor/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h similarity index 100% rename from source/Core/BSP/Sequre_S60/Vendor/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h rename to source/Core/BSP/Sequre/Vendor/CMSIS/Device/ST/STM32F1xx/Include/stm32f1xx.h diff --git a/source/Core/BSP/Sequre_S60/Vendor/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h b/source/Core/BSP/Sequre/Vendor/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h similarity index 100% rename from source/Core/BSP/Sequre_S60/Vendor/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h rename to source/Core/BSP/Sequre/Vendor/CMSIS/Device/ST/STM32F1xx/Include/system_stm32f1xx.h diff --git a/source/Core/BSP/Sequre_S60/Vendor/CMSIS/Include/arm_common_tables.h b/source/Core/BSP/Sequre/Vendor/CMSIS/Include/arm_common_tables.h similarity index 100% rename from source/Core/BSP/Sequre_S60/Vendor/CMSIS/Include/arm_common_tables.h rename to source/Core/BSP/Sequre/Vendor/CMSIS/Include/arm_common_tables.h diff --git a/source/Core/BSP/Sequre_S60/Vendor/CMSIS/Include/arm_const_structs.h b/source/Core/BSP/Sequre/Vendor/CMSIS/Include/arm_const_structs.h similarity index 100% rename from source/Core/BSP/Sequre_S60/Vendor/CMSIS/Include/arm_const_structs.h rename to source/Core/BSP/Sequre/Vendor/CMSIS/Include/arm_const_structs.h diff --git a/source/Core/BSP/Sequre_S60/Vendor/CMSIS/Include/arm_math.h b/source/Core/BSP/Sequre/Vendor/CMSIS/Include/arm_math.h similarity index 100% rename from source/Core/BSP/Sequre_S60/Vendor/CMSIS/Include/arm_math.h rename to source/Core/BSP/Sequre/Vendor/CMSIS/Include/arm_math.h diff --git a/source/Core/BSP/Sequre_S60/Vendor/CMSIS/Include/cmsis_armcc.h b/source/Core/BSP/Sequre/Vendor/CMSIS/Include/cmsis_armcc.h similarity index 100% rename from source/Core/BSP/Sequre_S60/Vendor/CMSIS/Include/cmsis_armcc.h rename to source/Core/BSP/Sequre/Vendor/CMSIS/Include/cmsis_armcc.h diff --git a/source/Core/BSP/Sequre_S60/Vendor/CMSIS/Include/cmsis_armcc_V6.h b/source/Core/BSP/Sequre/Vendor/CMSIS/Include/cmsis_armcc_V6.h similarity index 100% rename from source/Core/BSP/Sequre_S60/Vendor/CMSIS/Include/cmsis_armcc_V6.h rename to source/Core/BSP/Sequre/Vendor/CMSIS/Include/cmsis_armcc_V6.h diff --git a/source/Core/BSP/Sequre_S60/Vendor/CMSIS/Include/cmsis_gcc.h b/source/Core/BSP/Sequre/Vendor/CMSIS/Include/cmsis_gcc.h similarity index 100% rename from source/Core/BSP/Sequre_S60/Vendor/CMSIS/Include/cmsis_gcc.h rename to source/Core/BSP/Sequre/Vendor/CMSIS/Include/cmsis_gcc.h diff --git a/source/Core/BSP/Sequre_S60/Vendor/CMSIS/Include/core_cm0.h b/source/Core/BSP/Sequre/Vendor/CMSIS/Include/core_cm0.h similarity index 100% rename from source/Core/BSP/Sequre_S60/Vendor/CMSIS/Include/core_cm0.h rename to source/Core/BSP/Sequre/Vendor/CMSIS/Include/core_cm0.h diff --git a/source/Core/BSP/Sequre_S60/Vendor/CMSIS/Include/core_cm0plus.h b/source/Core/BSP/Sequre/Vendor/CMSIS/Include/core_cm0plus.h similarity index 100% rename from source/Core/BSP/Sequre_S60/Vendor/CMSIS/Include/core_cm0plus.h rename to source/Core/BSP/Sequre/Vendor/CMSIS/Include/core_cm0plus.h diff --git a/source/Core/BSP/Sequre_S60/Vendor/CMSIS/Include/core_cm3.h b/source/Core/BSP/Sequre/Vendor/CMSIS/Include/core_cm3.h similarity index 100% rename from source/Core/BSP/Sequre_S60/Vendor/CMSIS/Include/core_cm3.h rename to source/Core/BSP/Sequre/Vendor/CMSIS/Include/core_cm3.h diff --git a/source/Core/BSP/Sequre_S60/Vendor/CMSIS/Include/core_cm4.h b/source/Core/BSP/Sequre/Vendor/CMSIS/Include/core_cm4.h similarity index 100% rename from source/Core/BSP/Sequre_S60/Vendor/CMSIS/Include/core_cm4.h rename to source/Core/BSP/Sequre/Vendor/CMSIS/Include/core_cm4.h diff --git a/source/Core/BSP/Sequre_S60/Vendor/CMSIS/Include/core_cm7.h b/source/Core/BSP/Sequre/Vendor/CMSIS/Include/core_cm7.h similarity index 100% rename from source/Core/BSP/Sequre_S60/Vendor/CMSIS/Include/core_cm7.h rename to source/Core/BSP/Sequre/Vendor/CMSIS/Include/core_cm7.h diff --git a/source/Core/BSP/Sequre_S60/Vendor/CMSIS/Include/core_cmFunc.h b/source/Core/BSP/Sequre/Vendor/CMSIS/Include/core_cmFunc.h similarity index 100% rename from source/Core/BSP/Sequre_S60/Vendor/CMSIS/Include/core_cmFunc.h rename to source/Core/BSP/Sequre/Vendor/CMSIS/Include/core_cmFunc.h diff --git a/source/Core/BSP/Sequre_S60/Vendor/CMSIS/Include/core_cmInstr.h b/source/Core/BSP/Sequre/Vendor/CMSIS/Include/core_cmInstr.h similarity index 100% rename from source/Core/BSP/Sequre_S60/Vendor/CMSIS/Include/core_cmInstr.h rename to source/Core/BSP/Sequre/Vendor/CMSIS/Include/core_cmInstr.h diff --git a/source/Core/BSP/Sequre_S60/Vendor/CMSIS/Include/core_cmSimd.h b/source/Core/BSP/Sequre/Vendor/CMSIS/Include/core_cmSimd.h similarity index 100% rename from source/Core/BSP/Sequre_S60/Vendor/CMSIS/Include/core_cmSimd.h rename to source/Core/BSP/Sequre/Vendor/CMSIS/Include/core_cmSimd.h diff --git a/source/Core/BSP/Sequre_S60/Vendor/CMSIS/Include/core_sc000.h b/source/Core/BSP/Sequre/Vendor/CMSIS/Include/core_sc000.h similarity index 100% rename from source/Core/BSP/Sequre_S60/Vendor/CMSIS/Include/core_sc000.h rename to source/Core/BSP/Sequre/Vendor/CMSIS/Include/core_sc000.h diff --git a/source/Core/BSP/Sequre_S60/Vendor/CMSIS/Include/core_sc300.h b/source/Core/BSP/Sequre/Vendor/CMSIS/Include/core_sc300.h similarity index 100% rename from source/Core/BSP/Sequre_S60/Vendor/CMSIS/Include/core_sc300.h rename to source/Core/BSP/Sequre/Vendor/CMSIS/Include/core_sc300.h diff --git a/source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h b/source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h similarity index 100% rename from source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h rename to source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Inc/Legacy/stm32_hal_legacy.h diff --git a/source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h b/source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h similarity index 100% rename from source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h rename to source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal.h diff --git a/source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_adc.h b/source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_adc.h similarity index 100% rename from source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_adc.h rename to source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_adc.h diff --git a/source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_adc_ex.h b/source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_adc_ex.h similarity index 100% rename from source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_adc_ex.h rename to source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_adc_ex.h diff --git a/source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_cortex.h b/source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_cortex.h similarity index 100% rename from source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_cortex.h rename to source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_cortex.h diff --git a/source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_def.h b/source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_def.h similarity index 100% rename from source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_def.h rename to source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_def.h diff --git a/source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma.h b/source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma.h similarity index 100% rename from source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma.h rename to source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma.h diff --git a/source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma_ex.h b/source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma_ex.h similarity index 100% rename from source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma_ex.h rename to source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_dma_ex.h diff --git a/source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash.h b/source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash.h similarity index 100% rename from source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash.h rename to source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash.h diff --git a/source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash_ex.h b/source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash_ex.h similarity index 100% rename from source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash_ex.h rename to source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_flash_ex.h diff --git a/source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio.h b/source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio.h similarity index 100% rename from source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio.h rename to source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio.h diff --git a/source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio_ex.h b/source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio_ex.h similarity index 100% rename from source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio_ex.h rename to source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_gpio_ex.h diff --git a/source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h b/source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h similarity index 100% rename from source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h rename to source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_i2c.h diff --git a/source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_iwdg.h b/source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_iwdg.h similarity index 100% rename from source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_iwdg.h rename to source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_iwdg.h diff --git a/source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h b/source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h similarity index 100% rename from source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h rename to source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_pwr.h diff --git a/source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc.h b/source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc.h similarity index 100% rename from source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc.h rename to source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc.h diff --git a/source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc_ex.h b/source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc_ex.h similarity index 100% rename from source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc_ex.h rename to source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_rcc_ex.h diff --git a/source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim.h b/source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim.h similarity index 100% rename from source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim.h rename to source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim.h diff --git a/source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim_ex.h b/source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim_ex.h similarity index 100% rename from source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim_ex.h rename to source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Inc/stm32f1xx_hal_tim_ex.h diff --git a/source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.c b/source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.c similarity index 100% rename from source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.c rename to source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal.c diff --git a/source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc.c b/source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc.c similarity index 100% rename from source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc.c rename to source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc.c diff --git a/source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc_ex.c b/source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc_ex.c similarity index 100% rename from source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc_ex.c rename to source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_adc_ex.c diff --git a/source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.c b/source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.c similarity index 100% rename from source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.c rename to source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_cortex.c diff --git a/source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.c b/source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.c similarity index 100% rename from source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.c rename to source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_dma.c diff --git a/source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.c b/source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.c similarity index 100% rename from source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.c rename to source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash.c diff --git a/source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c b/source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c similarity index 100% rename from source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c rename to source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_flash_ex.c diff --git a/source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.c b/source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.c similarity index 100% rename from source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.c rename to source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio.c diff --git a/source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c b/source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c similarity index 100% rename from source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c rename to source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_gpio_ex.c diff --git a/source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_i2c.c b/source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_i2c.c similarity index 100% rename from source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_i2c.c rename to source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_i2c.c diff --git a/source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_iwdg.c b/source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_iwdg.c similarity index 100% rename from source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_iwdg.c rename to source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_iwdg.c diff --git a/source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c b/source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c similarity index 100% rename from source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c rename to source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_pwr.c diff --git a/source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c b/source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c similarity index 100% rename from source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c rename to source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc.c diff --git a/source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c b/source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c similarity index 100% rename from source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c rename to source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_rcc_ex.c diff --git a/source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.c b/source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.c similarity index 100% rename from source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.c rename to source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim.c diff --git a/source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.c b/source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.c similarity index 100% rename from source/Core/BSP/Sequre_S60/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.c rename to source/Core/BSP/Sequre/Vendor/STM32F1xx_HAL_Driver/Src/stm32f1xx_hal_tim_ex.c diff --git a/source/Core/BSP/Sequre_S60/configuration.h b/source/Core/BSP/Sequre/configuration.h similarity index 100% rename from source/Core/BSP/Sequre_S60/configuration.h rename to source/Core/BSP/Sequre/configuration.h diff --git a/source/Core/BSP/Sequre_S60/flash.c b/source/Core/BSP/Sequre/flash.c similarity index 100% rename from source/Core/BSP/Sequre_S60/flash.c rename to source/Core/BSP/Sequre/flash.c diff --git a/source/Core/BSP/Sequre_S60/port.c b/source/Core/BSP/Sequre/port.c similarity index 100% rename from source/Core/BSP/Sequre_S60/port.c rename to source/Core/BSP/Sequre/port.c diff --git a/source/Core/BSP/Sequre_S60/portmacro.h b/source/Core/BSP/Sequre/portmacro.h similarity index 100% rename from source/Core/BSP/Sequre_S60/portmacro.h rename to source/Core/BSP/Sequre/portmacro.h diff --git a/source/Core/BSP/Sequre_S60/postRTOS.cpp b/source/Core/BSP/Sequre/postRTOS.cpp similarity index 100% rename from source/Core/BSP/Sequre_S60/postRTOS.cpp rename to source/Core/BSP/Sequre/postRTOS.cpp diff --git a/source/Core/BSP/Sequre_S60/preRTOS.cpp b/source/Core/BSP/Sequre/preRTOS.cpp similarity index 100% rename from source/Core/BSP/Sequre_S60/preRTOS.cpp rename to source/Core/BSP/Sequre/preRTOS.cpp diff --git a/source/Core/BSP/Sequre_S60/stm32f103.ld b/source/Core/BSP/Sequre/stm32f103.ld similarity index 100% rename from source/Core/BSP/Sequre_S60/stm32f103.ld rename to source/Core/BSP/Sequre/stm32f103.ld diff --git a/source/Core/BSP/Sequre_S60/stm32f1xx_hal_msp.c b/source/Core/BSP/Sequre/stm32f1xx_hal_msp.c similarity index 100% rename from source/Core/BSP/Sequre_S60/stm32f1xx_hal_msp.c rename to source/Core/BSP/Sequre/stm32f1xx_hal_msp.c diff --git a/source/Core/BSP/Sequre_S60/stm32f1xx_hal_timebase_TIM.c b/source/Core/BSP/Sequre/stm32f1xx_hal_timebase_TIM.c similarity index 100% rename from source/Core/BSP/Sequre_S60/stm32f1xx_hal_timebase_TIM.c rename to source/Core/BSP/Sequre/stm32f1xx_hal_timebase_TIM.c diff --git a/source/Core/BSP/Sequre_S60/stm32f1xx_it.c b/source/Core/BSP/Sequre/stm32f1xx_it.c similarity index 100% rename from source/Core/BSP/Sequre_S60/stm32f1xx_it.c rename to source/Core/BSP/Sequre/stm32f1xx_it.c diff --git a/source/Core/BSP/Sequre_S60/system_stm32f1xx.c b/source/Core/BSP/Sequre/system_stm32f1xx.c similarity index 100% rename from source/Core/BSP/Sequre_S60/system_stm32f1xx.c rename to source/Core/BSP/Sequre/system_stm32f1xx.c diff --git a/source/Makefile b/source/Makefile index f9b4ca85..013d84f9 100644 --- a/source/Makefile +++ b/source/Makefile @@ -118,9 +118,9 @@ endif # ALL_MINIWARE_MODELS ifeq ($(model),$(filter $(model),$(ALL_SEQURE_MODELS))) $(info Building for Sequre ) -DEVICE_BSP_DIR=./Core/BSP/Sequre_S60 +DEVICE_BSP_DIR=./Core/BSP/Sequre S_SRCS:=$(shell find $(S60_STARTUP_DIR) -type f -name '*.S') -LDSCRIPT=./Core/BSP/Sequre_S60/stm32f103.ld +LDSCRIPT=./Core/BSP/Sequre/stm32f103.ld DEV_GLOBAL_DEFS=-D STM32F103T8Ux \ -D STM32F1 \ -D STM32 \ From 6ef1fbd46aa003d9630eb66993b88937cc3921e7 Mon Sep 17 00:00:00 2001 From: jonasius Date: Thu, 6 Jun 2024 22:35:35 +0200 Subject: [PATCH 10/31] Support for S99 * Enable PD Options * Make PDNegTimeout configureable * Add default value for PDNegTimeout, also for S60 and S60P * Add basic DC detection / correct debug readings while powered via DC * Add basic ThermoModel for C245 Tips * Modify op-amp gain --- source/Core/BSP/Sequre/Power.cpp | 20 ++++++++++++++++++- source/Core/BSP/Sequre/ThermoModel.cpp | 7 +++++++ source/Core/BSP/Sequre/configuration.h | 10 +++++++--- source/Core/Drivers/FS2711.cpp | 14 +++++++++---- source/Core/Src/Settings.cpp | 2 +- source/Core/Src/settingsGUI.cpp | 10 +++++----- .../Threads/OperatingModes/OperatingModes.h | 4 ++++ .../OperatingModes/utils/SolderingCommon.cpp | 7 +++++++ 8 files changed, 60 insertions(+), 14 deletions(-) diff --git a/source/Core/BSP/Sequre/Power.cpp b/source/Core/BSP/Sequre/Power.cpp index a6b1f7c7..a72105e8 100644 --- a/source/Core/BSP/Sequre/Power.cpp +++ b/source/Core/BSP/Sequre/Power.cpp @@ -4,6 +4,7 @@ #include "QC3.h" #include "Settings.h" #include "USBPD.h" +#include "FS2711.hpp" #include "configuration.h" void power_check() { @@ -16,9 +17,26 @@ void power_check() { return; // We are using PD } #endif +#if POW_PD_EXT == 2 + if (FS2711::has_run_selection()) { + return; + } +#endif #ifdef POW_QC QC_resync(); #endif } -bool getIsPoweredByDCIN() { return false; } +bool getIsPoweredByDCIN() { +#if POW_PD_EXT == 2 && defined(POW_DC) + if (!FS2711::has_run_selection()) { + return true; + } else if(FS2711::debug_get_state().source_voltage > 0) { + return false; + } else { + return true; + } +#else + return false; +#endif +} diff --git a/source/Core/BSP/Sequre/ThermoModel.cpp b/source/Core/BSP/Sequre/ThermoModel.cpp index 90c12ab1..798cdcd3 100644 --- a/source/Core/BSP/Sequre/ThermoModel.cpp +++ b/source/Core/BSP/Sequre/ThermoModel.cpp @@ -8,4 +8,11 @@ #include "Utils.h" #include "configuration.h" +#if defined(TEMP_uV_LOOKUP_S60) TemperatureType_t TipThermoModel::convertuVToDegC(uint32_t tipuVDelta) { return (tipuVDelta * 50) / 485; } +#elif defined(TEMP_uV_LOOKUP_S99) +// 42.85 uV / K -> 1/42.85 K/uV = 20/857 +// TemperatureType_t TipThermoModel::convertuVToDegC(uint32_t tipuVDelta) { return (tipuVDelta * 20) / 857; } +// Measurement is probably with heating element in series, thats why the reading differs from the approx 42.85 uV/K +TemperatureType_t TipThermoModel::convertuVToDegC(uint32_t tipuVDelta) { return (tipuVDelta * 1) / 30; } +#endif diff --git a/source/Core/BSP/Sequre/configuration.h b/source/Core/BSP/Sequre/configuration.h index 8bbb2f31..04c40b2a 100644 --- a/source/Core/BSP/Sequre/configuration.h +++ b/source/Core/BSP/Sequre/configuration.h @@ -145,6 +145,7 @@ #define OP_AMP_GAIN_STAGE 536 #define TEMP_uV_LOOKUP_S60 #define USB_PD_VMAX 12 // Maximum voltage for PD to negotiate +#define USB_PD_TIMEOUT 1 // Default Timeout for USB-PD Protocol negotiation in x100ms #define HARDWARE_MAX_WATTAGE_X10 600 @@ -176,6 +177,7 @@ #define OP_AMP_GAIN_STAGE 536 #define TEMP_uV_LOOKUP_S60 #define USB_PD_VMAX 20 // Maximum voltage for PD to negotiate +#define USB_PD_TIMEOUT 1 // Default Timeout for USB-PD Protocol negotiation in x100ms #define HARDWARE_MAX_WATTAGE_X10 600 @@ -204,11 +206,12 @@ #define POWER_LIMIT 0 // 0 watts default limit #define MAX_POWER_LIMIT 70 #define POWER_LIMIT_STEPS 5 -#define OP_AMP_GAIN_STAGE 536 -#define TEMP_uV_LOOKUP_S60 +#define OP_AMP_GAIN_STAGE 237 // Two sequential op-amps 1st: 1+(9k29/997R)=10.31 2nd: 1+(22k/1k)=23 -> 10.31*23=237 +#define TEMP_uV_LOOKUP_S99 #define USB_PD_VMAX 20 // Maximum voltage for PD to negotiate +#define USB_PD_TIMEOUT 2 // Default Timeout for USB-PD Protocol negotiation in x100ms -#define HARDWARE_MAX_WATTAGE_X10 600 +#define HARDWARE_MAX_WATTAGE_X10 1300 #define TIP_THERMAL_MASS 8 // X10 watts to raise 1 deg C in 1 second #define TIP_THERMAL_INERTIA 128 // We use a large inertia value to smooth out the drive to the tip since its stupidly sensitive @@ -219,6 +222,7 @@ #define GPIO_VIBRATION #define POW_PD_EXT 2 #define USB_PD_EPR_WATTAGE 0 /*No EPR*/ +#define POW_DC #define DEBUG_POWER_MENU_BUTTON_B 1 #define HAS_POWER_DEBUG_MENU #define TEMP_NTC diff --git a/source/Core/Drivers/FS2711.cpp b/source/Core/Drivers/FS2711.cpp index 24957121..d0fc780b 100644 --- a/source/Core/Drivers/FS2711.cpp +++ b/source/Core/Drivers/FS2711.cpp @@ -3,6 +3,7 @@ #include "I2CBB2.hpp" #include "configuration.h" #include "Settings.h" +#include "Utils.h" #if POW_PD_EXT == 2 #include "BSP.h" #include "cmsis_os.h" @@ -33,11 +34,11 @@ void FS2711::start() { state.req_pdo_num = 0xFF; enable_protocol(false); - // PDNegTimeout is in 1/100 s, so x10 for ms - osDelay(getSettingValue(SettingsOptions::PDNegTimeout)*10); + // PDNegTimeout is in 100ms, so x100 for ms + osDelay(getSettingValue(SettingsOptions::PDNegTimeout)*100); select_protocol(FS2711_PROTOCOL_PD); enable_protocol(true); - osDelay(getSettingValue(SettingsOptions::PDNegTimeout)*10); + osDelay(getSettingValue(SettingsOptions::PDNegTimeout)*100); } uint8_t FS2711::selected_protocol() { return i2c_read(FS2711_REG_SELECT_PROTOCOL); } @@ -161,6 +162,11 @@ void FS2711::negotiate() { if (getSettingValue(SettingsOptions::USBPDMode) == 1) { tip_resistance += 5; } + #ifdef MODEL_HAS_DCDC + // If this device has step down DC/DC inductor to smooth out current spikes + // We can instead ignore resistance and go for max voltage we can accept; and rely on the DC/DC regulation to keep under current limit + tip_resistance = 255; // (Push to 25.5 ohms to effectively disable this check) + #endif uint16_t pdo_min_mv = 0, pdo_max_mv = 0, pdo_max_curr = 0, pdo_type = 0; @@ -226,7 +232,7 @@ bool FS2711::has_run_selection() { return state.req_pdo_num != 0xFF; } uint16_t FS2711::source_voltage() { return state.source_voltage / 1000; } -// FS2711 does current in mV so it needs to be converted to x100 intead of x1000 +// FS2711 does current in mA so it needs to be converted to x100 intead of x1000 uint16_t FS2711::source_currentx100() { return state.source_current / 10; } uint16_t FS2711::debug_pdo_max_voltage(uint8_t pdoid) { return state.pdo_max_volt[pdoid]; } diff --git a/source/Core/Src/Settings.cpp b/source/Core/Src/Settings.cpp index 77512b9d..5e569618 100644 --- a/source/Core/Src/Settings.cpp +++ b/source/Core/Src/Settings.cpp @@ -83,7 +83,7 @@ static const SettingConstants settingsConstants[(int)SettingsOptions::SettingsOp { 0, 9, 1, 0}, // AccelMissingWarningCounter { 0, 9, 1, 0}, // PDMissingWarningCounter { 0, 0xFFFF, 0, 41431 /*EN*/}, // UILanguage - { 0, 50, 1, 20}, // PDNegTimeout + { 0, 50, 1, USB_PD_TIMEOUT}, // PDNegTimeout { 0, 1, 1, 0}, // OLEDInversion { MIN_BRIGHTNESS, MAX_BRIGHTNESS, BRIGHTNESS_STEP, DEFAULT_BRIGHTNESS}, // OLEDBrightness { 0, 6, 1, 1}, // LOGOTime diff --git a/source/Core/Src/settingsGUI.cpp b/source/Core/Src/settingsGUI.cpp index b9ded285..13eb559a 100644 --- a/source/Core/Src/settingsGUI.cpp +++ b/source/Core/Src/settingsGUI.cpp @@ -24,7 +24,7 @@ static void displayInputMinVRange(void); static void displayQCInputV(void); #endif /* POW_QC */ -#ifdef POW_PD +#if defined POW_PD || POW_PD_EXT == 2 static void displayPDNegTimeout(void); static void displayUSBPDMode(void); #endif /* POW_PD */ @@ -225,7 +225,7 @@ const menuitem rootSettingsMenu[] { /* ^^^^ end of menu marker. DO NOT REMOVE ^^^^ */ }; -#if defined(POW_DC) || defined(POW_QC) || defined(POW_PD) +#if defined(POW_DC) || defined(POW_QC) || defined(POW_PD) || POW_PD_EXT == 2 const menuitem powerMenu[] = { /* * Power Source @@ -244,7 +244,7 @@ const menuitem powerMenu[] = { /* Voltage input */ {SETTINGS_DESC(SettingsItemIndex::QCMaxVoltage), nullptr, displayQCInputV, nullptr, SettingsOptions::QCIdealVoltage, SettingsItemIndex::QCMaxVoltage, 4}, #endif -#ifdef POW_PD +#if defined(POW_PD) || POW_PD_EXT == 2 /* PD timeout setup */ {SETTINGS_DESC(SettingsItemIndex::PDNegTimeout), nullptr, displayPDNegTimeout, nullptr, SettingsOptions::PDNegTimeout, SettingsItemIndex::PDNegTimeout, 6}, /* Toggle PPS & EPR */ @@ -433,7 +433,7 @@ const menuitem advancedMenu[] = { /* clang-format on */ const menuitem *subSettingsMenus[] { -#if defined(POW_DC) || defined(POW_QC) || defined(POW_PD) +#if defined(POW_DC) || defined(POW_QC) || defined(POW_PD) || POW_PD_EXT == 2 powerMenu, #endif solderingMenu, PowerSavingMenu, UIMenu, advancedMenu, @@ -518,7 +518,7 @@ static void displayQCInputV(void) { #endif /* POW_QC */ -#ifdef POW_PD /* POW_PD */ +#if defined(POW_PD) || POW_PD_EXT == 2 /* POW_PD */ static void displayPDNegTimeout(void) { auto value = getSettingValue(SettingsOptions::PDNegTimeout); diff --git a/source/Core/Threads/OperatingModes/OperatingModes.h b/source/Core/Threads/OperatingModes/OperatingModes.h index f499b0cc..e4b6f75a 100644 --- a/source/Core/Threads/OperatingModes/OperatingModes.h +++ b/source/Core/Threads/OperatingModes/OperatingModes.h @@ -23,6 +23,10 @@ extern "C" { #include "USBPD.h" #include "pd.h" #endif +#if POW_PD_EXT == 2 +#include "FS2711.hpp" +#include "FS2711_defines.h" +#endif enum class OperatingMode { StartupLogo = 0, // Showing the startup logo diff --git a/source/Core/Threads/OperatingModes/utils/SolderingCommon.cpp b/source/Core/Threads/OperatingModes/utils/SolderingCommon.cpp index 08371648..943df322 100644 --- a/source/Core/Threads/OperatingModes/utils/SolderingCommon.cpp +++ b/source/Core/Threads/OperatingModes/utils/SolderingCommon.cpp @@ -132,6 +132,13 @@ int8_t getPowerSourceNumber(void) { #endif } } +#endif +#if POW_PD_EXT == 2 + if (FS2711::has_run_selection()) { + poweredbyPD = true; + // FS2711IC has VBUS always connected + pdHasVBUSConnected = true; + } #endif if (poweredbyPD) { if (pdHasVBUSConnected) { From da28492f00935b19a4cc3258f98f8784a5b7a1bb Mon Sep 17 00:00:00 2001 From: jonasius Date: Thu, 6 Jun 2024 23:09:43 +0200 Subject: [PATCH 11/31] Add define for USB_PD_TIMEOUT, the default value for PDNegTimeout --- source/Core/BSP/Miniware/configuration.h | 1 + source/Core/BSP/Pinecil/configuration.h | 1 + source/Core/BSP/Pinecilv2/configuration.h | 1 + 3 files changed, 3 insertions(+) diff --git a/source/Core/BSP/Miniware/configuration.h b/source/Core/BSP/Miniware/configuration.h index 91923dfa..ad63fbf5 100644 --- a/source/Core/BSP/Miniware/configuration.h +++ b/source/Core/BSP/Miniware/configuration.h @@ -127,6 +127,7 @@ #define ADC_VDD_MV 3300 // ADC max reading millivolts #define POW_PD_EXT 0 +#define USB_PD_TIMEOUT 20 // Default Timeout for USB-PD Protocol negotiation in x100ms // Deriving the Voltage div: // Vin_max = (3.3*(r1+r2))/(r2) diff --git a/source/Core/BSP/Pinecil/configuration.h b/source/Core/BSP/Pinecil/configuration.h index 7eaf9027..4bf54bdd 100644 --- a/source/Core/BSP/Pinecil/configuration.h +++ b/source/Core/BSP/Pinecil/configuration.h @@ -148,6 +148,7 @@ #define POW_PD 1 #define USB_PD_EPR_WATTAGE 0 /*No EPR (Yet?) */ #define POW_PD_EXT 0 +#define USB_PD_TIMEOUT 20 // Default Timeout for USB-PD Protocol negotiation in x100ms #define POW_QC 1 #define POW_DC 1 #define POW_QC_20V 1 diff --git a/source/Core/BSP/Pinecilv2/configuration.h b/source/Core/BSP/Pinecilv2/configuration.h index 09472719..a8e234bd 100644 --- a/source/Core/BSP/Pinecilv2/configuration.h +++ b/source/Core/BSP/Pinecilv2/configuration.h @@ -148,6 +148,7 @@ #define POW_PD 1 // Supported features #define USB_PD_EPR_WATTAGE 140 // USB PD EPR Wattage #define POW_PD_EXT 0 // Future-proof macro for other models with other PD modes +#define USB_PD_TIMEOUT 20 // Default Timeout for USB-PD Protocol negotiation in x100ms #define POW_QC 1 // Supported features #define POW_DC 1 // Supported features #define POW_QC_20V 1 // Supported features From f5d6d8b1af3db34a06f11eaf74c1f38b074c98f9 Mon Sep 17 00:00:00 2001 From: jonasius Date: Thu, 6 Jun 2024 23:13:58 +0200 Subject: [PATCH 12/31] Add define for USB_PD_TIMEOUT, the default value for PDNegTimeout --- source/Core/BSP/MHP30/configuration.h | 1 + 1 file changed, 1 insertion(+) diff --git a/source/Core/BSP/MHP30/configuration.h b/source/Core/BSP/MHP30/configuration.h index 6cefa404..4c5c18e8 100644 --- a/source/Core/BSP/MHP30/configuration.h +++ b/source/Core/BSP/MHP30/configuration.h @@ -153,6 +153,7 @@ #define PROFILE_SUPPORT #define POW_PD 1 +#define USB_PD_TIMEOUT 20 // Default Timeout for USB-PD Protocol negotiation in x100ms #define POW_PD_EXT 0 #define USB_PD_EPR_WATTAGE 0 /*No EPR*/ #define TEMP_NTC From 8514edfdea09c0c955ddad843ad5980e0250b3a4 Mon Sep 17 00:00:00 2001 From: jonasius Date: Thu, 6 Jun 2024 23:35:12 +0200 Subject: [PATCH 13/31] Fix clang-format code style mismatches --- source/Core/BSP/Sequre/Power.cpp | 8 ++++---- source/Core/BSP/Sequre/ThermoModel.cpp | 2 +- source/Core/BSP/Sequre/configuration.h | 12 ++++++------ 3 files changed, 11 insertions(+), 11 deletions(-) diff --git a/source/Core/BSP/Sequre/Power.cpp b/source/Core/BSP/Sequre/Power.cpp index a72105e8..649bf370 100644 --- a/source/Core/BSP/Sequre/Power.cpp +++ b/source/Core/BSP/Sequre/Power.cpp @@ -1,10 +1,10 @@ #include "BSP.h" #include "BSP_Power.h" +#include "FS2711.hpp" #include "Pins.h" #include "QC3.h" #include "Settings.h" #include "USBPD.h" -#include "FS2711.hpp" #include "configuration.h" void power_check() { @@ -27,16 +27,16 @@ void power_check() { #endif } -bool getIsPoweredByDCIN() { +bool getIsPoweredByDCIN() { #if POW_PD_EXT == 2 && defined(POW_DC) if (!FS2711::has_run_selection()) { return true; - } else if(FS2711::debug_get_state().source_voltage > 0) { + } else if (FS2711::debug_get_state().source_voltage > 0) { return false; } else { return true; } #else - return false; + return false; #endif } diff --git a/source/Core/BSP/Sequre/ThermoModel.cpp b/source/Core/BSP/Sequre/ThermoModel.cpp index 798cdcd3..31fcdf29 100644 --- a/source/Core/BSP/Sequre/ThermoModel.cpp +++ b/source/Core/BSP/Sequre/ThermoModel.cpp @@ -8,7 +8,7 @@ #include "Utils.h" #include "configuration.h" -#if defined(TEMP_uV_LOOKUP_S60) +#if defined(TEMP_uV_LOOKUP_S60) TemperatureType_t TipThermoModel::convertuVToDegC(uint32_t tipuVDelta) { return (tipuVDelta * 50) / 485; } #elif defined(TEMP_uV_LOOKUP_S99) // 42.85 uV / K -> 1/42.85 K/uV = 20/857 diff --git a/source/Core/BSP/Sequre/configuration.h b/source/Core/BSP/Sequre/configuration.h index 04c40b2a..501cb85c 100644 --- a/source/Core/BSP/Sequre/configuration.h +++ b/source/Core/BSP/Sequre/configuration.h @@ -144,8 +144,8 @@ #define POWER_LIMIT_STEPS 5 #define OP_AMP_GAIN_STAGE 536 #define TEMP_uV_LOOKUP_S60 -#define USB_PD_VMAX 12 // Maximum voltage for PD to negotiate -#define USB_PD_TIMEOUT 1 // Default Timeout for USB-PD Protocol negotiation in x100ms +#define USB_PD_VMAX 12 // Maximum voltage for PD to negotiate +#define USB_PD_TIMEOUT 1 // Default Timeout for USB-PD Protocol negotiation in x100ms #define HARDWARE_MAX_WATTAGE_X10 600 @@ -176,8 +176,8 @@ #define POWER_LIMIT_STEPS 5 #define OP_AMP_GAIN_STAGE 536 #define TEMP_uV_LOOKUP_S60 -#define USB_PD_VMAX 20 // Maximum voltage for PD to negotiate -#define USB_PD_TIMEOUT 1 // Default Timeout for USB-PD Protocol negotiation in x100ms +#define USB_PD_VMAX 20 // Maximum voltage for PD to negotiate +#define USB_PD_TIMEOUT 1 // Default Timeout for USB-PD Protocol negotiation in x100ms #define HARDWARE_MAX_WATTAGE_X10 600 @@ -208,8 +208,8 @@ #define POWER_LIMIT_STEPS 5 #define OP_AMP_GAIN_STAGE 237 // Two sequential op-amps 1st: 1+(9k29/997R)=10.31 2nd: 1+(22k/1k)=23 -> 10.31*23=237 #define TEMP_uV_LOOKUP_S99 -#define USB_PD_VMAX 20 // Maximum voltage for PD to negotiate -#define USB_PD_TIMEOUT 2 // Default Timeout for USB-PD Protocol negotiation in x100ms +#define USB_PD_VMAX 20 // Maximum voltage for PD to negotiate +#define USB_PD_TIMEOUT 2 // Default Timeout for USB-PD Protocol negotiation in x100ms #define HARDWARE_MAX_WATTAGE_X10 1300 From b772e1dc26555f19bef6bfbc9735b572e03cb414 Mon Sep 17 00:00:00 2001 From: jonasius Date: Wed, 19 Jun 2024 22:05:55 +0200 Subject: [PATCH 14/31] Add S99 to overview table --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 3d2f5ab2..76feba04 100644 --- a/README.md +++ b/README.md @@ -29,6 +29,7 @@ _This firmware does **NOT** support the USB port while running for changing sett | Miniware TS101 | ✔️ | ❌ | ✔️ | ✔️ | ❌ | ✔️ | ✔️ | Full OLED resolution not yet supported. | | Sequre S60 | ❌ | ❌ | ✔️ | ❌ | ❌ | ❌ | ✔️ | Full OLED resolution not yet supported. | | Sequre S60P | ❌ | ❌ | ✔️ | ❌ | ❌ | ❌ | ✔️ | Full OLED resolution not yet supported. | +| Sequre S99 | ✔️ | ❌ | ✔️ | ❌ | ❌ | ❌ | ✔️ | Full OLED resolution not yet supported. | | Miniware TS80P | ❌ | ✔️ | ✔️ | ❌ | ❌ | N/A | ✔️ | | | Miniware TS100 | ✔️ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌\*\* | | | Miniware TS80 | ❌ | ✔️ | ❌ | ❌ | ❌ | N/A | ❌\*\*\* | | From c8c36d29bffd005716c386172f133b932b3f039b Mon Sep 17 00:00:00 2001 From: jonasius Date: Wed, 19 Jun 2024 22:24:05 +0200 Subject: [PATCH 15/31] Fix clang-format code style mismatches --- source/Core/Drivers/FS2711.cpp | 16 ++++++++-------- .../OperatingModes/utils/SolderingCommon.cpp | 6 +++--- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/source/Core/Drivers/FS2711.cpp b/source/Core/Drivers/FS2711.cpp index d0fc780b..d80a1623 100644 --- a/source/Core/Drivers/FS2711.cpp +++ b/source/Core/Drivers/FS2711.cpp @@ -1,9 +1,9 @@ #include "FS2711.hpp" #include "FS2711_defines.h" #include "I2CBB2.hpp" -#include "configuration.h" #include "Settings.h" #include "Utils.h" +#include "configuration.h" #if POW_PD_EXT == 2 #include "BSP.h" #include "cmsis_os.h" @@ -35,10 +35,10 @@ void FS2711::start() { enable_protocol(false); // PDNegTimeout is in 100ms, so x100 for ms - osDelay(getSettingValue(SettingsOptions::PDNegTimeout)*100); + osDelay(getSettingValue(SettingsOptions::PDNegTimeout) * 100); select_protocol(FS2711_PROTOCOL_PD); enable_protocol(true); - osDelay(getSettingValue(SettingsOptions::PDNegTimeout)*100); + osDelay(getSettingValue(SettingsOptions::PDNegTimeout) * 100); } uint8_t FS2711::selected_protocol() { return i2c_read(FS2711_REG_SELECT_PROTOCOL); } @@ -162,11 +162,11 @@ void FS2711::negotiate() { if (getSettingValue(SettingsOptions::USBPDMode) == 1) { tip_resistance += 5; } - #ifdef MODEL_HAS_DCDC - // If this device has step down DC/DC inductor to smooth out current spikes - // We can instead ignore resistance and go for max voltage we can accept; and rely on the DC/DC regulation to keep under current limit - tip_resistance = 255; // (Push to 25.5 ohms to effectively disable this check) - #endif +#ifdef MODEL_HAS_DCDC + // If this device has step down DC/DC inductor to smooth out current spikes + // We can instead ignore resistance and go for max voltage we can accept; and rely on the DC/DC regulation to keep under current limit + tip_resistance = 255; // (Push to 25.5 ohms to effectively disable this check) +#endif uint16_t pdo_min_mv = 0, pdo_max_mv = 0, pdo_max_curr = 0, pdo_type = 0; diff --git a/source/Core/Threads/OperatingModes/utils/SolderingCommon.cpp b/source/Core/Threads/OperatingModes/utils/SolderingCommon.cpp index 943df322..3ad0c72f 100644 --- a/source/Core/Threads/OperatingModes/utils/SolderingCommon.cpp +++ b/source/Core/Threads/OperatingModes/utils/SolderingCommon.cpp @@ -135,9 +135,9 @@ int8_t getPowerSourceNumber(void) { #endif #if POW_PD_EXT == 2 if (FS2711::has_run_selection()) { - poweredbyPD = true; - // FS2711IC has VBUS always connected - pdHasVBUSConnected = true; + poweredbyPD = true; + // FS2711IC has VBUS always connected + pdHasVBUSConnected = true; } #endif if (poweredbyPD) { From a626d5a9c1990bf61871db4369e911b9d768d3a5 Mon Sep 17 00:00:00 2001 From: jonasius Date: Tue, 25 Jun 2024 17:26:14 +0200 Subject: [PATCH 16/31] Fix missing PD related description of menu items and messages for POW_PD_EXT --- Translations/translations_definitions.json | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Translations/translations_definitions.json b/Translations/translations_definitions.json index 3b735c3a..5427d644 100644 --- a/Translations/translations_definitions.json +++ b/Translations/translations_definitions.json @@ -18,7 +18,7 @@ }, { "id": "NoPowerDeliveryMessage", - "include": ["POW_PD"], + "include": ["POW_PD", "POW_PD_EXT"], "description": "The IC required for USB-PD could not be communicated with. This is an error warning that USB-PD WILL NOT FUNCTION. Generally indicative of either a hardware or software issues." }, { @@ -240,14 +240,14 @@ "id": "PDNegTimeout", "maxLen": 8, "maxLen2": 15, - "include": ["POW_PD"], + "include": ["POW_PD", "POW_PD_EXT"], "description": "How long until firmware stops trying to negotiate for USB-PD and tries QC instead. Longer times may help dodgy / old PD adapters, faster times move onto PD quickly. Units of 100ms. Recommended to keep small values." }, { "id": "USBPDMode", "maxLen": 7, "maxLen2": 15, - "include": ["POW_PD"], + "include": ["POW_PD", "POW_PD_EXT"], "description": "No Dynamic disables EPR & PPS, Safe mode does not use padding resistance" }, { From c776390ac35f290114d09305c2969f271fdf2a38 Mon Sep 17 00:00:00 2001 From: jonasius Date: Tue, 25 Jun 2024 19:03:07 +0200 Subject: [PATCH 17/31] Add pins for S99 v1.5 and probably S60P v1.2 --- source/Core/BSP/Sequre/Pins.h | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/source/Core/BSP/Sequre/Pins.h b/source/Core/BSP/Sequre/Pins.h index c9b31c06..fadbebf7 100644 --- a/source/Core/BSP/Sequre/Pins.h +++ b/source/Core/BSP/Sequre/Pins.h @@ -5,8 +5,8 @@ * Author: Ralim */ -#ifndef BSP_MINIWARE_PINS_H_ -#define BSP_MINIWARE_PINS_H_ +#ifndef BSP_SEQURE_PINS_H_ +#define BSP_SEQURE_PINS_H_ #include "configuration.h" #ifdef MODEL_S60 @@ -65,6 +65,10 @@ #define SCL2_GPIO_Port GPIOB #define SDA2_Pin GPIO_PIN_7 #define SDA2_GPIO_Port GPIOB +#define SCL_Pin GPIO_PIN_11 +#define SCL_GPIO_Port GPIOB +#define SDA_Pin GPIO_PIN_10 +#define SDA_GPIO_Port GPIOB // Pin gets pulled high on movement #define MOVEMENT_Pin GPIO_PIN_3 #define MOVEMENT_GPIO_Port GPIOA @@ -96,9 +100,13 @@ #define SCL2_GPIO_Port GPIOB #define SDA2_Pin GPIO_PIN_7 #define SDA2_GPIO_Port GPIOB +#define SCL_Pin GPIO_PIN_11 +#define SCL_GPIO_Port GPIOB +#define SDA_Pin GPIO_PIN_10 +#define SDA_GPIO_Port GPIOB // Pin gets pulled high on movement #define MOVEMENT_Pin GPIO_PIN_3 #define MOVEMENT_GPIO_Port GPIOA #endif -#endif /* BSP_MINIWARE_PINS_H_ */ +#endif /* BSP_SEQURE_PINS_H_ */ From e9117269ef7c2da632d7f5af64b1a2758f69c5ac Mon Sep 17 00:00:00 2001 From: jonasius Date: Tue, 25 Jun 2024 19:07:22 +0200 Subject: [PATCH 18/31] Add experimental detection of separate USB-PD I2C bus for S99 v1.5 and S60P v1.2 --- source/Core/BSP/Sequre/BSP.cpp | 68 -------------------------- source/Core/BSP/Sequre/Software_I2C.h | 22 +++++++-- source/Core/BSP/Sequre/configuration.h | 4 ++ source/Core/BSP/Sequre/preRTOS.cpp | 12 ++++- source/Core/Drivers/FS2711.cpp | 36 ++++++++++++-- source/Core/Drivers/FS2711.hpp | 2 + 6 files changed, 66 insertions(+), 78 deletions(-) diff --git a/source/Core/BSP/Sequre/BSP.cpp b/source/Core/BSP/Sequre/BSP.cpp index b32f239e..c1c02e48 100644 --- a/source/Core/BSP/Sequre/BSP.cpp +++ b/source/Core/BSP/Sequre/BSP.cpp @@ -122,75 +122,7 @@ void HAL_TIM_PWM_PulseFinishedCallback(TIM_HandleTypeDef *htim) { } void unstick_I2C() { -#ifdef SCL_Pin - GPIO_InitTypeDef GPIO_InitStruct; - int timeout = 100; - int timeout_cnt = 0; - // 1. Clear PE bit. - hi2c1.Instance->CR1 &= ~(0x0001); - /**I2C1 GPIO Configuration - PB6 ------> I2C1_SCL - PB7 ------> I2C1_SDA - */ - // 2. Configure the SCL and SDA I/Os as General Purpose Output Open-Drain, High level (Write 1 to GPIOx_ODR). - GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_OD; - GPIO_InitStruct.Pull = GPIO_PULLUP; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - - GPIO_InitStruct.Pin = SCL_Pin; - HAL_GPIO_Init(SCL_GPIO_Port, &GPIO_InitStruct); - HAL_GPIO_WritePin(SCL_GPIO_Port, SCL_Pin, GPIO_PIN_SET); - - GPIO_InitStruct.Pin = SDA_Pin; - HAL_GPIO_Init(SDA_GPIO_Port, &GPIO_InitStruct); - HAL_GPIO_WritePin(SDA_GPIO_Port, SDA_Pin, GPIO_PIN_SET); - - while (GPIO_PIN_SET != HAL_GPIO_ReadPin(SDA_GPIO_Port, SDA_Pin)) { - // Move clock to release I2C - HAL_GPIO_WritePin(SCL_GPIO_Port, SCL_Pin, GPIO_PIN_RESET); - asm("nop"); - asm("nop"); - asm("nop"); - asm("nop"); - HAL_GPIO_WritePin(SCL_GPIO_Port, SCL_Pin, GPIO_PIN_SET); - - timeout_cnt++; - if (timeout_cnt > timeout) { - return; - } - } - - // 12. Configure the SCL and SDA I/Os as Alternate function Open-Drain. - GPIO_InitStruct.Mode = GPIO_MODE_AF_OD; - GPIO_InitStruct.Pull = GPIO_PULLUP; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; - - GPIO_InitStruct.Pin = SCL_Pin; - HAL_GPIO_Init(SCL_GPIO_Port, &GPIO_InitStruct); - - GPIO_InitStruct.Pin = SDA_Pin; - HAL_GPIO_Init(SDA_GPIO_Port, &GPIO_InitStruct); - - HAL_GPIO_WritePin(SCL_GPIO_Port, SCL_Pin, GPIO_PIN_SET); - HAL_GPIO_WritePin(SDA_GPIO_Port, SDA_Pin, GPIO_PIN_SET); - - // 13. Set SWRST bit in I2Cx_CR1 register. - hi2c1.Instance->CR1 |= 0x8000; - - asm("nop"); - - // 14. Clear SWRST bit in I2Cx_CR1 register. - hi2c1.Instance->CR1 &= ~0x8000; - - asm("nop"); - - // 15. Enable the I2C peripheral by setting the PE bit in I2Cx_CR1 register - hi2c1.Instance->CR1 |= 0x0001; - - // Call initialization function. - HAL_I2C_Init(&hi2c1); -#endif } uint8_t getButtonA() { return HAL_GPIO_ReadPin(KEY_A_GPIO_Port, KEY_A_Pin) == GPIO_PIN_RESET ? 1 : 0; } diff --git a/source/Core/BSP/Sequre/Software_I2C.h b/source/Core/BSP/Sequre/Software_I2C.h index d80bbfcb..a28d0ce0 100644 --- a/source/Core/BSP/Sequre/Software_I2C.h +++ b/source/Core/BSP/Sequre/Software_I2C.h @@ -5,19 +5,32 @@ * Author: Ralim */ -#ifndef BSP_MINIWARE_SOFTWARE_I2C_H_ -#define BSP_MINIWARE_SOFTWARE_I2C_H_ +#ifndef BSP_SEQURE_SOFTWARE_I2C_H_ +#define BSP_SEQURE_SOFTWARE_I2C_H_ #include "BSP.h" #include "configuration.h" #include "stm32f1xx_hal.h" -#ifdef I2C_SOFT_BUS_2 +#ifdef I2C_SOFT_BUS_1 +#define SOFT_SCL1_HIGH() HAL_GPIO_WritePin(SCL_GPIO_Port, SCL_Pin, GPIO_PIN_SET) +#define SOFT_SCL1_LOW() HAL_GPIO_WritePin(SCL_GPIO_Port, SCL_Pin, GPIO_PIN_RESET) +#define SOFT_SDA1_HIGH() HAL_GPIO_WritePin(SDA_GPIO_Port, SDA_Pin, GPIO_PIN_SET) +#define SOFT_SDA1_LOW() HAL_GPIO_WritePin(SDA_GPIO_Port, SDA_Pin, GPIO_PIN_RESET) +#define SOFT_SDA1_READ() (HAL_GPIO_ReadPin(SDA_GPIO_Port, SDA_Pin) == GPIO_PIN_SET ? 1 : 0) +#define SOFT_SCL1_READ() (HAL_GPIO_ReadPin(SCL_GPIO_Port, SCL_Pin) == GPIO_PIN_SET ? 1 : 0) + +#endif /* I2C_SOFT_BUS_1 */ + +#ifdef I2C_SOFT_BUS_2 #define SOFT_SCL2_HIGH() HAL_GPIO_WritePin(SCL2_GPIO_Port, SCL2_Pin, GPIO_PIN_SET) #define SOFT_SCL2_LOW() HAL_GPIO_WritePin(SCL2_GPIO_Port, SCL2_Pin, GPIO_PIN_RESET) #define SOFT_SDA2_HIGH() HAL_GPIO_WritePin(SDA2_GPIO_Port, SDA2_Pin, GPIO_PIN_SET) #define SOFT_SDA2_LOW() HAL_GPIO_WritePin(SDA2_GPIO_Port, SDA2_Pin, GPIO_PIN_RESET) #define SOFT_SDA2_READ() (HAL_GPIO_ReadPin(SDA2_GPIO_Port, SDA2_Pin) == GPIO_PIN_SET ? 1 : 0) #define SOFT_SCL2_READ() (HAL_GPIO_ReadPin(SCL2_GPIO_Port, SCL2_Pin) == GPIO_PIN_SET ? 1 : 0) + +#endif /* I2C_SOFT_BUS_2 */ + // clang-format off #define SOFT_I2C_DELAY() \ { \ @@ -27,7 +40,6 @@ } // clang-format on -#endif // 40 ~= 100kHz; 15 gives around 250kHz or so which is fast _and_ stable -#endif /* BSP_MINIWARE_SOFTWARE_I2C_H_ */ +#endif /* BSP_SEQURE_SOFTWARE_I2C_H_ */ diff --git a/source/Core/BSP/Sequre/configuration.h b/source/Core/BSP/Sequre/configuration.h index 501cb85c..78da9d8a 100644 --- a/source/Core/BSP/Sequre/configuration.h +++ b/source/Core/BSP/Sequre/configuration.h @@ -194,6 +194,8 @@ #define HAS_POWER_DEBUG_MENU #define TEMP_NTC #define I2C_SOFT_BUS_2 // For now we are doing software I2C to get around hardware chip issues +#define I2C_PROBE_POW_PD // For now we are doing software I2C to get around hardware chip issues +#define I2C_SOFT_BUS_1 // For now we are doing software I2C to get around hardware chip issues #define OLED_I2CBB2 #define MODEL_HAS_DCDC // We dont have DC/DC but have reallly fast PWM that gets us roughly the same place @@ -227,6 +229,8 @@ #define HAS_POWER_DEBUG_MENU #define TEMP_NTC #define I2C_SOFT_BUS_2 // For now we are doing software I2C to get around hardware chip issues +#define I2C_PROBE_POW_PD // For now we are doing software I2C to get around hardware chip issues +#define I2C_SOFT_BUS_1 // For now we are doing software I2C to get around hardware chip issues #define OLED_I2CBB2 #define MODEL_HAS_DCDC // We dont have DC/DC but have reallly fast PWM that gets us roughly the same place diff --git a/source/Core/BSP/Sequre/preRTOS.cpp b/source/Core/BSP/Sequre/preRTOS.cpp index 3a8fa4f4..411d53b2 100644 --- a/source/Core/BSP/Sequre/preRTOS.cpp +++ b/source/Core/BSP/Sequre/preRTOS.cpp @@ -6,10 +6,14 @@ */ #include "BSP.h" +#include "I2CBB1.hpp" #include "I2CBB2.hpp" #include "Pins.h" #include "Setup.h" #include +#if defined(I2C_PROBE_POW_PD) && POW_PD_EXT == 2 +#include "FS2711.hpp" +#endif void preRToSInit() { /* Reset of all peripherals, Initializes the Flash interface and the Systick. @@ -19,5 +23,11 @@ void preRToSInit() { BSPInit(); #ifdef I2C_SOFT_BUS_2 I2CBB2::init(); -#endif +#if defined(I2C_PROBE_POW_PD) && POW_PD_EXT == 2 + // Detect FS2711 I2C bus num + if (FS2711::detect_i2c_bus_num() == 1) { + I2CBB1::init(); + } +#endif /* defined(I2C_PROBE_POW_PD) && POW_PD_EXT == 2 */ +#endif /* I2C_SOFT_BUS_2 */ } diff --git a/source/Core/Drivers/FS2711.cpp b/source/Core/Drivers/FS2711.cpp index d80a1623..246c0597 100644 --- a/source/Core/Drivers/FS2711.cpp +++ b/source/Core/Drivers/FS2711.cpp @@ -1,5 +1,6 @@ #include "FS2711.hpp" #include "FS2711_defines.h" +#include "I2CBB1.hpp" #include "I2CBB2.hpp" #include "Settings.h" #include "Utils.h" @@ -17,17 +18,44 @@ extern int32_t powerSupplyWattageLimit; +uint8_t I2C_PORT = 2; fs2711_state_t FS2711::state; -inline void i2c_write(uint8_t addr, uint8_t data) { I2CBB2::Mem_Write(FS2711_ADDR, addr, &data, 1); } +void i2c_write(uint8_t addr, uint8_t data) { + if (I2C_PORT == 2) { + I2CBB2::Mem_Write(FS2711_ADDR, addr, &data, 1); + } else if (I2C_PORT == 1) { + I2CBB1::Mem_Write(FS2711_ADDR, addr, &data, 1); + } +} -inline uint8_t i2c_read(uint8_t addr) { +uint8_t i2c_read(uint8_t addr) { uint8_t data = 0; - I2CBB2::Mem_Read(FS2711_ADDR, addr, &data, 1); + if (I2C_PORT == 2) { + I2CBB2::Mem_Read(FS2711_ADDR, addr, &data, 1); + } else if (I2C_PORT == 1) { + I2CBB1::Mem_Read(FS2711_ADDR, addr, &data, 1); + } return data; } -inline bool i2c_probe(uint8_t addr) { return I2CBB2::probe(addr); } +bool i2c_probe(uint8_t addr) { + if (I2C_PORT == 2) { + I2CBB2::probe(addr); + } else if (I2C_PORT == 1) { + I2CBB1::probe(addr); + } + return false; + } + +uint8_t FS2711::detect_i2c_bus_num() { + if (I2CBB2::probe(FS2711_ADDR)) { + I2C_PORT = 2; + } else { + I2C_PORT = 1; + } + return I2C_PORT; +} void FS2711::start() { memset(&state, 0, sizeof(fs2711_state_t)); diff --git a/source/Core/Drivers/FS2711.hpp b/source/Core/Drivers/FS2711.hpp index 9fb2ae83..11a6943d 100644 --- a/source/Core/Drivers/FS2711.hpp +++ b/source/Core/Drivers/FS2711.hpp @@ -19,6 +19,8 @@ typedef struct { class FS2711 { public: + static uint8_t detect_i2c_bus_num(); + static bool probe(); static void start(); From 51e08f3992eec00bd07757206d37dbe9f8d88821 Mon Sep 17 00:00:00 2001 From: jonasius Date: Tue, 25 Jun 2024 19:13:30 +0200 Subject: [PATCH 19/31] Fix clang-format issues --- source/Core/BSP/Sequre/BSP.cpp | 4 +--- source/Core/Drivers/FS2711.cpp | 9 +++++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/source/Core/BSP/Sequre/BSP.cpp b/source/Core/BSP/Sequre/BSP.cpp index c1c02e48..c54a6678 100644 --- a/source/Core/BSP/Sequre/BSP.cpp +++ b/source/Core/BSP/Sequre/BSP.cpp @@ -121,9 +121,7 @@ void HAL_TIM_PWM_PulseFinishedCallback(TIM_HandleTypeDef *htim) { } } -void unstick_I2C() { - -} +void unstick_I2C() {} uint8_t getButtonA() { return HAL_GPIO_ReadPin(KEY_A_GPIO_Port, KEY_A_Pin) == GPIO_PIN_RESET ? 1 : 0; } uint8_t getButtonB() { return HAL_GPIO_ReadPin(KEY_B_GPIO_Port, KEY_B_Pin) == GPIO_PIN_RESET ? 1 : 0; } diff --git a/source/Core/Drivers/FS2711.cpp b/source/Core/Drivers/FS2711.cpp index 246c0597..8332e465 100644 --- a/source/Core/Drivers/FS2711.cpp +++ b/source/Core/Drivers/FS2711.cpp @@ -19,9 +19,10 @@ extern int32_t powerSupplyWattageLimit; uint8_t I2C_PORT = 2; + fs2711_state_t FS2711::state; -void i2c_write(uint8_t addr, uint8_t data) { +void i2c_write(uint8_t addr, uint8_t data) { if (I2C_PORT == 2) { I2CBB2::Mem_Write(FS2711_ADDR, addr, &data, 1); } else if (I2C_PORT == 1) { @@ -39,14 +40,14 @@ uint8_t i2c_read(uint8_t addr) { return data; } -bool i2c_probe(uint8_t addr) { +bool i2c_probe(uint8_t addr) { if (I2C_PORT == 2) { - I2CBB2::probe(addr); + I2CBB2::probe(addr); } else if (I2C_PORT == 1) { I2CBB1::probe(addr); } return false; - } +} uint8_t FS2711::detect_i2c_bus_num() { if (I2CBB2::probe(FS2711_ADDR)) { From 0d74f773b2cea3fee49ae3f4399af3501a220a36 Mon Sep 17 00:00:00 2001 From: jonasius Date: Tue, 25 Jun 2024 23:40:17 +0200 Subject: [PATCH 20/31] Code cleanup, always init both I2C bus --- source/Core/BSP/Sequre/preRTOS.cpp | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/source/Core/BSP/Sequre/preRTOS.cpp b/source/Core/BSP/Sequre/preRTOS.cpp index 411d53b2..8e61367e 100644 --- a/source/Core/BSP/Sequre/preRTOS.cpp +++ b/source/Core/BSP/Sequre/preRTOS.cpp @@ -21,13 +21,14 @@ void preRToSInit() { HAL_Init(); Setup_HAL(); // Setup all the HAL objects BSPInit(); +#ifdef I2C_SOFT_BUS_1 + I2CBB1::init(); +#endif /* I2C_SOFT_BUS_1 */ #ifdef I2C_SOFT_BUS_2 I2CBB2::init(); -#if defined(I2C_PROBE_POW_PD) && POW_PD_EXT == 2 - // Detect FS2711 I2C bus num - if (FS2711::detect_i2c_bus_num() == 1) { - I2CBB1::init(); - } -#endif /* defined(I2C_PROBE_POW_PD) && POW_PD_EXT == 2 */ #endif /* I2C_SOFT_BUS_2 */ -} +#if defined(I2C_PROBE_POW_PD) && POW_PD_EXT == 2 + // Detect and set FS2711 I2C bus num + FS2711::detect_i2c_bus_num(); +#endif /* defined(I2C_PROBE_POW_PD) && POW_PD_EXT == 2 */ +} \ No newline at end of file From 56b91ac13c9abddb1bec3939d476461ae82e5afd Mon Sep 17 00:00:00 2001 From: jonasius Date: Tue, 25 Jun 2024 23:53:07 +0200 Subject: [PATCH 21/31] Add missing __HAL_RCC_GPIOB_CLK_ENABLE --- source/Core/Drivers/I2CBB2.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/source/Core/Drivers/I2CBB2.cpp b/source/Core/Drivers/I2CBB2.cpp index fee68bd1..adf9c94f 100644 --- a/source/Core/Drivers/I2CBB2.cpp +++ b/source/Core/Drivers/I2CBB2.cpp @@ -14,6 +14,7 @@ void I2CBB2::init() { // Set GPIO's to output open drain GPIO_InitTypeDef GPIO_InitStruct; __HAL_RCC_GPIOA_CLK_ENABLE(); + __HAL_RCC_GPIOB_CLK_ENABLE(); GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_MEDIUM; GPIO_InitStruct.Pin = SDA2_Pin; GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_OD; From e6a3f380e10ca21331698b54821f915032ceeed7 Mon Sep 17 00:00:00 2001 From: jonasius Date: Wed, 26 Jun 2024 00:13:23 +0200 Subject: [PATCH 22/31] 4x faster PWM, add Timer changes from #1926 --- source/Core/BSP/Sequre/BSP.cpp | 2 +- source/Core/BSP/Sequre/Setup.cpp | 15 ++++++--------- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/source/Core/BSP/Sequre/BSP.cpp b/source/Core/BSP/Sequre/BSP.cpp index c54a6678..47fbeb1b 100644 --- a/source/Core/BSP/Sequre/BSP.cpp +++ b/source/Core/BSP/Sequre/BSP.cpp @@ -105,7 +105,7 @@ void HAL_TIM_PeriodElapsedCallback(TIM_HandleTypeDef *htim) { if (PWMSafetyTimer == 0) { htim4.Instance->CCR3 = 0; } else { - htim4.Instance->CCR3 = pendingPWM; + htim4.Instance->CCR3 = pendingPWM / 4; } } else if (htim->Instance == TIM1) { // STM uses this for internal functions as a counter for timeouts diff --git a/source/Core/BSP/Sequre/Setup.cpp b/source/Core/BSP/Sequre/Setup.cpp index 87a383f1..a5d5845e 100644 --- a/source/Core/BSP/Sequre/Setup.cpp +++ b/source/Core/BSP/Sequre/Setup.cpp @@ -57,7 +57,7 @@ void Setup_HAL() { GPIO_InitStruct.Pin = MOVEMENT_Pin; GPIO_InitStruct.Mode = GPIO_MODE_INPUT; GPIO_InitStruct.Pull = GPIO_PULLDOWN; - GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH; // We would like sharp rising edges + GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW; HAL_GPIO_Init(MOVEMENT_GPIO_Port, &GPIO_InitStruct); } } @@ -254,23 +254,20 @@ static void MX_IWDG_Init(void) { static void MX_TIM4_Init(void) { /* - * We use the channel 1 to trigger the ADC at end of PWM period - * And we use the channel 4 as the PWM modulation source using Interrupts + * On Sequre devies we run the output PWM as fast as possible due to the low tip resistance + no inductor for filtering. + * So we run it as fast as we can and hope that the caps filter out the current spikes. * */ TIM_ClockConfigTypeDef sClockSourceConfig; TIM_MasterConfigTypeDef sMasterConfig; TIM_OC_InitTypeDef sConfigOC; memset(&sConfigOC, 0, sizeof(sConfigOC)); - // Timer 2 is fairly slow as its being used to run the PWM and trigger the ADC - // in the PWM off time. + htim4.Instance = TIM4; // dummy value, will be reconfigured by BSPInit() - htim4.Init.Prescaler = 10; // 2 MHz timer clock/1000 = 2 kHz tick rate + htim4.Init.Prescaler = 10; // 2 MHz timer clock/10 = 200 kHz tick rate - // pwm out is 10k from tim3, we want to run our PWM at around 10hz or slower on the output stage - // These values give a rate of around 3.5 Hz for "fast" mode and 1.84 Hz for "slow" htim4.Init.CounterMode = TIM_COUNTERMODE_UP; - htim4.Init.Period = 255; + htim4.Init.Period = 64; htim4.Init.ClockDivision = TIM_CLOCKDIVISION_DIV1; // 8 MHz (x2 APB1) before divide htim4.Init.AutoReloadPreload = TIM_AUTORELOAD_PRELOAD_DISABLE; From 69493ba212506eff1cb9261d8dccf6f21aec1ee8 Mon Sep 17 00:00:00 2001 From: jonasius Date: Thu, 27 Jun 2024 19:07:39 +0200 Subject: [PATCH 23/31] Add missing braces --- source/Core/Src/settingsGUI.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/Core/Src/settingsGUI.cpp b/source/Core/Src/settingsGUI.cpp index 13eb559a..7139a5a4 100644 --- a/source/Core/Src/settingsGUI.cpp +++ b/source/Core/Src/settingsGUI.cpp @@ -24,7 +24,7 @@ static void displayInputMinVRange(void); static void displayQCInputV(void); #endif /* POW_QC */ -#if defined POW_PD || POW_PD_EXT == 2 +#if defined(POW_PD) || POW_PD_EXT == 2 static void displayPDNegTimeout(void); static void displayUSBPDMode(void); #endif /* POW_PD */ From 6ad0b65bff20eadcc510c43900440025121ed06c Mon Sep 17 00:00:00 2001 From: jonasius Date: Thu, 27 Jun 2024 19:08:26 +0200 Subject: [PATCH 24/31] Correct README to Sequre S60, S60P and S99 --- source/Core/BSP/Sequre/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/Core/BSP/Sequre/README.md b/source/Core/BSP/Sequre/README.md index bb9de245..41604352 100644 --- a/source/Core/BSP/Sequre/README.md +++ b/source/Core/BSP/Sequre/README.md @@ -1,6 +1,6 @@ -# BSP section for STM32F103 based Miniware products +# BSP section for STM32F103 based Sequre products -This folder contains the hardware abstractions required for the TS100, TS80 and probably TS80P soldering irons. +This folder contains the hardware abstractions required for the S60, S60P and S99 soldering irons. ## Main abstractions From 4634fa8ba7a7e830148c3c964285c3f50034cce0 Mon Sep 17 00:00:00 2001 From: jonasius Date: Fri, 28 Jun 2024 17:47:59 +0200 Subject: [PATCH 25/31] Fix showing displayPowerMenu for POW_PD and POW_PD_EXT 2 --- source/Core/Src/settingsGUI.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/Core/Src/settingsGUI.cpp b/source/Core/Src/settingsGUI.cpp index 7139a5a4..7ff02179 100644 --- a/source/Core/Src/settingsGUI.cpp +++ b/source/Core/Src/settingsGUI.cpp @@ -114,9 +114,9 @@ static bool showHallEffect(void); // Menu functions -#if defined(POW_DC) || defined(POW_QC) +#if defined(POW_DC) || defined(POW_QC) || defined(POW_PD) || POW_PD_EXT == 2 static void displayPowerMenu(void); -#endif /* POW_DC or POW_QC */ +#endif /* POW_DC or POW_QC or POW_PD or POD_PD_EXT 2*/ static void displaySolderingMenu(void); static void displayPowerSavingMenu(void); From f21630eb79768a43fb73a5259e548031380ad1cd Mon Sep 17 00:00:00 2001 From: jonasius Date: Fri, 28 Jun 2024 17:54:43 +0200 Subject: [PATCH 26/31] Enable/add DC support for S60P --- README.md | 2 +- source/Core/BSP/Sequre/configuration.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 76feba04..8d4877ae 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ _This firmware does **NOT** support the USB port while running for changing sett | Pinecil V2 | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ | | | Miniware TS101 | ✔️ | ❌ | ✔️ | ✔️ | ❌ | ✔️ | ✔️ | Full OLED resolution not yet supported. | | Sequre S60 | ❌ | ❌ | ✔️ | ❌ | ❌ | ❌ | ✔️ | Full OLED resolution not yet supported. | -| Sequre S60P | ❌ | ❌ | ✔️ | ❌ | ❌ | ❌ | ✔️ | Full OLED resolution not yet supported. | +| Sequre S60P | ✔️ | ❌ | ✔️ | ❌ | ❌ | ❌ | ✔️ | Full OLED resolution not yet supported. | | Sequre S99 | ✔️ | ❌ | ✔️ | ❌ | ❌ | ❌ | ✔️ | Full OLED resolution not yet supported. | | Miniware TS80P | ❌ | ✔️ | ✔️ | ❌ | ❌ | N/A | ✔️ | | | Miniware TS100 | ✔️ | ❌ | ❌ | ❌ | ❌ | ❌ | ❌\*\* | | diff --git a/source/Core/BSP/Sequre/configuration.h b/source/Core/BSP/Sequre/configuration.h index 78da9d8a..2468cefc 100644 --- a/source/Core/BSP/Sequre/configuration.h +++ b/source/Core/BSP/Sequre/configuration.h @@ -190,6 +190,7 @@ #define GPIO_VIBRATION #define POW_PD_EXT 2 #define USB_PD_EPR_WATTAGE 0 /*No EPR*/ +#define POW_DC #define DEBUG_POWER_MENU_BUTTON_B 1 #define HAS_POWER_DEBUG_MENU #define TEMP_NTC From e79687e1e845adb13405a3df3839730de3461fbe Mon Sep 17 00:00:00 2001 From: jonasius Date: Mon, 5 Aug 2024 21:59:51 +0200 Subject: [PATCH 27/31] Set equal USB_PD_TIMEOUT for all Sequre irons --- source/Core/BSP/Sequre/configuration.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/Core/BSP/Sequre/configuration.h b/source/Core/BSP/Sequre/configuration.h index 2468cefc..bdd23788 100644 --- a/source/Core/BSP/Sequre/configuration.h +++ b/source/Core/BSP/Sequre/configuration.h @@ -212,7 +212,7 @@ #define OP_AMP_GAIN_STAGE 237 // Two sequential op-amps 1st: 1+(9k29/997R)=10.31 2nd: 1+(22k/1k)=23 -> 10.31*23=237 #define TEMP_uV_LOOKUP_S99 #define USB_PD_VMAX 20 // Maximum voltage for PD to negotiate -#define USB_PD_TIMEOUT 2 // Default Timeout for USB-PD Protocol negotiation in x100ms +#define USB_PD_TIMEOUT 1 // Default Timeout for USB-PD Protocol negotiation in x100ms #define HARDWARE_MAX_WATTAGE_X10 1300 From a2734eed9e47eb65382b0b492ab8d40fee59b1c6 Mon Sep 17 00:00:00 2001 From: jonasius Date: Mon, 5 Aug 2024 22:02:15 +0200 Subject: [PATCH 28/31] Fix i2c_probe function --- source/Core/Drivers/FS2711.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/source/Core/Drivers/FS2711.cpp b/source/Core/Drivers/FS2711.cpp index 8332e465..ba06a6d5 100644 --- a/source/Core/Drivers/FS2711.cpp +++ b/source/Core/Drivers/FS2711.cpp @@ -41,12 +41,13 @@ uint8_t i2c_read(uint8_t addr) { } bool i2c_probe(uint8_t addr) { + bool probing_state = false; if (I2C_PORT == 2) { - I2CBB2::probe(addr); + probing_state = I2CBB2::probe(addr); } else if (I2C_PORT == 1) { - I2CBB1::probe(addr); + probing_state = I2CBB1::probe(addr); } - return false; + return probing_state; } uint8_t FS2711::detect_i2c_bus_num() { From e667189f458d634e804ec35a6c402cf928007080 Mon Sep 17 00:00:00 2001 From: jonasius Date: Wed, 7 Aug 2024 20:39:51 +0200 Subject: [PATCH 29/31] Add MODEL_S99 --- source/Core/Drivers/Font.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/source/Core/Drivers/Font.h b/source/Core/Drivers/Font.h index 0d0943ff..6eb50444 100644 --- a/source/Core/Drivers/Font.h +++ b/source/Core/Drivers/Font.h @@ -93,8 +93,8 @@ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0x30, 0x0C, 0x02, 0xF1, 0xF1, 0xF1, 0x02, 0x0C, 0x30, 0xC0, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xC0, 0xB0, 0x8C, 0x83, 0x80, 0x80, 0x80, 0x80, 0xB3, 0xB3, 0xB3, 0x80, 0x80, 0x80, 0x80, 0x83, 0x8C, 0xB0, 0xC0, 0x00, 0x00}; - #if defined(MODEL_S60) || defined(MODEL_S60P) || defined(MODEL_TS101) || defined(MODEL_T55) - #if defined(MODEL_S60) || defined(MODEL_S60P) + #if defined(MODEL_S60) || defined(MODEL_S60P) || defined(MODEL_TS101) || defined(MODEL_T55) || defined(MODEL_S99) + #if defined(MODEL_S60) || defined(MODEL_S60P) || defined(MODEL_S99) const uint8_t buttonA[] = { // width = 56 // height = 32 From 4b340c52bcf0996237f5db92e251c51fbc333791 Mon Sep 17 00:00:00 2001 From: jonasius Date: Wed, 7 Aug 2024 20:40:16 +0200 Subject: [PATCH 30/31] Add THERMAL_RUNAWAY config values for S99 --- source/Core/BSP/Sequre/configuration.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/Core/BSP/Sequre/configuration.h b/source/Core/BSP/Sequre/configuration.h index 0504ada3..bbf715fc 100644 --- a/source/Core/BSP/Sequre/configuration.h +++ b/source/Core/BSP/Sequre/configuration.h @@ -263,6 +263,8 @@ #define TIP_THERMAL_MASS 8 // X10 watts to raise 1 deg C in 1 second #define TIP_THERMAL_INERTIA 128 // We use a large inertia value to smooth out the drive to the tip since its stupidly sensitive +#define THERMAL_RUNAWAY_TIME_SEC 20 +#define THERMAL_RUNAWAY_TEMP_C 10 #define TIP_RESISTANCE 20 //(actually 2.5 ish but we need to be more conservative on pwm'ing watt limit) x10 ohms From 02580dab2eec197c75fc4497fdc2f7c44abf5c5d Mon Sep 17 00:00:00 2001 From: jonasius Date: Fri, 6 Dec 2024 23:51:36 +0100 Subject: [PATCH 31/31] Add probing for unused devices for testing/timing --- source/Core/Drivers/FS2711.cpp | 2 ++ 1 file changed, 2 insertions(+) diff --git a/source/Core/Drivers/FS2711.cpp b/source/Core/Drivers/FS2711.cpp index 05731c54..ebad9904 100644 --- a/source/Core/Drivers/FS2711.cpp +++ b/source/Core/Drivers/FS2711.cpp @@ -52,6 +52,8 @@ bool i2c_probe(uint8_t addr) { } uint8_t FS2711::detect_i2c_bus_num() { + I2CBB2::probe(88); + I2CBB2::probe(89); if (I2CBB2::probe(FS2711_ADDR)) { I2C_PORT = 2; } else {