|
@@ -49,7 +49,7 @@
|
49
|
49
|
|
50
|
50
|
bool dac_present = false;
|
51
|
51
|
const uint8_t dac_order[NUM_AXIS] = DAC_STEPPER_ORDER;
|
52
|
|
- uint16_t dac_channel_pct[XYZE];
|
|
52
|
+ uint16_t dac_channel_pct[XYZE] = DAC_STEPPER_DFLT;
|
53
|
53
|
|
54
|
54
|
int dac_init() {
|
55
|
55
|
#if PIN_EXISTS(DAC_DISABLE)
|
|
@@ -64,6 +64,11 @@
|
64
|
64
|
|
65
|
65
|
mcp4728_setVref_all(DAC_STEPPER_VREF);
|
66
|
66
|
mcp4728_setGain_all(DAC_STEPPER_GAIN);
|
|
67
|
+
|
|
68
|
+ if (mcp4728_getDrvPct(0) < 1 || mcp4728_getDrvPct(1) < 1 || mcp4728_getDrvPct(2) < 1 || mcp4728_getDrvPct(3) < 1 ) {
|
|
69
|
+ mcp4728_setDrvPct(dac_channel_pct);
|
|
70
|
+ mcp4728_eepromWrite();
|
|
71
|
+ }
|
67
|
72
|
|
68
|
73
|
return 0;
|
69
|
74
|
}
|