Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 307853bea8 |
+2
-2
@@ -126,9 +126,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.20.R-S3") and we can visually confirm
|
// web UI shows a distinct version (e.g. "4=1.19.R-S1") 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-S3)
|
#define VERSTR STRINGIFY(4=VER-S1)
|
||||||
|
|
||||||
/***** enums ******/
|
/***** enums ******/
|
||||||
|
|
||||||
|
|||||||
+2
-8
@@ -85,15 +85,9 @@ bool CheckTimeout()
|
|||||||
bool CheckDelay()
|
bool CheckDelay()
|
||||||
{
|
{
|
||||||
uint32_t now = rtc_get_counter_val();
|
uint32_t now = rtc_get_counter_val();
|
||||||
// Upstream uses uint32_t here, which wraps a negative timedly (the param's
|
uint32_t start = Param::GetInt(Param::timedly) * 60;
|
||||||
// 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) > (uint32_t)start;
|
return start <= 0 || (now - startTime) > start;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user