mirror of
https://github.com/Rockbox/rockbox.git
synced 2025-12-08 20:55:17 -05:00
better rtc_read() simulation
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@2657 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
parent
ec7b5cde2e
commit
6e0a75c596
1 changed files with 12 additions and 0 deletions
|
|
@ -184,6 +184,18 @@ int rtc_read(int address)
|
|||
|
||||
case 2: /* minute */
|
||||
return (teem->tm_min%10) | ((teem->tm_min/10) << 4);
|
||||
|
||||
case 1: /* seconds */
|
||||
return (teem->tm_sec%10) | ((teem->tm_sec/10) << 4);
|
||||
|
||||
case 7: /* year */
|
||||
return ((teem->tm_year-100)%10) | (((teem->tm_year-100)/10) << 4);
|
||||
|
||||
case 6: /* month */
|
||||
return ((teem->tm_mon+1)%10) | (((teem->tm_mon+1)/10) << 4);
|
||||
|
||||
case 5: /* day */
|
||||
return (teem->tm_mday%10) | ((teem->tm_mday/10) << 4);
|
||||
}
|
||||
|
||||
return address ^ 0x55;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue