Fix get/setDrvPct declarations

This commit is contained in:
Dave Johnson
2017-06-09 20:20:02 -07:00
parent 0b6b7c9c7e
commit 7864b133a8
2 changed files with 4 additions and 4 deletions

View File

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