Exercise-007 Reading curr_time through class operation
In the Clock_Alarm_display_curr_time function, we get the current time using Clock_Alarm_get_curr_time function, which is not implemented. Let’s implement this function.
Here, you have to return the current time variable, which is Clock_Alarm_curr_time. But before returning, that is, you are reading the Clock_Alarm_curr_time variable. So, you have to disable the interrupt. Again the same technique. Write the code as shown in Figure 1. You should not save here. You can save it here, no problem, because I made it as an external file. The same code also needs to be copied in the model.
You have to put that code in the get_curr_time function. Go to the get_curr_time function and paste that code, as shown in Figure 2. Save and generate the code.
In the upcoming article, we will test this code on the LCD; before testing, we have to add an LCD initialization code.
FastBit Embedded Brain Academy Courses,
Click here: https://fastbitlab.com/course1