diff --git a/src/sensor_ads1220.c b/src/sensor_ads1220.c index 93d52b6ae..fdf770cf6 100644 --- a/src/sensor_ads1220.c +++ b/src/sensor_ads1220.c @@ -97,9 +97,7 @@ ads1220_read_adc(struct ads1220_adc *ads1220, uint8_t oid) counts |= 0xFF000000; // endstop is optional, report if enabled and no errors - if (ads1220->ta) { - trigger_analog_update(ads1220->ta, counts); - } + trigger_analog_update(ads1220->ta, counts); add_sample(ads1220, oid, counts); } diff --git a/src/sensor_hx71x.c b/src/sensor_hx71x.c index 2c09e97af..7d869d9d5 100644 --- a/src/sensor_hx71x.c +++ b/src/sensor_hx71x.c @@ -178,7 +178,7 @@ hx71x_read_adc(struct hx71x_adc *hx71x, uint8_t oid) } // probe is optional, report if enabled - if (hx71x->last_error == 0 && hx71x->ta) { + if (hx71x->last_error == 0) { trigger_analog_update(hx71x->ta, counts); } diff --git a/src/trigger_analog.c b/src/trigger_analog.c index df64a4f40..fafc63fc6 100644 --- a/src/trigger_analog.c +++ b/src/trigger_analog.c @@ -76,6 +76,9 @@ trigger_error(struct trigger_analog *ta, uint8_t error_code) void trigger_analog_update(struct trigger_analog *ta, const int32_t sample) { + if (!ta) + return; + // only process samples when homing uint8_t is_homing = is_flag_set(FLAG_IS_HOMING, ta); if (!is_homing) {