|
|
|
|
@ -60,7 +60,7 @@ int __attribute__((noreturn)) main(void) {
|
|
|
|
|
// measure temps 5*2 times
|
|
|
|
|
dbgLog("starting temp measuring");
|
|
|
|
|
for(int i=0; i<5; i++) {
|
|
|
|
|
for(int active_sensor=0; active_sensor<2; active_sensor++) { // only measuring two probes atm
|
|
|
|
|
for(uint8_t active_sensor=0; active_sensor<2; active_sensor++) { // only measuring two probes atm
|
|
|
|
|
muxer_set(active_sensor);
|
|
|
|
|
while(!mcpadc_has_new_data()) _delay_ms(1);
|
|
|
|
|
mcpadc_get_data(); // first data after switch to trash
|
|
|
|
|
@ -82,7 +82,7 @@ int __attribute__((noreturn)) main(void) {
|
|
|
|
|
|
|
|
|
|
dbgLog("now measuring offsets");
|
|
|
|
|
// measure 2 offsets
|
|
|
|
|
for(int active_sensor=0; active_sensor<2; active_sensor++) { // only measuring two offsets atm
|
|
|
|
|
for(uint8_t active_sensor=0; active_sensor<2; active_sensor++) { // only measuring two offsets atm
|
|
|
|
|
dbgLog("active sensor: %i",active_sensor);
|
|
|
|
|
muxer_set(active_sensor);
|
|
|
|
|
offset_measure_start(active_sensor);
|
|
|
|
|
@ -96,11 +96,17 @@ int __attribute__((noreturn)) main(void) {
|
|
|
|
|
|
|
|
|
|
offset_measure_stop();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// measure ambient
|
|
|
|
|
muxer_set(5);
|
|
|
|
|
while(!mcpadc_has_new_data()) _delay_ms(1);
|
|
|
|
|
mcpadc_get_data(); // first data after switch to trash
|
|
|
|
|
while(!mcpadc_has_new_data()) _delay_ms(1);
|
|
|
|
|
data = mcpadc_get_data();
|
|
|
|
|
process_ambient_value(data);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
SOFTTIMER(1,8000) { // maybe measure coldjunction comp
|
|
|
|
|
dbgLog("would measure cold-junction?!");
|
|
|
|
|
/* muxer_set(23); // TODO: channel for ntc?! */
|
|
|
|
|
/* SOFTTIMER(1,8000) { // maybe measure coldjunction comp
|
|
|
|
|
|
|
|
|
|
/* // first measure ntc offset?! maybe? */
|
|
|
|
|
/* offset_measure_start(active_sensor); */
|
|
|
|
|
@ -117,7 +123,7 @@ int __attribute__((noreturn)) main(void) {
|
|
|
|
|
/* while(!mcpadc_has_new_data()) _delay_ms(1); */
|
|
|
|
|
|
|
|
|
|
/* data = mcpadc_get_data(); */
|
|
|
|
|
}
|
|
|
|
|
}*/
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|