We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
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.
So, if you ask a question here directly whenever you get stuck - exactly how will you learn how to find errors in your code? Exactly what do _you_ do right now, to figure out where you go wrong? Are you single-stepping in the debugger? Are you looking at the intermediaries?
"[...] account for a day rollover."
But you are not.
What use do you have of the time.daysb variable, when you always start with the value zero?
time.daysb = 0; if (time.daysa > time.daysb) { current_day = current_day + 1; } time.daysb = time.daysa;
After your counter reaches past 86400 - what do you think will happen on every call to the function?