Exercise-008:Implementation part 9
In this article, let’s test this Exercise 008. Our project is almost completed, but there is one small change we have to make, that is in the tick ISR.
In the tick ISR, you call this QF_tickXISR(0) function, and you should call this Clock_Alarm_update_curr_time function for every 100 milliseconds. That’s why I just took one static variable here.
if(++count == 100U), then I update the current time variable Clock_Alarm_update_curr_time(). And also, I am sending a tick signal(TICK_SIG) or tick event to the ClockAlarm state machine. For that, you can use this QACTIVE_POST_ISR macro given by the framework because we are posting the event from the ISR.
And, there will be one more change in the set_curr_time. In the set_curr_time function, the TCCR1B register must be updated like this (as shown in figure 2). So, take care of this code.
TCCR1B = (TCCR1B_CTC_MODE |TCCR1B_PRESCALER_1);
I hope you can make these changes. After that, generate the code and retest it on your hardware. And, it should work.
FastBit Embedded Brain Academy Courses,
Click here: https://fastbitlab.com/course1