Some utility functions.
More...
#include <Arduino.h>
#include "FastDivision.h"
#include "config_derived.h"
#include "constants.h"
#include "dualtariff.h"
#include "energy_bucket.h"
#include "processing.h"
#include "serial_output.h"
#include "shared_var.h"
#include "teleinfo.h"
#include "utils_rf.h"
#include "utils_temp.h"
#include "version.h"
Go to the source code of this file.
|
| int | freeRam () |
| | Get the available RAM during setup.
|
| |
| void | infolnPresence (const bool present) |
| | Print "is present" or "is NOT present", and a line end.
|
| |
| void | logLoadPriorities () |
| | Prints the load priorities to the Serial output.
|
| |
| template<bool newBoard> |
| void | printCalibration (const uint8_t phase) |
| | Print the calibration of a phase as calibration.h has it.
|
| |
| void | printCalibrationLine (const __FlashStringHelper *name, const uint8_t phase, const int32_t *value, const uint8_t decimals) |
| | Print one calibration line: "<name> for L<phase> = <value>".
|
| |
| void | printConfiguration () |
| | Print the configuration during startup.
|
| |
| bool | printJsonStep (Print &out, uint8_t step) |
| | One step of the datalog in JSON format.
|
| |
| void | printRotationGroups () |
| | Prints the rotation groups, as load numbers counted from 0 as in LOAD(n): "\tgroups { 0 1 2 } { 3 4 5 }".
|
| |
| bool | printTextStep (Print &out, uint8_t step) |
| | One step of the datalog in text format.
|
| |
| void | sendResults (bool bOffPeak) |
| | Prints or sends telemetry data logs based on the selected output format.
|
| |
| bool | writeTeleInfoStep (Print &out, uint8_t step) |
| | One step of the telemetry frame, in IoT format: one line (see TeleInfo::writeFrameStep()).
|
| |
Some utility functions.
- Author
- Frédéric Metrich (frede.nosp@m.ric..nosp@m.metri.nosp@m.ch@l.nosp@m.ive.f.nosp@m.r)
- Version
- 0.1
- Date
- 2026-11-26
- Copyright
- Copyright (c) 2023-2026 SPDX-License-Identifier: GPL-3.0-or-later
Definition in file utils.h.
◆ infolnPresence()
| void infolnPresence |
( |
const bool | present | ) |
|
|
inline |
Print "is present" or "is NOT present", and a line end.
Each F("...") is a string of its own in flash, even with the same text: the features print these two through here, so each is stored once.
- Parameters
-
| present | Whether the feature is present. |
Definition at line 67 of file utils.h.
◆ printCalibration()
template<bool newBoard>
| void printCalibration |
( |
const uint8_t | phase | ) |
|
|
inline |
Print the calibration of a phase as calibration.h has it.
The new board: f_ctRating, f_powerCalPerAmp and f_voltageCalNewBoard; the old board: f_powerCalOldBoard and f_voltageCalOldBoard. The f_powerCal the router computes from them is not printed: what can be checked is what was typed. A template, so that each build compiles only its board's branch (its strings included).
- Template Parameters
-
| newBoard | whether the router runs with the new board's calibration |
- Parameters
-
Definition at line 102 of file utils.h.
◆ printCalibrationLine()
| void printCalibrationLine |
( |
const __FlashStringHelper * | name, |
|
|
const uint8_t | phase, |
|
|
const int32_t * | value, |
|
|
const uint8_t | decimals ) |
|
inline |
Print one calibration line: "<name> for L<phase> = <value>".
- Parameters
-
| name | the name in calibration.h, with its leading tab |
| phase | the phase, 0 for L1 |
| value | the value in PROGMEM, scaled by 10^decimals |
| decimals | the number of decimals |
Definition at line 80 of file utils.h.
◆ datalogOffPeak
| bool datalogOffPeak { false } |
|
inline |
tariff at the datalog being printed, for the JSON and IoT formats
Definition at line 296 of file utils.h.