Added global engine temp in general data store
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
#include "general_store.h"
|
#include "general_store.h"
|
||||||
|
|
||||||
volatile double vbat_global = 0;
|
volatile double vbat_global = 0;
|
||||||
|
volatile double teng_global = 0;
|
||||||
|
|
||||||
void vbat_global_read(double& out) {
|
void vbat_global_read(double& out) {
|
||||||
out = vbat_global;
|
out = vbat_global;
|
||||||
@@ -11,4 +12,12 @@
|
|||||||
|
|
||||||
void vbat_global_write(const double& in) {
|
void vbat_global_write(const double& in) {
|
||||||
vbat_global = in;
|
vbat_global = in;
|
||||||
|
}
|
||||||
|
|
||||||
|
void teng_global_read(double& out) {
|
||||||
|
out = vbat_global;
|
||||||
|
}
|
||||||
|
|
||||||
|
void teng_global_write(const double& in) {
|
||||||
|
vbat_global = in;
|
||||||
}
|
}
|
||||||
@@ -4,6 +4,10 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
extern volatile double vbat_global;
|
extern volatile double vbat_global;
|
||||||
|
extern volatile double teng_global;
|
||||||
|
|
||||||
void vbat_global_read(double& out);
|
void vbat_global_read(double& out);
|
||||||
void vbat_global_write(const double& in);
|
void vbat_global_write(const double& in);
|
||||||
|
|
||||||
|
void teng_global_read(double& out);
|
||||||
|
void teng_global_write(const double& in);
|
||||||
@@ -3,6 +3,7 @@
|
|||||||
// SPDX-License-Identifier: GPL-3.0-or-later
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
||||||
|
|
||||||
#include "thermocouple.h"
|
#include "thermocouple.h"
|
||||||
|
#include "data/general_store.h"
|
||||||
|
|
||||||
int thermocouple::push(const Task &task) { return _queue.push(task); }
|
int thermocouple::push(const Task &task) { return _queue.push(task); }
|
||||||
|
|
||||||
@@ -20,5 +21,6 @@ int thermocouple::init() {
|
|||||||
int thermocouple::loop(unsigned long timeout_ms) {
|
int thermocouple::loop(unsigned long timeout_ms) {
|
||||||
if (millis() > _last_read + _update_interval) {
|
if (millis() > _last_read + _update_interval) {
|
||||||
_temp = _thermocouple->readCelsius();
|
_temp = _thermocouple->readCelsius();
|
||||||
|
teng_global_write(_temp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Reference in New Issue
Block a user