mirror of
https://github.com/tinygo-org/tinygo.git
synced 2026-08-17 19:23:25 +00:00
stm32: use stm32-rs SVDs which are of much higher quality
This commit changes the number of wait states for the stm32f103 chip to 2 instead of 4. This gets it back in line with the datasheet, but it also has the side effect of breaking I2C. Therefore, another (seemingly unrelated) change is needed: the i2cTimeout constant must be increased to a higher value to adjust to the lower flash wait states - presumably because the lower number of wait states allows the chip to run code faster.
This commit is contained in:
committed by
Ron Evans
parent
65caf777dd
commit
154c7c691b
@@ -1,4 +1,4 @@
|
||||
// +build stm32,!stm32f103xx,!stm32f407,!stm32f7x2,!stm32l0
|
||||
// +build stm32,!stm32f103,!stm32f407,!stm32f7x2,!stm32l0
|
||||
|
||||
package machine
|
||||
|
||||
@@ -110,10 +110,10 @@ type (
|
||||
)
|
||||
|
||||
func (sa address7Bit) toRead() uint32 {
|
||||
return uint32(((uint8(sa) << 1) | uint8(stm32.I2C_OAR1_ADD0)) & 0xFF)
|
||||
return uint32(((uint8(sa) << 1) | 1) & 0xFF)
|
||||
}
|
||||
func (sa address7Bit) toWrite() uint32 {
|
||||
return uint32(((uint8(sa) << 1) & ^(uint8(stm32.I2C_OAR1_ADD0))) & 0xFF)
|
||||
return uint32((uint8(sa) << 1) & 0xFF)
|
||||
}
|
||||
func (sa address7Bit) bitSize() uint8 { return 7 } // 7-bit addresses
|
||||
|
||||
|
||||
Reference in New Issue
Block a user