3-phase PV router
Loading...
Searching...
No Matches
override_masks.h File Reference

The forced outputs: the override pins, and the scheduled boosts of the dual tariff. More...

#include <stdint.h>
#include "utils_dualtariff.h"
Include dependency graph for override_masks.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  OverrideMasks
 Holds both local and remote override bitmasks. More...
 

Namespaces

namespace  Forcing
 

Functions

template<typename ReadBoost>
OverrideMasks Forcing::boostForcing (const bool bOffPeak, const uint32_t elapsed, const int16_t temperature_x100, const int16_t threshold_x100, const uint8_t count, ReadBoost readBoost)
 The targets of the scheduled boosts whose window is open.
 
constexpr OverrideMasks operator| (const OverrideMasks &a, const OverrideMasks &b)
 Both masks of a and b: what either forces.
 
template<typename Pins, typename IsActive>
OverrideMasks Forcing::pinForcing (const Pins &pins, IsActive isActive)
 The targets of the override pins that are active (held LOW).
 

Detailed Description

The forced outputs: the override pins, and the scheduled boosts of the dual tariff.

Author
Frédéric Metrich (frede.nosp@m.ric..nosp@m.metri.nosp@m.ch@l.nosp@m.ive.f.nosp@m.r)
Version
1.0
Date
2026-11-21

Once per second, the firmware computes what is forced ON: the targets of each override pin held LOW, and the targets of each scheduled boost whose window is open. The functions here take every input explicitly (the pin states, the time elapsed since the start of the off-peak period, the temperature, the tables); main.cpp reads millis(), the pins and the globals, and calls them.

Note
This header has no Arduino dependency, so it can be exercised by the native test suite (test/native/test_override_masks).

Definition in file override_masks.h.

Function Documentation

◆ operator|()

OverrideMasks operator| ( const OverrideMasks & a,
const OverrideMasks & b )
constexpr

Both masks of a and b: what either forces.

Definition at line 46 of file override_masks.h.