mirror of
https://github.com/LNH-team/pico-launcher.git
synced 2025-12-05 13:16:06 +01:00
25 lines
443 B
C++
25 lines
443 B
C++
#pragma once
|
|
#include <libtwl/rtos/rtosEvent.h>
|
|
|
|
/// @brief Helper class for waiting for vblank.
|
|
class VBlank
|
|
{
|
|
public:
|
|
static void Init()
|
|
{
|
|
rtos_createEvent(&sEvent);
|
|
}
|
|
|
|
static void Wait(bool waitNew = true, bool clearAfter = true)
|
|
{
|
|
rtos_waitEvent(&sEvent, waitNew, clearAfter);
|
|
}
|
|
|
|
static void NotifyIrq()
|
|
{
|
|
rtos_signalEvent(&sEvent);
|
|
}
|
|
|
|
private:
|
|
static rtos_event_t sEvent;
|
|
}; |