Fix DAC setDrvPct (#20205)

This commit is contained in:
Orel
2020-11-20 01:08:21 +01:00
committed by GitHub
parent 19d0c985be
commit fe88fb7ed9
3 changed files with 6 additions and 6 deletions

View File

@@ -123,8 +123,8 @@ uint8_t MCP4728::getDrvPct(const uint8_t channel) { return uint8_t(100.0 * dac_v
* Receives all Drive strengths as 0-100 percent values, updates
* DAC Values array and calls fastwrite to update the DAC.
*/
void MCP4728::setDrvPct(xyze_uint8_t &pct) {
dac_values *= pct.asFloat() * 0.01f * (DAC_STEPPER_MAX);
void MCP4728::setDrvPct(xyze_uint_t &pct) {
dac_values = pct * (DAC_STEPPER_MAX) * 0.01f;
fastWrite();
}