comparison Discovery/Src/tMenuEditHardware.c @ 696:cc542448fb28

Merge
author heinrichsweikamp
date Fri, 19 Aug 2022 11:30:24 +0200
parents 4dd487b407f7
children 2f457024049b
comparison
equal deleted inserted replaced
661:87bee7cc77b3 696:cc542448fb28
334 write_label_var( 30, 340, ME_Y_LINE6, &FontT48, text); 334 write_label_var( 30, 340, ME_Y_LINE6, &FontT48, text);
335 text[0] = TXT_2BYTE; 335 text[0] = TXT_2BYTE;
336 switch(settingsGetPointer()->ppo2sensors_source) 336 switch(settingsGetPointer()->ppo2sensors_source)
337 { 337 {
338 default: 338 default:
339 case O2_SENSOR_SOURCE_OPTIC: text[1] = TXT2BYTE_O2IFOptic; 339 case O2_SENSOR_SOURCE_OPTIC: text[1] = TXT2BYTE_O2IFOptic;
340 text[2] = 0;
340 break; 341 break;
341 case O2_SENSOR_SOURCE_ANALOG: text[1] = TXT2BYTE_O2IFAnalog; 342 case O2_SENSOR_SOURCE_ANALOG: text[1] = TXT2BYTE_O2IFAnalog;
343 text[2] = 0;
344 break;
345 #ifdef ENABLE_SENTINEL_MODE
346 case O2_SENSOR_SOURCE_SENTINEL: snprintf(text, 10,"Sentinel");
347 break;
348 #endif
342 } 349 }
343 text[2] = 0; 350
344 write_label_var( 400, 800, ME_Y_LINE6, &FontT48, text); 351 write_label_var( 400, 800, ME_Y_LINE6, &FontT48, text);
345 } 352 }
346 tMenuEdit_refresh_field(StMHARD3_O2_Sensor1); 353 tMenuEdit_refresh_field(StMHARD3_O2_Sensor1);
347 tMenuEdit_refresh_field(StMHARD3_O2_Sensor2); 354 tMenuEdit_refresh_field(StMHARD3_O2_Sensor2);
348 tMenuEdit_refresh_field(StMHARD3_O2_Sensor3); 355 tMenuEdit_refresh_field(StMHARD3_O2_Sensor3);
376 383
377 write_field_on_off(StMHARD3_O2_Sensor1, 30, 95, ME_Y_LINE1, &FontT48, "", sensorActive[0]); 384 write_field_on_off(StMHARD3_O2_Sensor1, 30, 95, ME_Y_LINE1, &FontT48, "", sensorActive[0]);
378 write_field_on_off(StMHARD3_O2_Sensor2, 30, 95, ME_Y_LINE2, &FontT48, "", sensorActive[1]); 385 write_field_on_off(StMHARD3_O2_Sensor2, 30, 95, ME_Y_LINE2, &FontT48, "", sensorActive[1]);
379 write_field_on_off(StMHARD3_O2_Sensor3, 30, 95, ME_Y_LINE3, &FontT48, "", sensorActive[2]); 386 write_field_on_off(StMHARD3_O2_Sensor3, 30, 95, ME_Y_LINE3, &FontT48, "", sensorActive[2]);
380 387
381 if(settingsGetPointer()->ppo2sensors_source == O2_SENSOR_SOURCE_ANALOG) 388 if((settingsGetPointer()->ppo2sensors_source == O2_SENSOR_SOURCE_ANALOG)
389 #ifdef ENABLE_SENTINEL_MODE
390 || (settingsGetPointer()->ppo2sensors_source == O2_SENSOR_SOURCE_SENTINEL)
391 #endif
392 )
382 { 393 {
383 write_label_fix( 30, 800, ME_Y_LINE4, &FontT48, TXT2BYTE_O2Calib); 394 write_label_fix( 30, 800, ME_Y_LINE4, &FontT48, TXT2BYTE_O2Calib);
384 write_label_var( 400, 800, ME_Y_LINE4, &FontT48, "\016\016 %\017"); 395 write_label_var( 400, 800, ME_Y_LINE4, &FontT48, "\016\016 %\017");
385 396
386 write_field_toggle(StMHARD3_O2_Calibrate, 400, 800, ME_Y_LINE4, &FontT48, "", 21, 100); 397 write_field_toggle(StMHARD3_O2_Calibrate, 400, 800, ME_Y_LINE4, &FontT48, "", 21, 98);
387 } 398 }
388 399
389 text[0] = TXT_Fallback; 400 text[0] = TXT_Fallback;
390 text[1] = 1; 401 text[1] = 1;
391 402
397 } 408 }
398 409
399 setEvent(StMHARD3_O2_Sensor1, (uint32_t)OnAction_Sensor1); 410 setEvent(StMHARD3_O2_Sensor1, (uint32_t)OnAction_Sensor1);
400 setEvent(StMHARD3_O2_Sensor2, (uint32_t)OnAction_Sensor2); 411 setEvent(StMHARD3_O2_Sensor2, (uint32_t)OnAction_Sensor2);
401 setEvent(StMHARD3_O2_Sensor3, (uint32_t)OnAction_Sensor3); 412 setEvent(StMHARD3_O2_Sensor3, (uint32_t)OnAction_Sensor3);
402 if(settingsGetPointer()->ppo2sensors_source == O2_SENSOR_SOURCE_ANALOG) 413 if((settingsGetPointer()->ppo2sensors_source == O2_SENSOR_SOURCE_ANALOG)
414 #ifdef ENABLE_SENTINEL_MODE
415 || (settingsGetPointer()->ppo2sensors_source == O2_SENSOR_SOURCE_SENTINEL)
416 #endif
417 )
403 { 418 {
404 setEvent(StMHARD3_O2_Calibrate, (uint32_t)OnAction_O2_Calibrate); 419 setEvent(StMHARD3_O2_Calibrate, (uint32_t)OnAction_O2_Calibrate);
405 } 420 }
406 setEvent(StMHARD3_O2_Fallback, (uint32_t)OnAction_O2_Fallback); 421 setEvent(StMHARD3_O2_Fallback, (uint32_t)OnAction_O2_Fallback);
407 if(DataEX_external_ADC_Present()) 422 if(DataEX_external_ADC_Present())
515 } 530 }
516 if(action == ACTION_BUTTON_NEXT) 531 if(action == ACTION_BUTTON_NEXT)
517 { 532 {
518 if(O2_calib_gas == 21) 533 if(O2_calib_gas == 21)
519 { 534 {
520 O2_calib_gas = 100; 535 O2_calib_gas = 98;
521 } 536 }
522 else 537 else
523 { 538 {
524 O2_calib_gas = 21; 539 O2_calib_gas = 21;
525 } 540 }
535 } 550 }
536 uint8_t OnAction_O2_Source (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action) 551 uint8_t OnAction_O2_Source (uint32_t editId, uint8_t blockNumber, uint8_t digitNumber, uint8_t digitContent, uint8_t action)
537 { 552 {
538 uint8_t source = settingsGetPointer()->ppo2sensors_source; 553 uint8_t source = settingsGetPointer()->ppo2sensors_source;
539 554
540 if(source == O2_SENSOR_SOURCE_OPTIC) 555 source++;
541 { 556 if(source == O2_SENSOR_SOURCE_MAX)
542 source = O2_SENSOR_SOURCE_ANALOG;
543 }
544 else
545 { 557 {
546 source = O2_SENSOR_SOURCE_OPTIC; 558 source = O2_SENSOR_SOURCE_OPTIC;
547 } 559 }
548 560
549 settingsGetPointer()->ppo2sensors_source = source; 561 settingsGetPointer()->ppo2sensors_source = source;