| 1 | #include "Types.h" |
| 2 | #include "TimerInterruptHandler.h" |
| 3 | #include "TimerInterruptConfigurator.h" |
| 4 | |
| 5 | static uint32 systemTime; |
| 6 | |
| 7 | void Timer_SetSystemTime(uint32 time) |
| 8 | { |
| 9 | systemTime = time; |
| 10 | } |
| 11 | |
| 12 | uint32 Timer_GetSystemTime(void) |
| 13 | { |
| 14 | return systemTime; |
| 15 | } |
| 16 | |
| 17 | void Timer_InterruptHandler(void) |
| 18 | { |
| 19 | uint32 status = AT91C_BASE_TC0->TC_SR; |
| 20 | if (status & AT91C_TC_CPCS) |
| 21 | { |
| 22 | systemTime += 10; |
| 23 | } |
| 24 | } |
| 25 |