mirror of
https://github.com/meshtastic/firmware.git
synced 2025-02-02 18:59:56 +00:00
32ac5ac9ae
using @girtsf clang-format prefs settings. This should allow us to turn on auto format in our editors without causing spurious file changes.
22 lines
492 B
C++
22 lines
492 B
C++
#pragma once
|
|
|
|
#include "PeriodicTask.h"
|
|
#include <Arduino.h>
|
|
|
|
/**
|
|
* Periodically invoke a callback.
|
|
*
|
|
* This just provides C style callback conventions rather than a virtual function - FIXME, remove?
|
|
*/
|
|
class Periodic : public PeriodicTask
|
|
{
|
|
uint32_t (*callback)();
|
|
|
|
public:
|
|
// callback returns the period for the next callback invocation (or 0 if we should no longer be called)
|
|
Periodic(uint32_t (*_callback)()) : callback(_callback) {}
|
|
|
|
protected:
|
|
void doTask();
|
|
};
|