Humidistat
Arduino firmware for a humidistat (humidity controller)
Loading...
Searching...
No Matches
advanceEnum.h
Go to the documentation of this file.
1
#ifndef HUMIDISTAT_ADVANCEENUM_H
2
#define HUMIDISTAT_ADVANCEENUM_H
3
4
#include <stdint.h>
5
10
template
<
typename
T>
11
void
advanceEnum
(T &e, int8_t n = 1) {
12
e =
static_cast<
T
>
((
static_cast<
typename std::underlying_type<T>::type
>
(e) + n) % (
static_cast<
typename std::underlying_type<T>::type
>
(T::_last) + 1));
13
}
14
15
#endif
//HUMIDISTAT_ADVANCEENUM_H
advanceEnum
void advanceEnum(T &e, int8_t n=1)
Cycle through (advance) an enum.
Definition
advanceEnum.h:11
src
advanceEnum.h
Generated by
1.12.0