I want to write a function that would return the hour of the time in either 12 or 24 hour format. The hour data is accessed through reading a register on a Real-time clock by a function:
where as adr is the address (let's call the address location to be passed HOURADR), and ramCal is whether the register is in Calendar data or custom RAM data (let's call the calendar data RTCCLOCK).Code:unsigned char oneByteRead(unsigned char adr, short ramCal);
Basically my function would determine the format that the hour is in and return the hour. I don't see any problem returning the 24 hour format. The only problem is returning the AM/PM hour data to complete the function call. Would I need to pass a separate pointer parameter in order to return 2 things at a time, one being the hour, the other being AM/PM, if the function determines that the byte is stored in 12 hour format?
Thank you in advance for the comments!