Compare commits
2 Commits
f566427835
...
fb721f7392
| Author | SHA1 | Date | |
|---|---|---|---|
| fb721f7392 | |||
| 5dc715558f |
+2
-2
@@ -125,9 +125,9 @@
|
|||||||
#define CAT_COMM "Communication"
|
#define CAT_COMM "Communication"
|
||||||
|
|
||||||
// SKUDAK customization suffix: bump on every Skudak-side change so the OpenInverter
|
// SKUDAK customization suffix: bump on every Skudak-side change so the OpenInverter
|
||||||
// web UI shows a distinct version (e.g. "4=1.19.R-S1") and we can visually confirm
|
// web UI shows a distinct version (e.g. "4=1.19.R-S2") and we can visually confirm
|
||||||
// the right firmware is flashed. Match the stm32-sine -S<N> convention.
|
// the right firmware is flashed. Match the stm32-sine -S<N> convention.
|
||||||
#define VERSTR STRINGIFY(4=VER-S1)
|
#define VERSTR STRINGIFY(4=VER-S2)
|
||||||
|
|
||||||
/***** enums ******/
|
/***** enums ******/
|
||||||
|
|
||||||
|
|||||||
+8
-2
@@ -85,9 +85,15 @@ bool CheckTimeout()
|
|||||||
bool CheckDelay()
|
bool CheckDelay()
|
||||||
{
|
{
|
||||||
uint32_t now = rtc_get_counter_val();
|
uint32_t now = rtc_get_counter_val();
|
||||||
uint32_t start = Param::GetInt(Param::timedly) * 60;
|
// Upstream uses uint32_t here, which wraps a negative timedly (the param's
|
||||||
|
// documented -1 "no delay" sentinel) into a ~4 billion-second timeout that
|
||||||
|
// never expires — leaving the state machine wedged in WaitStart forever.
|
||||||
|
// Use signed math for the short-circuit so timedly <= 0 still means
|
||||||
|
// "start immediately." The cast on the elapsed-comparison side is only
|
||||||
|
// reached when start > 0, so it can't reinterpret a negative as huge.
|
||||||
|
int start = Param::GetInt(Param::timedly) * 60;
|
||||||
|
|
||||||
return start <= 0 || (now - startTime) > start;
|
return start <= 0 || (now - startTime) > (uint32_t)start;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user