#include <cstdint>
#include <deque>
#include <numeric>
Go to the source code of this file.
|
void | insert_value_queue (const int value, std::deque< int > &queue) |
|
int | average_queue (const std::deque< int > &queue) |
|
bool | check_sequence (const uint8_t *data, const std::array< uint8_t, 3 > &expected) |
|
void | rpm_2_byte (const float rr_rpm, char *rr_rpm_byte) |
|
void | debounce (const bool new_value, bool &stored_value, unsigned int &counter, const unsigned int counter_limit) |
| debounce function to avoid sporadic changes (and repeating the code everywhere)
|
|
void | debounce (const bool new_value, bool &stored_value, unsigned int &counter) |
|
◆ average_queue()
int average_queue |
( |
const std::deque< int > & |
queue | ) |
|
◆ check_sequence()
bool check_sequence |
( |
const uint8_t * |
data, |
|
|
const std::array< uint8_t, 3 > & |
expected |
|
) |
| |
◆ debounce() [1/2]
void debounce |
( |
const bool |
new_value, |
|
|
bool & |
stored_value, |
|
|
unsigned int & |
counter |
|
) |
| |
◆ debounce() [2/2]
void debounce |
( |
const bool |
new_value, |
|
|
bool & |
stored_value, |
|
|
unsigned int & |
counter, |
|
|
const unsigned int |
counter_limit |
|
) |
| |
debounce function to avoid sporadic changes (and repeating the code everywhere)
- Parameters
-
new_value | The newly read value |
stored_value | Reference to the stored value that will be updated |
counter | Reference to the counter for this specific input |
counter_limit | Number of consecutive different readings before accepting change |
Definition at line 58 of file utils.hpp.
◆ insert_value_queue()
void insert_value_queue |
( |
const int |
value, |
|
|
std::deque< int > & |
queue |
|
) |
| |
◆ rpm_2_byte()
void rpm_2_byte |
( |
const float |
rr_rpm, |
|
|
char * |
rr_rpm_byte |
|
) |
| |