[cold-out] fix so it uses actual thermistor reading

main-solar-only
Richard Meadows 2016-03-03 19:33:11 +00:00
rodzic 6b1310c0bb
commit 57a7d6f5d4
1 zmienionych plików z 5 dodań i 2 usunięć

Wyświetl plik

@ -43,6 +43,7 @@
#include "pips.h" #include "pips.h"
#include "xosc.h" #include "xosc.h"
#include "sequencer.h" #include "sequencer.h"
#include "thermistor.h"
#define CALLSIGN "UBSEDS14" #define CALLSIGN "UBSEDS14"
#define APRS_COMMENT "" #define APRS_COMMENT ""
@ -266,6 +267,7 @@ void lf_tick(uint32_t tick)
int main(void) int main(void)
{ {
uint32_t n = 1; uint32_t n = 1;
float external_temperature;
/* Init */ /* Init */
init(INIT_NORMAL); init(INIT_NORMAL);
@ -291,8 +293,9 @@ int main(void)
start_adc_sequence(); start_adc_sequence();
while (is_adc_sequence_done() == 0); /* wait for adc */ while (is_adc_sequence_done() == 0); /* wait for adc */
if ((get_thermistor() < COLD_OUT_TEMPERATURE) && external_temperature = thermistor_ratio_to_temperature(get_thermistor()); /* read */
(cold_out_count++ < COLD_OUT_COUNT_MAX)) { if ((external_temperature < COLD_OUT_TEMPERATURE) && /* check temperature */
(cold_out_count++ < COLD_OUT_COUNT_MAX)) { /* and max iterations */
in_cold_out = 1; /* cold */ in_cold_out = 1; /* cold */
} else { } else {