Fix the formatting in timer.c
This commit is contained in:
@@ -1,14 +1,11 @@
|
|||||||
#include "fsl_pit.h"
|
#include "fsl_pit.h"
|
||||||
#include "timer.h"
|
#include "timer.h"
|
||||||
|
|
||||||
static volatile uint32_t CurrentTime;
|
static volatile uint32_t currentTime, delayLength;
|
||||||
|
|
||||||
static volatile uint32_t delayLength;
|
|
||||||
|
|
||||||
void PIT_TIMER_HANDLER(void)
|
void PIT_TIMER_HANDLER(void)
|
||||||
{
|
{
|
||||||
CurrentTime++;
|
currentTime++;
|
||||||
|
|
||||||
if (delayLength) {
|
if (delayLength) {
|
||||||
--delayLength;
|
--delayLength;
|
||||||
}
|
}
|
||||||
@@ -31,24 +28,24 @@ void Timer_Init(void)
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint32_t Timer_GetCurrentTime() {
|
uint32_t Timer_GetCurrentTime() {
|
||||||
return CurrentTime;
|
return currentTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
void Timer_SetCurrentTime(uint32_t *time)
|
void Timer_SetCurrentTime(uint32_t *time)
|
||||||
{
|
{
|
||||||
*time = CurrentTime;
|
*time = currentTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t Timer_GetElapsedTime(uint32_t *time)
|
uint32_t Timer_GetElapsedTime(uint32_t *time)
|
||||||
{
|
{
|
||||||
uint32_t elapsedTime = CurrentTime - *time;
|
uint32_t elapsedTime = currentTime - *time;
|
||||||
return elapsedTime;
|
return elapsedTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint32_t Timer_GetElapsedTimeAndSetCurrent(uint32_t *time)
|
uint32_t Timer_GetElapsedTimeAndSetCurrent(uint32_t *time)
|
||||||
{
|
{
|
||||||
uint32_t elapsedTime = Timer_GetElapsedTime(time);
|
uint32_t elapsedTime = Timer_GetElapsedTime(time);
|
||||||
*time = CurrentTime;
|
*time = currentTime;
|
||||||
return elapsedTime;
|
return elapsedTime;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user