|
@@ -114,13 +114,13 @@ uint16_t mcp4728_getVout(uint8_t channel) {
|
114
|
114
|
/**
|
115
|
115
|
* Returns DAC values as a 0-100 percentage of drive strength
|
116
|
116
|
*/
|
117
|
|
-uint16_t mcp4728_getDrvPct(uint8_t channel) { return uint16_t(100.0 * mcp4728_values[channel] / (DAC_STEPPER_MAX) + 0.5); }
|
|
117
|
+uint8_t mcp4728_getDrvPct(uint8_t channel) { return uint8_t(100.0 * mcp4728_values[channel] / (DAC_STEPPER_MAX) + 0.5); }
|
118
|
118
|
|
119
|
119
|
/**
|
120
|
120
|
* Receives all Drive strengths as 0-100 percent values, updates
|
121
|
121
|
* DAC Values array and calls fastwrite to update the DAC.
|
122
|
122
|
*/
|
123
|
|
-void mcp4728_setDrvPct(uint16_t pct[XYZE]) {
|
|
123
|
+void mcp4728_setDrvPct(uint8_t pct[XYZE]) {
|
124
|
124
|
LOOP_XYZE(i) mcp4728_values[i] = 0.01 * pct[i] * (DAC_STEPPER_MAX);
|
125
|
125
|
mcp4728_fastWrite();
|
126
|
126
|
}
|