Commit 0afa6432 authored by Käppler's avatar Käppler
Browse files

co2_sensor: Move 'state' enum to header file

This allows to access the current state from
another code files.
No related merge requests found
Showing with 18 additions and 15 deletions
+18 -15
...@@ -30,21 +30,6 @@ namespace sensor { ...@@ -30,21 +30,6 @@ namespace sensor {
char timestamp[23]; char timestamp[23];
int16_t stable_measurements = 0; int16_t stable_measurements = 0;
/**
* Define sensor states
* BOOTUP -> initial state, until first >0 ppm values are returned
* READY -> sensor does output valid information (> 0 ppm) and no other condition takes place
* NEEDS_CALIBRATION -> sensor measurements are too low (< 250 ppm)
* PREPARE_CALIBRATION_UNSTABLE -> forced calibration was initiated, last measurements were too far apart
* PREPARE_CALIBRATION_STABLE -> forced calibration was initiated, last measurements were close to each others
*/
enum state {
BOOTUP,
READY,
NEEDS_CALIBRATION,
PREPARE_CALIBRATION_UNSTABLE,
PREPARE_CALIBRATION_STABLE
};
const char *state_names[] = { const char *state_names[] = {
"BOOTUP", "BOOTUP",
"READY", "READY",
......
...@@ -24,6 +24,24 @@ namespace sensor { ...@@ -24,6 +24,24 @@ namespace sensor {
extern float humidity; extern float humidity;
extern char timestamp[]; extern char timestamp[];
/**
* Define sensor states
* BOOTUP -> initial state, until first >0 ppm values are returned
* READY -> sensor does output valid information (> 0 ppm) and no other condition takes place
* NEEDS_CALIBRATION -> sensor measurements are too low (< 250 ppm)
* PREPARE_CALIBRATION_UNSTABLE -> forced calibration was initiated, last measurements were too far apart
* PREPARE_CALIBRATION_STABLE -> forced calibration was initiated, last measurements were close to each others
*/
enum state {
BOOTUP,
READY,
NEEDS_CALIBRATION,
PREPARE_CALIBRATION_UNSTABLE,
PREPARE_CALIBRATION_STABLE
};
extern state current_state;
void initialize(); void initialize();
bool processData(); bool processData();
void startCalibrationProcess(); void startCalibrationProcess();
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment