summaryrefslogtreecommitdiff
path: root/FreeRTOS-Plus/Test/CMock/examples/temp_sensor/src/TimerInterruptHandler.c
diff options
context:
space:
mode:
Diffstat (limited to 'FreeRTOS-Plus/Test/CMock/examples/temp_sensor/src/TimerInterruptHandler.c')
-rw-r--r--FreeRTOS-Plus/Test/CMock/examples/temp_sensor/src/TimerInterruptHandler.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/FreeRTOS-Plus/Test/CMock/examples/temp_sensor/src/TimerInterruptHandler.c b/FreeRTOS-Plus/Test/CMock/examples/temp_sensor/src/TimerInterruptHandler.c
new file mode 100644
index 000000000..ebb543d44
--- /dev/null
+++ b/FreeRTOS-Plus/Test/CMock/examples/temp_sensor/src/TimerInterruptHandler.c
@@ -0,0 +1,25 @@
+#include "Types.h"
+#include "TimerInterruptHandler.h"
+#include "TimerInterruptConfigurator.h"
+
+static uint32 systemTime;
+
+void Timer_SetSystemTime(uint32 time)
+{
+ systemTime = time;
+}
+
+uint32 Timer_GetSystemTime(void)
+{
+ return systemTime;
+}
+
+void Timer_InterruptHandler(void)
+{
+ uint32 status = AT91C_BASE_TC0->TC_SR;
+ if (status & AT91C_TC_CPCS)
+ {
+ systemTime += 10;
+ }
+}
+