Disable IR_SENSOR due to the injected ADC read for now
This is already reimplemented in the newer fsensor implementation
This commit is contained in:
parent
13163e9fbf
commit
306f77ccbd
2 changed files with 4 additions and 57 deletions
Firmware
|
@ -6,7 +6,8 @@
|
||||||
#include "pins.h"
|
#include "pins.h"
|
||||||
|
|
||||||
#if (defined(VOLT_IR_PIN) && defined(IR_SENSOR))
|
#if (defined(VOLT_IR_PIN) && defined(IR_SENSOR))
|
||||||
# define IR_SENSOR_ANALOG
|
// TODO: IR_SENSOR_ANALOG currently disabled as being incompatible with the new thermal regulation
|
||||||
|
// # define IR_SENSOR_ANALOG
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
//ADC configuration
|
//ADC configuration
|
||||||
|
|
|
@ -688,62 +688,8 @@ void fsensor_update(void)
|
||||||
{
|
{
|
||||||
if (READ(IR_SENSOR_PIN))
|
if (READ(IR_SENSOR_PIN))
|
||||||
{ // IR_SENSOR_PIN ~ H
|
{ // IR_SENSOR_PIN ~ H
|
||||||
#ifdef IR_SENSOR_ANALOG
|
fsensor_checkpoint_print();
|
||||||
if(!bIRsensorStateFlag)
|
fsensor_enque_M600();
|
||||||
{
|
|
||||||
bIRsensorStateFlag=true;
|
|
||||||
tIRsensorCheckTimer.start();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if(tIRsensorCheckTimer.expired(IR_SENSOR_STEADY))
|
|
||||||
{
|
|
||||||
uint8_t nMUX1,nMUX2;
|
|
||||||
uint16_t nADC;
|
|
||||||
bIRsensorStateFlag=false;
|
|
||||||
// sequence for direct data reading from AD converter
|
|
||||||
DISABLE_TEMPERATURE_INTERRUPT();
|
|
||||||
nMUX1=ADMUX; // ADMUX saving
|
|
||||||
nMUX2=ADCSRB;
|
|
||||||
adc_setmux(VOLT_IR_PIN);
|
|
||||||
ADCSRA|=(1<<ADSC); // first conversion after ADMUX change discarded (preventively)
|
|
||||||
while(ADCSRA&(1<<ADSC))
|
|
||||||
;
|
|
||||||
ADCSRA|=(1<<ADSC); // second conversion used
|
|
||||||
while(ADCSRA&(1<<ADSC))
|
|
||||||
;
|
|
||||||
nADC=ADC;
|
|
||||||
ADMUX=nMUX1; // ADMUX restoring
|
|
||||||
ADCSRB=nMUX2;
|
|
||||||
ENABLE_TEMPERATURE_INTERRUPT();
|
|
||||||
// end of sequence for ...
|
|
||||||
// Detection of correct function of fsensor v04 - it must NOT read >4.6V
|
|
||||||
// If it does, it means a disconnected cables or faulty board
|
|
||||||
if( (oFsensorPCB == ClFsensorPCB::_Rev04) && ( (nADC*OVERSAMPLENR) > IRsensor_Hopen_TRESHOLD ) )
|
|
||||||
{
|
|
||||||
fsensor_disable();
|
|
||||||
fsensor_not_responding = true;
|
|
||||||
printf_P(PSTR("IR sensor not responding (%d)!\n"),1);
|
|
||||||
if((ClFsensorActionNA)eeprom_read_byte((uint8_t*)EEPROM_FSENSOR_ACTION_NA)==ClFsensorActionNA::_Pause)
|
|
||||||
|
|
||||||
// if we are printing and FS action is set to "Pause", force pause the print
|
|
||||||
if(oFsensorActionNA==ClFsensorActionNA::_Pause)
|
|
||||||
lcd_pause_print();
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
#endif //IR_SENSOR_ANALOG
|
|
||||||
fsensor_checkpoint_print();
|
|
||||||
fsensor_enque_M600();
|
|
||||||
#ifdef IR_SENSOR_ANALOG
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{ // IR_SENSOR_PIN ~ L
|
|
||||||
bIRsensorStateFlag=false;
|
|
||||||
#endif //IR_SENSOR_ANALOG
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif //PAT9125
|
#endif //PAT9125
|
||||||
|
|
Loading…
Add table
Reference in a new issue