IF482 minor fixes

This commit is contained in:
Klaus K Wilting 2019-01-27 21:02:37 +01:00
parent ddc7abe90d
commit e6aba4fe63
2 changed files with 5 additions and 4 deletions

View File

@ -130,7 +130,7 @@ void if482_loop(void *pvParameters) {
tt = now();
} while (t == tt);
const TickType_t startTime = xTaskGetTickCount();
const TickType_t startOffset = xTaskGetTickCount();
// task remains in blocked state until it is notified by isr
for (;;) {
@ -141,7 +141,7 @@ void if482_loop(void *pvParameters) {
portMAX_DELAY); // wait forever (missing error handling here...)
t = now();
wakeTime -= startTime;
wakeTime -= startOffset;
// now we're synced to start of second t and wait
// until it's time to start transmit telegram for t+1

View File

@ -414,6 +414,7 @@ void setup() {
// start RTC interrupt
#if defined HAS_IF482 && defined HAS_RTC
// setup external interupt for active low RTC INT pin
if (IF482IRQ != NULL) // has if482loop task started?
attachInterrupt(digitalPinToInterrupt(RTC_INT), IF482IRQ, FALLING);
#endif