You've already forked pico-launcher
mirror of
https://github.com/LNH-team/pico-launcher.git
synced 2026-01-09 16:28:48 -08:00
26 lines
427 B
C
26 lines
427 B
C
|
|
#pragma once
|
||
|
|
|
||
|
|
class TickCounter
|
||
|
|
{
|
||
|
|
public:
|
||
|
|
void Start();
|
||
|
|
void Stop();
|
||
|
|
u64 GetValue();
|
||
|
|
|
||
|
|
static u32 TicksToMilliSeconds(u32 ticks)
|
||
|
|
{
|
||
|
|
return ((ticks * 8201887ULL) + (1ULL << 31)) >> 32;
|
||
|
|
}
|
||
|
|
|
||
|
|
static u32 TicksToMicroSeconds(u32 ticks)
|
||
|
|
{
|
||
|
|
return (ticks * 4100943703ULL + (1 << 30)) >> 31;
|
||
|
|
}
|
||
|
|
|
||
|
|
private:
|
||
|
|
u64 _msb = 0;
|
||
|
|
|
||
|
|
void TimerOverflowIrq();
|
||
|
|
};
|
||
|
|
|
||
|
|
extern TickCounter gTickCounter;
|