check_for_ir_sensor
This commit is contained in:
parent
8fe2d1de9a
commit
83510ed489
|
|
@ -180,11 +180,11 @@ bool fsensor_enable(void)
|
||||||
eeprom_update_byte((uint8_t*)EEPROM_FSENSOR, 0x01);
|
eeprom_update_byte((uint8_t*)EEPROM_FSENSOR, 0x01);
|
||||||
FSensorStateMenu = 1;
|
FSensorStateMenu = 1;
|
||||||
}
|
}
|
||||||
#else
|
#else // PAT9125
|
||||||
fsensor_enabled = true;
|
fsensor_enabled = true;
|
||||||
eeprom_update_byte((uint8_t*)EEPROM_FSENSOR, 0x01);
|
eeprom_update_byte((uint8_t*)EEPROM_FSENSOR, 0x01);
|
||||||
FSensorStateMenu = 1;
|
FSensorStateMenu = 1;
|
||||||
#endif
|
#endif // PAT9125
|
||||||
return fsensor_enabled;
|
return fsensor_enabled;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -119,12 +119,14 @@ void mmu_init(void)
|
||||||
PIN_SET(IR_SENSOR_PIN); //pullup
|
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()
|
bool check_for_ir_sensor()
|
||||||
{
|
{
|
||||||
#ifdef IR_SENSOR
|
#ifdef IR_SENSOR
|
||||||
return true;
|
return true;
|
||||||
#endif //IR_SENSOR
|
#else //IR_SENSOR
|
||||||
|
|
||||||
bool detected = false;
|
bool detected = false;
|
||||||
//if IR_SENSOR_PIN input is low and pat9125sensor is not present we detected idler sensor
|
//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"));
|
//printf_P(PSTR("Idler IR sensor not detected\n"));
|
||||||
}
|
}
|
||||||
return detected;
|
return detected;
|
||||||
|
#endif //IR_SENSOR
|
||||||
}
|
}
|
||||||
|
|
||||||
//mmu main loop - state machine processing
|
//mmu main loop - state machine processing
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue