From 83510ed4896ae1613e8b4a4490bf47a0c45ff7d0 Mon Sep 17 00:00:00 2001 From: PavelSindler Date: Mon, 28 Jan 2019 17:27:16 +0100 Subject: [PATCH] check_for_ir_sensor --- Firmware/fsensor.cpp | 4 ++-- Firmware/mmu.cpp | 7 +++++-- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/Firmware/fsensor.cpp b/Firmware/fsensor.cpp index c0654ee2f..9aaad398f 100644 --- a/Firmware/fsensor.cpp +++ b/Firmware/fsensor.cpp @@ -180,11 +180,11 @@ bool fsensor_enable(void) eeprom_update_byte((uint8_t*)EEPROM_FSENSOR, 0x01); FSensorStateMenu = 1; } -#else +#else // PAT9125 fsensor_enabled = true; eeprom_update_byte((uint8_t*)EEPROM_FSENSOR, 0x01); FSensorStateMenu = 1; -#endif +#endif // PAT9125 return fsensor_enabled; } diff --git a/Firmware/mmu.cpp b/Firmware/mmu.cpp index 790823493..9cca3a7bf 100644 --- a/Firmware/mmu.cpp +++ b/Firmware/mmu.cpp @@ -119,12 +119,14 @@ void mmu_init(void) PIN_SET(IR_SENSOR_PIN); //pullup } -//returns true if idler IR sensor was detected, otherwise returns false + +//if IR_SENSOR defined, always returns true +//otherwise check for ir sensor and returns true if idler IR sensor was detected, otherwise returns false bool check_for_ir_sensor() { #ifdef IR_SENSOR return true; -#endif //IR_SENSOR +#else //IR_SENSOR bool detected = false; //if IR_SENSOR_PIN input is low and pat9125sensor is not present we detected idler sensor @@ -142,6 +144,7 @@ bool check_for_ir_sensor() //printf_P(PSTR("Idler IR sensor not detected\n")); } return detected; +#endif //IR_SENSOR } //mmu main loop - state machine processing