35#ifndef _BRACZ_CUSTOM_BLINKERFLOW_HXX_
36#define _BRACZ_CUSTOM_BLINKERFLOW_HXX_
55 node, BLINKER_EVENT_ID, BLINKER_EVENT_ID + 1, &
state_, (uint8_t)1)
#define STATE(_fn)
Turns a function name into an argument to be supplied to functions expecting a state.
A BarrierNotifiable allows to create a number of child Notifiable and wait for all of them to finish.
BarrierNotifiable * reset(Notifiable *done)
Resets the barrier. Returns &*this. Asserts that is_done().
Reusable test flow that just blinks a pair of events.
Action blinker()
State that handles sending off the produced event.
Action handle_sleep()
State that sleeps until the next event is due.
BlinkerFlow(openlcb::Node *node, uint64_t BLINKER_EVENT_ID)
Constructor.
openlcb::BitEventProducer producer_
The actual producer object.
uint8_t state_
Which event we produced last.
BarrierNotifiable n_
Helper object for catching callback notifications.
StateFlowTimer sleepData_
Object needed for sleeping in a state flow.
openlcb::WriteHelper helper_
Helper object to write to the bus in an asynchronous way.
openlcb::MemoryBit< uint8_t > bit_
Helper object for the event producer.
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 wait_and_call(Callback c)
Wait for resource to become available before proceeding to next state.
Action sleep_and_call(::Timer *timer, long long timeout_nsec, Callback c)
Suspends execution of this control flow for a specified time.
Event handler for a single-bit producer, e.g.
void Update(WriteHelper *writer, Notifiable *done)
Requests the event associated with the current value of the bit to be produced (unconditionally).
Simple implementation of a BitEventInterface when the true state ofthe variable is mapped in memory (...
Base class for NMRAnet nodes conforming to the asynchronous interface.
A statically allocated buffer for sending one message to the OpenLCB bus.
#define LOG(level, message...)
Conditionally write a message to the logging output.
static const int INFO
Loglevel that is printed by default, reporting some status information.
#define MSEC_TO_NSEC(_msec)
Convert a millisecond value to a nanosecond value.