conditional compilation updated
This commit is contained in:
parent
da2c963893
commit
6b1cf99066
@ -1481,9 +1481,9 @@ void setup()
|
|||||||
setup_fan_interrupt();
|
setup_fan_interrupt();
|
||||||
#endif //DEBUG_DISABLE_FANCHECK
|
#endif //DEBUG_DISABLE_FANCHECK
|
||||||
|
|
||||||
#ifdef FILAMENT_SENSOR
|
#ifdef PAT9125
|
||||||
fsensor_setup_interrupt();
|
fsensor_setup_interrupt();
|
||||||
#endif //FILAMENT_SENSOR
|
#endif //PAT9125
|
||||||
for (int i = 0; i<4; i++) EEPROM_read_B(EEPROM_BOWDEN_LENGTH + i * 2, &bowden_length[i]);
|
for (int i = 0; i<4; i++) EEPROM_read_B(EEPROM_BOWDEN_LENGTH + i * 2, &bowden_length[i]);
|
||||||
|
|
||||||
#ifndef DEBUG_DISABLE_STARTMSGS
|
#ifndef DEBUG_DISABLE_STARTMSGS
|
||||||
|
@ -388,7 +388,7 @@ bool fsensor_oq_result(void)
|
|||||||
printf_P(_N("fsensor_oq_result %S\n"), (res?_OK:_NG));
|
printf_P(_N("fsensor_oq_result %S\n"), (res?_OK:_NG));
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
#ifdef PAT9125
|
||||||
ISR(FSENSOR_INT_PIN_VECT)
|
ISR(FSENSOR_INT_PIN_VECT)
|
||||||
{
|
{
|
||||||
if (mmu_enabled || ir_sensor_detected) return;
|
if (mmu_enabled || ir_sensor_detected) return;
|
||||||
@ -475,6 +475,23 @@ ISR(FSENSOR_INT_PIN_VECT)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void fsensor_setup_interrupt(void)
|
||||||
|
{
|
||||||
|
|
||||||
|
pinMode(FSENSOR_INT_PIN, OUTPUT);
|
||||||
|
digitalWrite(FSENSOR_INT_PIN, LOW);
|
||||||
|
fsensor_int_pin_old = 0;
|
||||||
|
|
||||||
|
//pciSetup(FSENSOR_INT_PIN);
|
||||||
|
// !!! "pciSetup()" does not provide the correct results for some MCU pins
|
||||||
|
// so interrupt registers settings:
|
||||||
|
FSENSOR_INT_PIN_PCMSK_REG |= bit(FSENSOR_INT_PIN_PCMSK_BIT); // enable corresponding PinChangeInterrupt (individual pin)
|
||||||
|
PCIFR |= bit(FSENSOR_INT_PIN_PCICR_BIT); // clear previous occasional interrupt (set of pins)
|
||||||
|
PCICR |= bit(FSENSOR_INT_PIN_PCICR_BIT); // enable corresponding PinChangeInterrupt (set of pins)
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif //PAT9125
|
||||||
|
|
||||||
void fsensor_st_block_begin(block_t* bl)
|
void fsensor_st_block_begin(block_t* bl)
|
||||||
{
|
{
|
||||||
if (!fsensor_enabled) return;
|
if (!fsensor_enabled) return;
|
||||||
@ -569,18 +586,3 @@ void fsensor_update(void)
|
|||||||
}
|
}
|
||||||
#endif //PAT9125
|
#endif //PAT9125
|
||||||
}
|
}
|
||||||
|
|
||||||
void fsensor_setup_interrupt(void)
|
|
||||||
{
|
|
||||||
|
|
||||||
pinMode(FSENSOR_INT_PIN, OUTPUT);
|
|
||||||
digitalWrite(FSENSOR_INT_PIN, LOW);
|
|
||||||
fsensor_int_pin_old = 0;
|
|
||||||
|
|
||||||
//pciSetup(FSENSOR_INT_PIN);
|
|
||||||
// !!! "pciSetup()" does not provide the correct results for some MCU pins
|
|
||||||
// so interrupt registers settings:
|
|
||||||
FSENSOR_INT_PIN_PCMSK_REG |= bit(FSENSOR_INT_PIN_PCMSK_BIT); // enable corresponding PinChangeInterrupt (individual pin)
|
|
||||||
PCIFR |= bit(FSENSOR_INT_PIN_PCICR_BIT); // clear previous occasional interrupt (set of pins)
|
|
||||||
PCICR |= bit(FSENSOR_INT_PIN_PCICR_BIT); // enable corresponding PinChangeInterrupt (set of pins)
|
|
||||||
}
|
|
||||||
|
@ -35,13 +35,13 @@ extern bool fsensor_autoload_enabled;
|
|||||||
extern void fsensor_autoload_set(bool State);
|
extern void fsensor_autoload_set(bool State);
|
||||||
|
|
||||||
extern void fsensor_update(void);
|
extern void fsensor_update(void);
|
||||||
|
#ifdef PAT9125
|
||||||
//! setup pin-change interrupt
|
//! setup pin-change interrupt
|
||||||
extern void fsensor_setup_interrupt(void);
|
extern void fsensor_setup_interrupt(void);
|
||||||
|
|
||||||
//! @name autoload support
|
//! @name autoload support
|
||||||
//! @{
|
//! @{
|
||||||
#ifdef PAT9125
|
|
||||||
extern void fsensor_autoload_check_start(void);
|
extern void fsensor_autoload_check_start(void);
|
||||||
extern void fsensor_autoload_check_stop(void);
|
extern void fsensor_autoload_check_stop(void);
|
||||||
#endif //PAT9125
|
#endif //PAT9125
|
||||||
|
Loading…
Reference in New Issue
Block a user