mirror of
https://github.com/emsesp/EMS-ESP32.git
synced 2025-12-06 15:59:52 +03:00
SM200 energy to 32 bit, fixes #372
This commit is contained in:
Binary file not shown.
@@ -7,6 +7,12 @@ default_envs = release
|
||||
; default_envs = debug
|
||||
|
||||
[common]
|
||||
# From https://github.com/esp8266/Arduino/blob/master/tools/sdk/ld
|
||||
# eagle.flash.4m1m.ld = 1019 KB sketch, 1000 KB SPIFFS. 4KB EEPROM, 4KB RFCAL, 12KB WIFI stack, 2052 KB OTA & buffer
|
||||
# eagle.flash.4m2m.ld = same as above but with 2024 KB SPIFFS
|
||||
# eagle.flash.4m.ld = same as above but with no SPIFFS storage
|
||||
ldscript = eagle.flash.4m1m.ld
|
||||
|
||||
; custom build options are:
|
||||
; -DMYESP_TIMESTAMP
|
||||
; -DTESTS
|
||||
@@ -30,17 +36,12 @@ custom_flags =
|
||||
# general_flags = -DNO_GLOBAL_EEPROM -DVTABLES_IN_FLASH -DPIO_FRAMEWORK_ARDUINO_LWIP2_HIGHER_BANDWIDTH_LOW_FLASH
|
||||
general_flags = -DNO_GLOBAL_EEPROM
|
||||
|
||||
|
||||
# From https://github.com/esp8266/Arduino/blob/master/tools/sdk/ld
|
||||
# eagle.flash.4m1m.ld = 1019 KB sketch, 1000 KB SPIFFS. 4KB EEPROM, 4KB RFCAL, 12KB WIFI stack, 2052 KB OTA & buffer
|
||||
# eagle.flash.4m2m.ld = same as above but with 2024 KB SPIFFS
|
||||
# eagle.flash.4m.ld = same as above but with no SPIFFS storage
|
||||
board_build.ldscript = eagle.flash.4m.ld
|
||||
build_flags = ${common.general_flags} -std=c++11 -fno-exceptions
|
||||
|
||||
[env]
|
||||
framework = arduino
|
||||
platform = espressif8266
|
||||
board_build.ldscript = ${common.ldscript}
|
||||
lib_compat_mode = strict
|
||||
lib_deps =
|
||||
https://github.com/rlogiacco/CircularBuffer
|
||||
@@ -53,7 +54,7 @@ lib_deps =
|
||||
JustWifi@2.0.2 ; https://github.com/xoseperez/justwifi
|
||||
AsyncMqttClient@0.8.2 ; https://github.com/marvinroger/async-mqtt-client
|
||||
EEPROM_Rotate@0.9.2 ; https://github.com/xoseperez/eeprom_rotate
|
||||
https://github.com/bblanchon/ArduinoJson
|
||||
ArduinoJson
|
||||
ESPAsyncTCP@1.2.2 ; https://github.com/me-no-dev/ESPAsyncTCP
|
||||
upload_speed = 921600
|
||||
monitor_speed = 115200
|
||||
|
||||
@@ -455,6 +455,7 @@ bool _setValue(_EMS_RxTelegram * EMS_RxTelegram, uint32_t * param_op, uint8_t in
|
||||
*param_op = (uint32_t)((EMS_RxTelegram->data[pos] << 16) + (EMS_RxTelegram->data[pos + 1] << 8) + (EMS_RxTelegram->data[pos + 2]));
|
||||
return true;
|
||||
}
|
||||
|
||||
// Long 32 bit
|
||||
bool _setValue32(_EMS_RxTelegram * EMS_RxTelegram, uint32_t * param_op, uint8_t index) {
|
||||
int8_t pos = _getDataPosition(EMS_RxTelegram, index);
|
||||
@@ -462,7 +463,8 @@ bool _setValue32(_EMS_RxTelegram * EMS_RxTelegram, uint32_t * param_op, uint8_t
|
||||
return false;
|
||||
}
|
||||
|
||||
*param_op = (uint32_t)((EMS_RxTelegram->data[pos] << 24) +(EMS_RxTelegram->data[pos + 1] << 16) + (EMS_RxTelegram->data[pos + 2] << 8) + (EMS_RxTelegram->data[pos + 3]));
|
||||
*param_op = (uint32_t)((EMS_RxTelegram->data[pos] << 24) + (EMS_RxTelegram->data[pos + 1] << 16) + (EMS_RxTelegram->data[pos + 2] << 8)
|
||||
+ (EMS_RxTelegram->data[pos + 3]));
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
@@ -211,12 +211,12 @@ void _renderLongValue(const char * prefix, const char * postfix, uint32_t value,
|
||||
strlcat(buffer, "?", sizeof(buffer));
|
||||
} else {
|
||||
char s[20] = {0};
|
||||
if(div == 0) {
|
||||
if (div == 0) {
|
||||
strlcat(buffer, ltoa(value, s, 10), sizeof(buffer));
|
||||
} else {
|
||||
strlcat(buffer, ltoa(value/10, s, 10), sizeof(buffer));
|
||||
strlcat(buffer, ltoa(value / 10, s, 10), sizeof(buffer));
|
||||
strlcat(buffer, ".", sizeof(buffer));
|
||||
strlcat(buffer, ltoa(value%10, s, 10), sizeof(buffer));
|
||||
strlcat(buffer, ltoa(value % 10, s, 10), sizeof(buffer));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1 +1 @@
|
||||
#define APP_VERSION "1.9.5b60"
|
||||
#define APP_VERSION "1.9.5b61"
|
||||
|
||||
Reference in New Issue
Block a user