Details | Last modification | View Log | RSS feed
Rev | Author | Line No. | Line |
---|---|---|---|
4973 | right-hear | 1 | #include |
2 | #include |
||
3 | |||
4 | #define BCD_TO_BIN(val) ((val)=((val)&15) + ((val)>>4)*10) |
||
5 | |||
6 | void gettime( struct time *tp) |
||
7 | { |
||
8 | unsigned long tmp=__menuet__getsystemclock(); |
||
9 | tp->ti_hour=tmp&0xff; |
||
10 | tp->ti_min=(tmp>>8)&0xff; |
||
11 | tp->ti_sec=(tmp>>16)&0xff; |
||
12 | tp->ti_hund=0; |
||
13 | BCD_TO_BIN(tp->ti_hour); |
||
14 | BCD_TO_BIN(tp->ti_min); |
||
15 | BCD_TO_BIN(tp->ti_sec); |
||
16 | } |