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
 /**
114
 /**
115
  * Returns DAC values as a 0-100 percentage of drive strength
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
  * Receives all Drive strengths as 0-100 percent values, updates
120
  * Receives all Drive strengths as 0-100 percent values, updates
121
  * DAC Values array and calls fastwrite to update the DAC.
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
   LOOP_XYZE(i) mcp4728_values[i] = 0.01 * pct[i] * (DAC_STEPPER_MAX);
124
   LOOP_XYZE(i) mcp4728_values[i] = 0.01 * pct[i] * (DAC_STEPPER_MAX);
125
   mcp4728_fastWrite();
125
   mcp4728_fastWrite();
126
 }
126
 }

+ 2
- 2
Marlin/dac_mcp4728.h View File

59
 uint16_t mcp4728_getValue(uint8_t channel);
59
 uint16_t mcp4728_getValue(uint8_t channel);
60
 uint8_t mcp4728_fastWrite();
60
 uint8_t mcp4728_fastWrite();
61
 uint8_t mcp4728_simpleCommand(byte simpleCommand);
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
 #endif
65
 #endif
66
 #endif // DAC_MCP4728_H
66
 #endif // DAC_MCP4728_H

Loading…
Cancel
Save