mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-05 03:27:48 +00:00
stm32: fix timeout for i2c comms
ticks changed to 16ns causing timeouts to be very, very short. This change updates timeouts for 16ns ticks.
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user