mirror of
https://github.com/zapta/simple_stepper_motor_analyzer.git
synced 2025-10-29 22:59:32 -07:00
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:
@@ -296,7 +296,7 @@ static inline void isr_update_full_steps_counter(int increment) {
|
||||
//
|
||||
// We use these filters to reduce internal and external noise.
|
||||
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
|
||||
// one pair of ADC1, ADC2 readings, analyzes it, and updates the
|
||||
|
||||
@@ -17,7 +17,7 @@ static const SensorSpec GMR_2P5_SENSOR("G2P5A", 2500, 0.4);
|
||||
// ACS712ELCTR-05B-T
|
||||
// We limit the range to 3A since this is the
|
||||
// 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);
|
||||
|
||||
@@ -51,13 +51,13 @@ static Level determine_level() {
|
||||
}
|
||||
|
||||
static const SensorSpec* determine_sensor() {
|
||||
//return &HAUL_5A_SENSOR;
|
||||
const PinState pin_state = determine_config_pin_state(SENSORS_PIN);
|
||||
switch (pin_state) {
|
||||
case STATE_FLOAT:
|
||||
return &GMR_2P5_SENSOR;
|
||||
case STATE_DOWN:
|
||||
return &HAUL_5A_SENSOR;
|
||||
// Reserved for a future sernsor.
|
||||
return &UNKNOWN_SENSOR;
|
||||
case STATE_UP:
|
||||
default:
|
||||
return &UNKNOWN_SENSOR;
|
||||
|
||||
@@ -44,12 +44,11 @@ struct HardwareConfig {
|
||||
Level level;
|
||||
const SensorSpec* sensor_spec;
|
||||
HardwareConfig(Level l, const SensorSpec* s) : level(l), sensor_spec(s) {}
|
||||
/// HardwareConfig() : HardwareConfig(LEVEL_UNKNOWN, SENSOR_UNKNOWN) {}
|
||||
};
|
||||
|
||||
HardwareConfig determine();
|
||||
|
||||
// Should call determine() before calling these.
|
||||
// Should call determine() at least once before calling these.
|
||||
const HardwareConfig& config();
|
||||
|
||||
inline const SensorSpec* sensor_spec() { return config().sensor_spec; }
|
||||
|
||||
Reference in New Issue
Block a user