|
@@ -33,7 +33,7 @@
|
33
|
33
|
|
34
|
34
|
bool dac_present = false;
|
35
|
35
|
constexpr xyze_uint8_t dac_order = DAC_STEPPER_ORDER;
|
36
|
|
-xyze_uint8_t dac_channel_pct = DAC_MOTOR_CURRENT_DEFAULT;
|
|
36
|
+xyze_uint_t dac_channel_pct = DAC_MOTOR_CURRENT_DEFAULT;
|
37
|
37
|
|
38
|
38
|
StepperDAC stepper_dac;
|
39
|
39
|
|
|
@@ -72,8 +72,8 @@ void StepperDAC::set_current_percent(const uint8_t channel, float val) {
|
72
|
72
|
set_current_value(channel, _MIN(val, 100.0f) * (DAC_STEPPER_MAX) / 100.0f);
|
73
|
73
|
}
|
74
|
74
|
|
75
|
|
-static float dac_perc(int8_t n) { return 100.0 * mcp4728.getValue(dac_order[n]) * RECIPROCAL(DAC_STEPPER_MAX); }
|
76
|
|
-static float dac_amps(int8_t n) { return mcp4728.getDrvPct(dac_order[n]) * (DAC_STEPPER_MAX) * 0.125 * RECIPROCAL(DAC_STEPPER_SENSE); }
|
|
75
|
+static float dac_perc(int8_t n) { return mcp4728.getDrvPct(dac_order[n]); }
|
|
76
|
+static float dac_amps(int8_t n) { return mcp4728.getValue(dac_order[n]) * 0.125 * RECIPROCAL(DAC_STEPPER_SENSE * 1000); }
|
77
|
77
|
|
78
|
78
|
uint8_t StepperDAC::get_current_percent(const AxisEnum axis) { return mcp4728.getDrvPct(dac_order[axis]); }
|
79
|
79
|
void StepperDAC::set_current_percents(xyze_uint8_t &pct) {
|