Browse Source

Fix get/setDrvPct declarations

Dave Johnson 7 years ago
parent
commit
7864b133a8
2 changed files with 4 additions and 4 deletions
  1. 2
    2
      Marlin/dac_mcp4728.cpp
  2. 2
    2
      Marlin/dac_mcp4728.h

+ 2
- 2
Marlin/dac_mcp4728.cpp View File

@@ -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
 }

+ 2
- 2
Marlin/dac_mcp4728.h View File

@@ -59,8 +59,8 @@ uint8_t mcp4728_setGain_all(uint8_t value);
59 59
 uint16_t mcp4728_getValue(uint8_t channel);
60 60
 uint8_t mcp4728_fastWrite();
61 61
 uint8_t mcp4728_simpleCommand(byte simpleCommand);
62
-uint16_t mcp4728_getDrvPct(uint8_t channel);
63
-void mcp4728_setDrvPct(uint16_t pct[XYZE]);
62
+uint8_t mcp4728_getDrvPct(uint8_t channel);
63
+void mcp4728_setDrvPct(uint8_t pct[XYZE]);
64 64
 
65 65
 #endif
66 66
 #endif // DAC_MCP4728_H

Loading…
Cancel
Save