This week I updated my OS from 1.2.1 to 1.5.2 and suddenly my processor crashed from time to time.
After investigation it seemed to be in an interrupt routine on the moment I got the current time.
void setup()
{
.......
pinMode(Drupteller, INPUT_PULLUP);
attachInterrupt(Drupteller, tel, FALLING );
.......
}
void tel()
{
noInterrupts();
if ((debounceCounter <= 0) && (digitalRead(Drupteller) == LOW))
{
daycounter++;
LastTime = Time.now();
par.LastTime = LastTime ;
debounceCounter = 10;
}
interrupts();
}
Before this worked well.
I putted a work around as:
void tel()
{
noInterrupts();
if ((debounceCounter <= 0) && (digitalRead(Drupteller) == LOW))
{
daycounter++;
LastTime = CurTime;
par.LastTime = CurTime;
debounceCounter = 10;
}
interrupts();
}
void loop()
{
............
// Haal tijd
CurTime = Time.now();
........
That worked fine.
Has someone knowledge of the Time object is no longer thread-save or what-so-ever?
Greets
Jean Paul