mirror of
https://github.com/ThrowTheSwitch/CMock.git
synced 2026-06-05 21:15:20 +00:00
33 lines
715 B
C
33 lines
715 B
C
/* =========================================================================
|
|
CMock - Automatic Mock Generation for C
|
|
ThrowTheSwitch.org
|
|
Copyright (c) 2007-25 Mike Karlesky, Mark VanderVoord, & Greg Williams
|
|
SPDX-License-Identifier: MIT
|
|
========================================================================= */
|
|
|
|
#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;
|
|
}
|
|
}
|
|
|