From fcdaa83368f80536c3e5874e6449971cfc2ee0d6 Mon Sep 17 00:00:00 2001 From: Kenneth Bell Date: Thu, 24 Dec 2020 08:11:15 -0800 Subject: [PATCH] stm32-l5: corrected alt function and other review comments --- src/machine/machine_stm32_uart.go | 2 +- src/machine/machine_stm32l5.go | 2 -- targets/cortex-m33.json | 4 ++-- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/machine/machine_stm32_uart.go b/src/machine/machine_stm32_uart.go index a3a99cd1..5f065f4f 100644 --- a/src/machine/machine_stm32_uart.go +++ b/src/machine/machine_stm32_uart.go @@ -16,7 +16,7 @@ type UART struct { Buffer *RingBuffer Bus *stm32.USART_Type Interrupt interrupt.Interrupt - AltFuncSelector stm32.AltFunc + AltFuncSelector uint8 // Registers specific to the chip rxReg *volatile.Register32 diff --git a/src/machine/machine_stm32l5.go b/src/machine/machine_stm32l5.go index 185bdfb7..95defa9c 100644 --- a/src/machine/machine_stm32l5.go +++ b/src/machine/machine_stm32l5.go @@ -219,7 +219,6 @@ func enableAltFuncClock(bus unsafe.Pointer) { stm32.RCC.APB1ENR1.SetBits(stm32.RCC_APB1ENR1_TIM3EN) case unsafe.Pointer(stm32.TIM2): // TIM2 clock enable stm32.RCC.APB1ENR1.SetBits(stm32.RCC_APB1ENR1_TIM2EN) - case unsafe.Pointer(stm32.UCPD1): // UCPD1 clock enable stm32.RCC.APB1ENR2.SetBits(stm32.RCC_APB1ENR2_UCPD1EN) case unsafe.Pointer(stm32.FDCAN1): // FDCAN1 clock enable @@ -232,7 +231,6 @@ func enableAltFuncClock(bus unsafe.Pointer) { stm32.RCC.APB1ENR2.SetBits(stm32.RCC_APB1ENR2_I2C4EN) case unsafe.Pointer(stm32.LPUART1): // LPUART1 clock enable stm32.RCC.APB1ENR2.SetBits(stm32.RCC_APB1ENR2_LPUART1EN) - case unsafe.Pointer(stm32.TIM17): // TIM17 clock enable stm32.RCC.APB2ENR.SetBits(stm32.RCC_APB2ENR_TIM17EN) case unsafe.Pointer(stm32.TIM16): // TIM16 clock enable diff --git a/targets/cortex-m33.json b/targets/cortex-m33.json index d15354f8..8e4a893c 100644 --- a/targets/cortex-m33.json +++ b/targets/cortex-m33.json @@ -1,7 +1,7 @@ { - "inherits": ["cortex-m"], + "inherits": ["cortex-m"], "llvm-target": "armv7m-none-eabi", - "cflags": [ + "cflags": [ "--target=armv7m-none-eabi", "-mfloat-abi=soft", "-Qunused-arguments"