stm32: fix timeout for i2c comms

ticks changed to 16ns causing timeouts to be very, very short.  This change updates timeouts for 16ns ticks.
Этот коммит содержится в:
Kenneth Bell 2021-11-25 22:03:55 +00:00 коммит произвёл Ron Evans
родитель a6200920f7
коммит 6cbaed75c8

Просмотреть файл

@ -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