From b9a0b9db84ea69ac04187802b42c6997be3b584e Mon Sep 17 00:00:00 2001 From: Leonid Meleshin Date: Sun, 11 Aug 2024 00:05:02 +0400 Subject: [PATCH 1/2] feat(ESP32): upgrade toolchain Close #136 --- arch/esp32/esp32.ini | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/arch/esp32/esp32.ini b/arch/esp32/esp32.ini index 043629ea..4e60accd 100644 --- a/arch/esp32/esp32.ini +++ b/arch/esp32/esp32.ini @@ -1,10 +1,10 @@ [arch:esp32] platform = platformio/espressif32@^6.8.1 platform_packages = - toolchain-xtensa-esp32@12.2.0+20230208 - espressif/tool-xtensa-esp-elf-gdb@12.1.0+20221002 - framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#3.0.3 - framework-arduinoespressif32-libs @ https://github.com/espressif/arduino-esp32/releases/download/3.0.3/esp32-arduino-libs-3.0.3.zip + platformio/toolchain-xtensa-esp-elf@13.2.0+20240530 + platformio/tool-xtensa-esp-elf-gdb@14.2.0+20240403 + framework-arduinoespressif32 @ https://github.com/espressif/arduino-esp32.git#3.0.4 + framework-arduinoespressif32-libs @ https://github.com/espressif/arduino-esp32/releases/download/3.0.4/esp32-arduino-libs-3.0.4.zip build_flags = -D SS_USE_NIMBLE=true From 8c59ddc5c573ef93f4a308fd07dbf3d6050428a0 Mon Sep 17 00:00:00 2001 From: Leonid Meleshin Date: Sun, 11 Aug 2024 20:05:06 +0400 Subject: [PATCH 2/2] refactor(Input): optimize voltage divider filter --- lib/io/senseshift/input/filter.hpp | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) diff --git a/lib/io/senseshift/input/filter.hpp b/lib/io/senseshift/input/filter.hpp index 847d8506..e0d6f226 100644 --- a/lib/io/senseshift/input/filter.hpp +++ b/lib/io/senseshift/input/filter.hpp @@ -145,21 +145,18 @@ class MultiplyFilter : public IFilter { Tp factor_; }; -class VoltageDividerFilter : public MultiplyFilter { - public: - /// Calculates the original voltage from the voltage divider. - /// - /// \param r1 The resistance in Ohms of the first resistor in the voltage divider. - /// Example: 27000.0F. - /// \param r2 The resistance in Ohms of the second resistor in the voltage divider. - /// Example: 100000.0F. - /// - /// \example - /// \code - /// new VoltageDividerFilter(27000.0F, 100000.0F); - /// \endcode - explicit VoltageDividerFilter(float r1, float r2) : MultiplyFilter((r1 + r2) / r2){}; -}; +/// Calculates the original voltage from the voltage divider. +/// +/// \param r1 The resistance in Ohms of the first resistor in the voltage divider. +/// Example: 27000.0F. +/// \param r2 The resistance in Ohms of the second resistor in the voltage divider. +/// Example: 100000.0F. +/// +/// \example +/// \code +/// new VoltageDividerFilter(27000.0F, 100000.0F); +/// \endcode +#define VoltageDividerFilter(r1, r2) MultiplyFilter((r1 + r2) / r2) template class ClampFilter : public IFilter {