3-phase PV router
Loading...
Searching...
No Matches
type_traits.hpp File Reference

Some useful but missing stl functions templates. More...

Include dependency graph for type_traits.hpp:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define HOURS(value)
 A compile-time number of hours, as MINUTES().
 
#define MINUTES(value)
 A compile-time number of minutes, as an integral_constant.
 

Detailed Description

Some useful but missing stl functions templates.

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-21

Definition in file type_traits.hpp.

Macro Definition Documentation

◆ HOURS

#define HOURS ( value)
Value:
MINUTES((value) * 60)
#define MINUTES(value)
A compile-time number of minutes, as an integral_constant.

A compile-time number of hours, as MINUTES().

Usage: HOURS(2). Too many hours fail to compile instead of wrapping around: the product overflows the 16-bit int of the AVR (from HOURS(547) on), and is a narrowing conversion to uint16_t on a native build (beyond 65535 minutes).

Definition at line 61 of file type_traits.hpp.

◆ MINUTES

#define MINUTES ( value)
Value:
integral_constant< uint16_t, (value) > {}

A compile-time number of minutes, as an integral_constant.

One syntax for the durations of config.h: the sliding average of the relays (RelayEngine takes it as a template parameter) and the scheduled boosts (Minutes). Usage: MINUTES(RELAY_FILTER_DELAY), MINUTES(90).

Definition at line 51 of file type_traits.hpp.