mirror of
https://github.com/usatiuk/cardboy.git
synced 2025-10-28 15:17:48 +01:00
31 lines
578 B
C++
31 lines
578 B
C++
//
|
|
// Created by Stepan Usatiuk on 03.03.2025.
|
|
//
|
|
|
|
#ifndef POWER_HELPER_HPP
|
|
#define POWER_HELPER_HPP
|
|
|
|
#include "freertos/FreeRTOS.h"
|
|
#include "freertos/event_groups.h"
|
|
|
|
class PowerHelper {
|
|
public:
|
|
static PowerHelper& get();
|
|
|
|
bool is_slow() const;
|
|
void set_slow(bool slow);
|
|
BaseType_t reset_slow_isr(BaseType_t* xHigherPriorityTaskWoken);
|
|
void delay(int slow_ms, int normal_ms);
|
|
|
|
void install_isr();
|
|
|
|
private:
|
|
PowerHelper();
|
|
|
|
bool _slow = false;
|
|
EventGroupHandle_t _event_group;
|
|
};
|
|
|
|
|
|
#endif // POWER_HELPER_HPP
|