mirror of
https://github.com/LNH-team/pico-launcher.git
synced 2026-06-02 09:06:54 +02:00
Initial commit
This commit is contained in:
26
common/core/TickCounter.h
Normal file
26
common/core/TickCounter.h
Normal file
@@ -0,0 +1,26 @@
|
||||
#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;
|
||||
Reference in New Issue
Block a user