IF482 minor fixes
This commit is contained in:
parent
ddc7abe90d
commit
e6aba4fe63
@ -130,7 +130,7 @@ void if482_loop(void *pvParameters) {
|
|||||||
tt = now();
|
tt = now();
|
||||||
} while (t == tt);
|
} while (t == tt);
|
||||||
|
|
||||||
const TickType_t startTime = xTaskGetTickCount();
|
const TickType_t startOffset = xTaskGetTickCount();
|
||||||
|
|
||||||
// task remains in blocked state until it is notified by isr
|
// task remains in blocked state until it is notified by isr
|
||||||
for (;;) {
|
for (;;) {
|
||||||
@ -141,12 +141,12 @@ void if482_loop(void *pvParameters) {
|
|||||||
portMAX_DELAY); // wait forever (missing error handling here...)
|
portMAX_DELAY); // wait forever (missing error handling here...)
|
||||||
|
|
||||||
t = now();
|
t = now();
|
||||||
wakeTime -= startTime;
|
wakeTime -= startOffset;
|
||||||
|
|
||||||
// now we're synced to start of second t and wait
|
// now we're synced to start of second t and wait
|
||||||
// until it's time to start transmit telegram for t+1
|
// until it's time to start transmit telegram for t+1
|
||||||
vTaskDelayUntil(&wakeTime, shotTime);
|
vTaskDelayUntil(&wakeTime, shotTime);
|
||||||
IF482.print(if482Telegram(t + 1));
|
IF482.print(if482Telegram(t+1));
|
||||||
}
|
}
|
||||||
vTaskDelete(IF482Task); // shoud never be reached
|
vTaskDelete(IF482Task); // shoud never be reached
|
||||||
} // if482_loop()
|
} // if482_loop()
|
||||||
|
@ -414,7 +414,8 @@ void setup() {
|
|||||||
// start RTC interrupt
|
// start RTC interrupt
|
||||||
#if defined HAS_IF482 && defined HAS_RTC
|
#if defined HAS_IF482 && defined HAS_RTC
|
||||||
// setup external interupt for active low RTC INT pin
|
// setup external interupt for active low RTC INT pin
|
||||||
attachInterrupt(digitalPinToInterrupt(RTC_INT), IF482IRQ, FALLING);
|
if (IF482IRQ != NULL) // has if482loop task started?
|
||||||
|
attachInterrupt(digitalPinToInterrupt(RTC_INT), IF482IRQ, FALLING);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
} // setup()
|
} // setup()
|
||||||
|
Loading…
Reference in New Issue
Block a user