Skip to content

Commit 4ebc2e1

Browse files
committed
adc1_0__bugfix
1 parent 0592ae4 commit 4ebc2e1

5 files changed

Lines changed: 257 additions & 240 deletions

File tree

include/config.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,12 @@ struct Config {
1818
uint8_t scrollgap = 5;
1919
uint16_t idle = 30;
2020
uint8_t tmode = 1;
21-
uint16_t bat0 = 3095;
21+
uint16_t bat0 = 4094;
2222
uint16_t bat100 = 4095;
23-
uint8_t lowbatt = 1;
23+
uint8_t lowbatt = 0;
2424
uint8_t critbatt = 10;
2525
uint16_t batw = 1000;
26+
bool batenabled = false;
2627
uint8_t sdclock = 1;
2728
uint8_t calendar = 0;
2829
uint8_t bclkpin = 255;

include/loadConfig.h

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,12 +33,13 @@ bool loadConfiguration(Config *config)
3333
RESERVEDGPIOS[resix++] = 17;
3434
#endif
3535
#if defined(DISP)
36-
RESERVEDGPIOS[resix++] = 18;
37-
RESERVEDGPIOS[resix++] = 23;
3836
RESERVEDGPIOS[resix++] = 18;
3937
RESERVEDGPIOS[resix++] = 21;
4038
RESERVEDGPIOS[resix++] = 22;
4139
RESERVEDGPIOS[resix++] = 23;
40+
#endif
41+
#if defined(BATTERY)
42+
RESERVEDGPIOS[resix++] = 36;
4243
#endif
4344
// ToDo for other display versions ?
4445
File configFile = LittleFS.open("/config.json", "r");
@@ -103,6 +104,7 @@ bool loadConfiguration(Config *config)
103104
config->batw = config->bat100 - config->bat0;
104105
config->lowbatt = general["lowbatt"];
105106
config->critbatt = general["critbatt"];
107+
config->batenabled = ((config->bat100 <= 4095) && (config->bat0 < (config->bat100-1)));
106108
#endif
107109
if (hardware["encclkpin"].is<uint8_t>())
108110
{

include/wsResponses.h

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -350,12 +350,16 @@ void sendWebConfig(AsyncWebSocketClient *cl)
350350
ircommands.add(cmdbuffer);
351351
}
352352
JsonArray reservedgpios = root["reservedgpios"].to<JsonArray>();
353-
for (int i = 0; i < 8; i++)
353+
for (int i = 0; i < 16; i++)
354354
{
355355
if (RESERVEDGPIOS[i] > 0)
356356
{
357357
reservedgpios.add(RESERVEDGPIOS[i]);
358358
}
359+
else
360+
{
361+
break;
362+
}
359363
}
360364
size_t len = 0;
361365
len = measureJson(root);

platformio.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ lib_deps =
3636
extra_scripts =
3737
scripts/custom_targets.py
3838
build_flags =
39-
-D VERSION=1.0.0
39+
-D VERSION=1.0.1
4040
-D BOARD_HAS_PSRAM
4141
; -mfix-esp32-psram-cache-issue ;(not needed for rev.3 chips)
4242
-D CORE_DEBUG_LEVEL=2

0 commit comments

Comments
 (0)