mirror of
https://github.com/LNH-team/pico-launcher.git
synced 2025-12-05 13:16:06 +01: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; |