1-phase PV router
Loading...
Searching...
No Matches
config_system.h
Go to the documentation of this file.
1
11
12#ifndef CONFIG_SYSTEM_H
13#define CONFIG_SYSTEM_H
14
15#include <Arduino.h>
16
17#include "type_traits.hpp"
18
19inline constexpr int16_t REQUIRED_EXPORT_IN_WATTS{ 0 };
20inline constexpr int16_t DIVERSION_START_THRESHOLD_WATTS{ 0 };
21
22inline constexpr uint8_t NO_OF_PHASES{ 1 };
23
24// Physical constants, please do not change!
25inline constexpr uint16_t SECONDS_PER_MINUTE{ 60 };
26inline constexpr uint16_t MINUTES_PER_HOUR{ 60 };
27inline constexpr uint32_t JOULES_PER_WATT_HOUR{ 3600 };
28
29// Change these values to suit the local mains frequency and supply meter
30inline constexpr uint8_t SUPPLY_FREQUENCY{ 50 };
31inline constexpr uint32_t WORKING_ZONE_IN_JOULES{ 360 };
32
33// to prevent the diverted energy total from 'creeping'
34inline constexpr uint8_t ANTI_CREEP_LIMIT{ 5 };
35
37
38inline constexpr uint8_t DATALOG_PERIOD_IN_SECONDS{ 5 };
39
40inline constexpr typename conditional< DATALOG_PERIOD_IN_SECONDS * SUPPLY_FREQUENCY >= UINT8_MAX, uint16_t, uint8_t >::type
42
43// Computes inverse value at compile time to use '*' instead of '/'
44inline constexpr float invSUPPLY_FREQUENCY{ 1.0f / SUPPLY_FREQUENCY };
46
47inline constexpr uint16_t delayBeforeSerialStarts{ 1000 };
48inline constexpr uint16_t startUpPeriod{ 3000 };
49
50//--------------------------------------------------------------------------------------------------
51#ifdef EMONESP
52#undef SERIALPRINT
53#undef SERIALOUT
54#undef DEBUGGING
55#include <ArduinoJson.h>
56#endif
57
58#ifdef SERIALOUT
59#undef EMONESP
60#undef SERIALPRINT
61#undef DEBUGGING
62#endif
63//--------------------------------------------------------------------------------------------------
64
65#endif /* CONFIG_SYSTEM_H */
constexpr uint16_t startUpPeriod
constexpr int16_t REQUIRED_EXPORT_IN_WATTS
constexpr uint16_t SECONDS_PER_MINUTE
constexpr uint32_t WORKING_ZONE_IN_JOULES
constexpr uint32_t mainsCyclesPerHour
constexpr float invDATALOG_PERIOD_IN_MAINS_CYCLES
constexpr float invSUPPLY_FREQUENCY
constexpr conditional< DATALOG_PERIOD_IN_SECONDS *SUPPLY_FREQUENCY >=UINT8_MAX, uint16_t, uint8_t >::type DATALOG_PERIOD_IN_MAINS_CYCLES
constexpr uint32_t JOULES_PER_WATT_HOUR
constexpr uint16_t MINUTES_PER_HOUR
constexpr uint8_t DATALOG_PERIOD_IN_SECONDS
constexpr uint8_t ANTI_CREEP_LIMIT
constexpr uint8_t NO_OF_PHASES
constexpr uint16_t delayBeforeSerialStarts
constexpr uint8_t SUPPLY_FREQUENCY
constexpr int16_t DIVERSION_START_THRESHOLD_WATTS
Some useful but missing stl functions templates.