Browse Source

stm32: fix timeout for i2c comms

ticks changed to 16ns causing timeouts to be very, very short.  This change updates timeouts for 16ns ticks.
pull/2321/head
Kenneth Bell 3 years ago
committed by Ron Evans
parent
commit
6cbaed75c8
  1. 6
      src/machine/machine_stm32_i2c_revb.go

6
src/machine/machine_stm32_i2c_revb.go

@ -1,3 +1,4 @@
//go:build stm32l5 || stm32f7 || stm32l4 || stm32l0
// +build stm32l5 stm32f7 stm32l4 stm32l0
package machine
@ -27,7 +28,10 @@ const (
const (
MAX_NBYTE_SIZE = 255
TIMEOUT_TICKS = 100 // 100ms
// 100ms delay = 100e6ns / 16ns
// In runtime_stm32_timers.go, tick is fixed at 16ns per tick
TIMEOUT_TICKS = 100e6 / 16
I2C_NO_STARTSTOP = 0x0
I2C_GENERATE_START_WRITE = 0x80000000 | stm32.I2C_CR2_START

Loading…
Cancel
Save