This is going to be a strange request. I must warn that I am new to embedded programming and therefore what is obvious to you may not be to me. I am trying to implement a real time clock program with the data then being transmitted on CAN. I am getting some warning when I compile my code and cannot understand what I need to do. Any help would be appreciated. I will be posting my code in parts as I cannot exceed a certain character limit.
By the way - incrementing the day is only correct if currentRT() is called at least once / 24 hours. If called more seldom, then you may have stepped more than one day.
You might do:
while (time.daysa > time.daysb) { time.daysb++; current_day++; }
or
if (time.daysa > time.daysb) { current_day += (time.daysa - time.daysb); time.daysb = time.daysa; }