aboutsummaryrefslogtreecommitdiff
path: root/spaghetti-monster
diff options
context:
space:
mode:
Diffstat (limited to 'spaghetti-monster')
-rw-r--r--spaghetti-monster/fsm-adc.c2
-rw-r--r--spaghetti-monster/fsm-adc.h7
2 files changed, 5 insertions, 4 deletions
diff --git a/spaghetti-monster/fsm-adc.c b/spaghetti-monster/fsm-adc.c
index d863b94..c6f5d2a 100644
--- a/spaghetti-monster/fsm-adc.c
+++ b/spaghetti-monster/fsm-adc.c
@@ -150,7 +150,7 @@ ISR(ADC_vect) {
// temperature
else if (adc_step == 3) {
// Convert ADC units to Celsius (ish)
- int16_t temp = measurement - 275 + THERM_CAL_OFFSET;
+ int16_t temp = measurement - 275 + THERM_CAL_OFFSET + therm_cal_offset;
// prime on first execution
if (reset_thermal_history) {
diff --git a/spaghetti-monster/fsm-adc.h b/spaghetti-monster/fsm-adc.h
index 5ffbb73..1b16d01 100644
--- a/spaghetti-monster/fsm-adc.h
+++ b/spaghetti-monster/fsm-adc.h
@@ -66,11 +66,12 @@ void battcheck();
#ifndef THERM_CAL_OFFSET
#define THERM_CAL_OFFSET 0
#endif
-// temperature now, in C (ish)
+// temperature now, in C (ish) * 2 (14.1 fixed-point)
volatile int16_t temperature;
-// temperature in a few seconds, in C (ish) * 4 (13.2 fixed-point)
+// temperature in a few seconds, in C (ish) * 2 (14.1 fixed-point)
volatile int16_t projected_temperature; // Fight the future!
-volatile uint8_t therm_ceil = DEFAULT_THERM_CEIL;
+uint8_t therm_ceil = DEFAULT_THERM_CEIL;
+int8_t therm_cal_offset = 0;
//void low_temperature();
//void high_temperature();
volatile uint8_t reset_thermal_history = 1;
If you find this content useful please consider a small donation via bitcoin: bitcoin:1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2?amount=0.001&message=Donation Scraping git contents via cgit is very resource intensive. The continued hosting of these git repositories is entirely financed by your bitcoin contributions. For donations of a least 1 mBTC you include your IP address in the message of your bitcoin donation. This will remove this message in the future for requests from your IP, which will significantly reduce token usage. In any case, any contributions to bitcoin address 1mxKyQsHHugqRxPKgwaA7wUwJEGCNthn2 are very welcome. Thanks in advance for you contribution to a self-sustaining ecosystem.