|
|
|
|
@ -55,9 +55,8 @@ int __attribute__((noreturn)) main(void) {
|
|
|
|
|
hardinit();
|
|
|
|
|
softinit();
|
|
|
|
|
|
|
|
|
|
/*muxer_set(1);
|
|
|
|
|
offset_measure_start(1);
|
|
|
|
|
for(;;);*/
|
|
|
|
|
// muxer_set(4);
|
|
|
|
|
// for(;;);
|
|
|
|
|
|
|
|
|
|
int16_t data;
|
|
|
|
|
for(;;){
|
|
|
|
|
@ -66,7 +65,7 @@ int __attribute__((noreturn)) main(void) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// measure temps 5*2 times
|
|
|
|
|
for(uint8_t i=0; i<5; i++) {
|
|
|
|
|
for(uint8_t i=0; i<1; i++) {
|
|
|
|
|
printf("====== now measuring temps\n");
|
|
|
|
|
for(uint8_t active_sensor=0; active_sensor<2; active_sensor++) { // only measuring two probes atm
|
|
|
|
|
printf("=== active sensor: %i\n",active_sensor);
|
|
|
|
|
@ -74,7 +73,7 @@ int __attribute__((noreturn)) main(void) {
|
|
|
|
|
while(!mcpadc_has_new_data()) _delay_ms(10);
|
|
|
|
|
mcpadc_get_data(); // first data after switch to trash
|
|
|
|
|
while(!mcpadc_has_new_data()) _delay_ms(10);
|
|
|
|
|
|
|
|
|
|
_delay_ms(1000);
|
|
|
|
|
data = mcpadc_get_data();
|
|
|
|
|
process_thermocouple_value(data,active_sensor);
|
|
|
|
|
}
|
|
|
|
|
@ -93,12 +92,16 @@ int __attribute__((noreturn)) main(void) {
|
|
|
|
|
|
|
|
|
|
while(offset_measure[active_sensor]) {
|
|
|
|
|
offset_val[active_sensor] += mcpadc_get_data();
|
|
|
|
|
offset_count[active_sensor]++;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// measure ambient
|
|
|
|
|
printf("====== now measuring ambient\n");
|
|
|
|
|
muxer_set(4);
|
|
|
|
|
_delay_ms(300);
|
|
|
|
|
while(!mcpadc_has_new_data()) _delay_ms(10);
|
|
|
|
|
mcpadc_get_data(); // first data after switch to trash
|
|
|
|
|
while(!mcpadc_has_new_data()) _delay_ms(10);
|
|
|
|
|
mcpadc_get_data(); // first data after switch to trash
|
|
|
|
|
while(!mcpadc_has_new_data()) _delay_ms(10);
|
|
|
|
|
|