Allow negative values for AdcParam/AdcGpio INPUT, TEMP and RANGE parameters (#22809)

This commit is contained in:
Theo Arends 2025-01-14 10:44:33 +01:00
parent fc8485d91b
commit ddcdc85520
3 changed files with 14 additions and 12 deletions

View File

@ -13,6 +13,7 @@ All notable changes to this project will be documented in this file.
### Changed
- ESP32 Platform from 2024.12.30 to 2025.01.30, Framework (Arduino Core) from v3.1.0.241206 to v3.1.1.250109 and IDF to 5.3.2 (#22792)
- Allow negative values for AdcParam/AdcGpio INPUT, TEMP and RANGE parameters (#22809)
### Fixed

View File

@ -141,6 +141,7 @@ The latter links can be used for OTA upgrades too like ``OtaUrl https://ota.tasm
- ESP32 Platform from 2024.12.30 to 2025.01.30, Framework (Arduino Core) from v3.1.0.241206 to v3.1.1.250109 and IDF to 5.3.2 [#22792](https://github.com/arendst/Tasmota/issues/22792)
- GPIOViewer from v1.5.6 to v1.5.9 (No functional change)
- Postpone save_data during light animation when fade is Off
- Allow negative values for AdcParam/AdcGpio INPUT, TEMP and RANGE parameters [#22809](https://github.com/arendst/Tasmota/issues/22809)
- Command `Pixels` has backwards compatible arguments fixing #22755 [#22791](https://github.com/arendst/Tasmota/issues/22791)
- ESP32 disable PSRAM check (and on restart some relay toggles) with `#define DISABLE_PSRAMCHECK true` [#21266](https://github.com/arendst/Tasmota/issues/21266)
- Berry bit-shift operators to `int64` [#22709](https://github.com/arendst/Tasmota/issues/22709)

View File

@ -1055,8 +1055,8 @@ void CmndAdcParam(void) {
if ((GPIO_ADC_INPUT == adc_type) ||
(GPIO_ADC_TEMP == adc_type) ||
(GPIO_ADC_RANGE == adc_type)) {
Adc[channel].param[2] = abs(strtol(ArgV(argument, 4), nullptr, 10)); // param3 = abs(int)
Adc[channel].param[3] = abs(strtol(ArgV(argument, 5), nullptr, 10)); // param4 = abs(int)
Adc[channel].param[2] = strtol(ArgV(argument, 4), nullptr, 10); // param3 = int
Adc[channel].param[3] = strtol(ArgV(argument, 5), nullptr, 10); // param4 = int
} else {
Adc[channel].param[2] = (int)(CharToFloat(ArgV(argument, 4)) * 10000); // param3 = float
if (ArgC() > 4) {