fix: added `nodemcu_32_160mhz` env, deadband usage in PID fixed (#176)

* Small fixes: CPU limit for odemcu_32,  deadbamd usage in PID

* PR review fixes

* Fix: remove spaces

---------

Co-authored-by: Edward Zhuravlov <Edward.Zhuravlev@topsoft.by>
This commit is contained in:
zedward
2025-09-19 21:00:11 +03:00
committed by GitHub
parent 9217bb7448
commit c2ee30d1ab
2 changed files with 6 additions and 1 deletions

View File

@@ -294,6 +294,10 @@ build_flags =
check_tool = ${esp32_defaults.check_tool} check_tool = ${esp32_defaults.check_tool}
check_flags = ${esp32_defaults.check_flags} check_flags = ${esp32_defaults.check_flags}
[env:nodemcu_32_160mhz]
extends = env:nodemcu_32
board_build.f_cpu = 160000000L ; set frequency to 160MHz
[env:d1_mini32] [env:d1_mini32]
platform = ${esp32_defaults.platform} platform = ${esp32_defaults.platform}
platform_packages = ${esp32_defaults.platform_packages} platform_packages = ${esp32_defaults.platform_packages}

View File

@@ -213,7 +213,8 @@ protected:
}*/ }*/
float error = pidRegulator.setpoint - pidRegulator.input; float error = pidRegulator.setpoint - pidRegulator.input;
bool hasDeadband = (error > -(settings.pid.deadband.thresholdHigh)) bool hasDeadband = settings.pid.deadband.enabled
&& (error > -(settings.pid.deadband.thresholdHigh))
&& (error < settings.pid.deadband.thresholdLow); && (error < settings.pid.deadband.thresholdLow);
if (hasDeadband) { if (hasDeadband) {