|
3-phase PV router
|
The round of the sensors, one transaction per mains cycle. More...
#include <temp_schedule.h>
Public Member Functions | |
| bool | done () const |
| Whether the round is over. | |
| bool | newPeriod () |
| A datalog period begins: a new round, once this one is over. | |
| Action | next (const bool onTime) |
| The transaction of this mains cycle: called once per cycle, when the loop sees it. | |
| void | skipRestOf (const uint8_t idx) |
| The sensor did not answer its ADDRESS: its other transactions are skipped. | |
Private Attributes | |
| bool | converting { false } |
| uint8_t | sensor { 0 } |
| uint16_t | sinceConvert { 0 } |
| uint8_t | sub { 0 } |
The round of the sensors, one transaction per mains cycle.
Main-loop code. The state is two small counters, the sensor and its transaction, advanced by compare and reset: no division at run time (the divisions above are compile-time only).
| N | The number of sensors |
| CONVERSION_CYCLES | conversionCycles(SUPPLY_FREQUENCY) |
Definition at line 129 of file temp_schedule.h.
|
inline |
Whether the round is over.
Definition at line 222 of file temp_schedule.h.

|
inline |
A datalog period begins: a new round, once this one is over.
An unfinished round (only after many late cycles) goes on: the sensors it has not read yet keep the values of the period before.
Definition at line 209 of file temp_schedule.h.


|
inline |
The transaction of this mains cycle: called once per cycle, when the loop sees it.
| onTime | Whether the cycle was seen on time (the loop idle when it began) |
Definition at line 145 of file temp_schedule.h.

|
inline |
The sensor did not answer its ADDRESS: its other transactions are skipped.
| idx | The sensor of the last ADDRESS (another one is ignored) |
Definition at line 191 of file temp_schedule.h.

|
private |
the round's conversion has started
Definition at line 133 of file temp_schedule.h.
|
private |
the sensor being read; N: round over
Definition at line 135 of file temp_schedule.h.
|
private |
cycles since it started, up to CONVERSION_CYCLES
Definition at line 134 of file temp_schedule.h.
|
private |
its next transaction: 0 ADDRESS, 1 READ, 2 CLOSE
Definition at line 136 of file temp_schedule.h.