optimisation: use expired_cont is specific places
!variable.running() || variable.expired() is equal to variable.expired_cont() The latter required less flash memory Change in memory: Flash: -28 bytes SRAM: 0 bytes
This commit is contained in:
parent
00ffab8f62
commit
d175dba669
|
|
@ -498,7 +498,7 @@ bool PAT9125_sensor::updatePAT9125() {
|
|||
}
|
||||
}
|
||||
|
||||
if (!pollingTimer.running() || pollingTimer.expired(pollingPeriod)) {
|
||||
if (pollingTimer.expired_cont(pollingPeriod)) {
|
||||
pollingTimer.start();
|
||||
if (!pat9125_update()) {
|
||||
init(); // try to reinit.
|
||||
|
|
|
|||
|
|
@ -2261,7 +2261,7 @@ static void check_min_temp_raw()
|
|||
if(target_temperature_isr[active_extruder]>minttemp[active_extruder]) {
|
||||
// ~ nozzle heating is on
|
||||
bCheckingOnHeater=bCheckingOnHeater||(current_temperature_isr[active_extruder]>(minttemp[active_extruder]+TEMP_HYSTERESIS)); // for eventually delay cutting
|
||||
if(oTimer4minTempHeater.expired(HEATER_MINTEMP_DELAY)||(!oTimer4minTempHeater.running())||bCheckingOnHeater) {
|
||||
if(oTimer4minTempHeater.expired_cont(HEATER_MINTEMP_DELAY) || bCheckingOnHeater) {
|
||||
bCheckingOnHeater=true; // not necessary
|
||||
check_min_temp_heater0(); // delay is elapsed or temperature is/was over minTemp => periodical checking is active
|
||||
}
|
||||
|
|
@ -2275,7 +2275,7 @@ static void check_min_temp_raw()
|
|||
if(target_temperature_bed_isr>BED_MINTEMP) {
|
||||
// ~ bed heating is on
|
||||
bCheckingOnBed=bCheckingOnBed||(current_temperature_bed_isr>(BED_MINTEMP+TEMP_HYSTERESIS)); // for eventually delay cutting
|
||||
if(oTimer4minTempBed.expired(BED_MINTEMP_DELAY)||(!oTimer4minTempBed.running())||bCheckingOnBed) {
|
||||
if(oTimer4minTempBed.expired_cont(BED_MINTEMP_DELAY) || bCheckingOnBed) {
|
||||
bCheckingOnBed=true; // not necessary
|
||||
check_min_temp_bed(); // delay is elapsed or temperature is/was over minTemp => periodical checking is active
|
||||
}
|
||||
|
|
|
|||
|
|
@ -357,7 +357,7 @@ bool tmc2130_wait_standstill_xy(int timeout)
|
|||
|
||||
void tmc2130_check_overtemp()
|
||||
{
|
||||
if (tmc2130_overtemp_timer.expired(1000) || !tmc2130_overtemp_timer.running())
|
||||
if (tmc2130_overtemp_timer.expired_cont(1000))
|
||||
{
|
||||
for (uint_least8_t i = 0; i < 4; i++)
|
||||
{
|
||||
|
|
|
|||
Loading…
Reference in New Issue