pwm_pin - Fix DutyCycle() parse error, need to trim off trailing '\n' before calling strconv.Atoi(), as other functions in this package do
This commit is contained in:
parent
515c4e8288
commit
c3f4b1f6f8
|
@ -148,7 +148,8 @@ func (p *PWMPin) DutyCycle() (duty uint32, err error) {
|
|||
return
|
||||
}
|
||||
|
||||
val, e := strconv.Atoi(string(buf))
|
||||
v := bytes.TrimRight(buf, "\n")
|
||||
val, e := strconv.Atoi(string(v))
|
||||
return uint32(val), e
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue