mirror of
https://github.com/Klipper3d/klipper.git
synced 2025-12-16 05:09:56 +01:00
ldc1612: fix data rate calculation
There is no need to remove 4 from data rate. Formula for conversion time is: (RCOUNT0×16)/ƒREF0 Signed-off-by: Timofey Titovets <nefelim4ag@gmail.com>
This commit is contained in:
committed by
KevinOConnor
parent
2e88d8b5df
commit
f9108496a1
@@ -176,7 +176,7 @@ class LDC1612:
|
||||
"(e.g. faulty wiring) or a faulty ldc1612 chip."
|
||||
% (manuf_id, dev_id, LDC1612_MANUF_ID, LDC1612_DEV_ID))
|
||||
# Setup chip in requested query rate
|
||||
rcount0 = self.frequency / (16. * (self.data_rate - 4))
|
||||
rcount0 = self.frequency / (16. * self.data_rate)
|
||||
self.set_reg(REG_RCOUNT0, int(rcount0 + 0.5))
|
||||
self.set_reg(REG_OFFSET0, 0)
|
||||
self.set_reg(REG_SETTLECOUNT0, int(SETTLETIME*self.frequency/16. + .5))
|
||||
|
||||
Reference in New Issue
Block a user