Skip to content

Commit

Permalink
Merge pull request #138 from senseshift/feature/platform-toolchain-up…
Browse files Browse the repository at this point in the history
…grade

feat(ESP32): upgrade toolchain
  • Loading branch information
leon0399 authored Aug 11, 2024
2 parents 0018cd3 + 8c59ddc commit 1c6b8f5
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 19 deletions.
8 changes: 4 additions & 4 deletions arch/esp32/esp32.ini
Original file line number Diff line number Diff line change
@@ -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
Expand Down
27 changes: 12 additions & 15 deletions lib/io/senseshift/input/filter.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,21 +145,18 @@ class MultiplyFilter : public IFilter<Tp> {
Tp factor_;
};

class VoltageDividerFilter : public MultiplyFilter<float> {
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<float>((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<typename Tp>
class ClampFilter : public IFilter<Tp> {
Expand Down

0 comments on commit 1c6b8f5

Please sign in to comment.