sent: assert so that unit tests fail nicely

This commit is contained in:
rusefillc 2024-12-05 20:05:57 -05:00
parent bee09dddb1
commit bbabc1335b
1 changed files with 1 additions and 0 deletions

View File

@ -107,6 +107,7 @@ int sent_channel::Decoder(uint16_t clocks) {
} else { } else {
/* some tickPerUnit calculated... /* some tickPerUnit calculated...
* Check next 1 + 6 + 1 pulses if they are valid with current tickPerUnit */ * Check next 1 + 6 + 1 pulses if they are valid with current tickPerUnit */
criticalAssert(tickPerUnit != 0, "zero tickPerUnit", 0);
interval = (clocks + tickPerUnit / 2) / tickPerUnit - SENT_OFFSET_INTERVAL; interval = (clocks + tickPerUnit / 2) / tickPerUnit - SENT_OFFSET_INTERVAL;
if ((interval >= 0) && (interval <= SENT_MAX_INTERVAL)) { if ((interval >= 0) && (interval <= SENT_MAX_INTERVAL)) {
currentStatePulseCounter++; currentStatePulseCounter++;