Set filtering of the second channel to 700 as well (was a typo) and removed the detection of the HAUL 5A which is not in use, reserving it to a future sensor.

This commit is contained in:
Zapta
2021-10-09 15:41:25 -07:00
parent 75b80f5f71
commit e881e22304
3 changed files with 5 additions and 6 deletions

View File

@@ -296,7 +296,7 @@ static inline void isr_update_full_steps_counter(int increment) {
// //
// We use these filters to reduce internal and external noise. // We use these filters to reduce internal and external noise.
static filters::Adc12BitsLowPassFilter<700> signal1_filter; static filters::Adc12BitsLowPassFilter<700> signal1_filter;
static filters::Adc12BitsLowPassFilter<400> signal2_filter; static filters::Adc12BitsLowPassFilter<700> signal2_filter;
// This function performs the bulk of the IRQ processing. It accepts // This function performs the bulk of the IRQ processing. It accepts
// one pair of ADC1, ADC2 readings, analyzes it, and updates the // one pair of ADC1, ADC2 readings, analyzes it, and updates the

View File

@@ -17,7 +17,7 @@ static const SensorSpec GMR_2P5_SENSOR("G2P5A", 2500, 0.4);
// ACS712ELCTR-05B-T // ACS712ELCTR-05B-T
// We limit the range to 3A since this is the // We limit the range to 3A since this is the
// most 3D printer use cases fall here. // most 3D printer use cases fall here.
static SensorSpec HAUL_5A_SENSOR("H5A", 3000, 0.185); //static SensorSpec HAUL_5A_SENSOR("H5A", 3000, 0.185);
static HardwareConfig hardware_config(LEVEL_UNKNOWN, &UNKNOWN_SENSOR); static HardwareConfig hardware_config(LEVEL_UNKNOWN, &UNKNOWN_SENSOR);
@@ -51,13 +51,13 @@ static Level determine_level() {
} }
static const SensorSpec* determine_sensor() { static const SensorSpec* determine_sensor() {
//return &HAUL_5A_SENSOR;
const PinState pin_state = determine_config_pin_state(SENSORS_PIN); const PinState pin_state = determine_config_pin_state(SENSORS_PIN);
switch (pin_state) { switch (pin_state) {
case STATE_FLOAT: case STATE_FLOAT:
return &GMR_2P5_SENSOR; return &GMR_2P5_SENSOR;
case STATE_DOWN: case STATE_DOWN:
return &HAUL_5A_SENSOR; // Reserved for a future sernsor.
return &UNKNOWN_SENSOR;
case STATE_UP: case STATE_UP:
default: default:
return &UNKNOWN_SENSOR; return &UNKNOWN_SENSOR;

View File

@@ -44,12 +44,11 @@ struct HardwareConfig {
Level level; Level level;
const SensorSpec* sensor_spec; const SensorSpec* sensor_spec;
HardwareConfig(Level l, const SensorSpec* s) : level(l), sensor_spec(s) {} HardwareConfig(Level l, const SensorSpec* s) : level(l), sensor_spec(s) {}
/// HardwareConfig() : HardwareConfig(LEVEL_UNKNOWN, SENSOR_UNKNOWN) {}
}; };
HardwareConfig determine(); HardwareConfig determine();
// Should call determine() before calling these. // Should call determine() at least once before calling these.
const HardwareConfig& config(); const HardwareConfig& config();
inline const SensorSpec* sensor_spec() { return config().sensor_spec; } inline const SensorSpec* sensor_spec() { return config().sensor_spec; }