34#ifndef _UTILS_CPUDISPLAY_HXX_
35#define _UTILS_CPUDISPLAY_HXX_
71 uint8_t load = CpuLoad::instance()->get_load();
#define STATE(_fn)
Turns a function name into an argument to be supplied to functions expecting a state.
Displays the current CPU load on a bicolor LED (red + green) by showing green when CPU load is light,...
Action update_display()
Update the display.
StateFlowTimer timer_
Helper struct for timer state.
const Gpio * green_
Green LED for display.
const Gpio * red_
Red LED for display.
CpuDisplay(Service *s, const Gpio *red, const Gpio *green)
Constructor.
Action delay()
Wait for updating the display.
OS-independent abstraction for GPIO.
virtual void clr() const =0
Clears the GPIO output pin to low.
virtual void set() const =0
Sets the GPIO output pin to high.
Collection of related state machines that pend on incoming messages.
Return type for a state flow callback.
Use this timer class to deliver the timeout notification to a stateflow.
Base class for state machines.
void start_flow(Callback c)
Resets the flow to the specified state and starts it.
Action call_immediately(Callback c)
Imediately call the next state upon return.
Action sleep_and_call(::Timer *timer, long long timeout_nsec, Callback c)
Suspends execution of this control flow for a specified time.
#define MSEC_TO_NSEC(_msec)
Convert a millisecond value to a nanosecond value.