Skip to content

Commit 7c137ac

Browse files
committed
uartF0
1 parent b423de6 commit 7c137ac

File tree

6 files changed

+1859
-8
lines changed

6 files changed

+1859
-8
lines changed

cores/arduino/stm32/uart.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@
4646
/** @addtogroup STM32F4xx_System_Private_Includes
4747
* @{
4848
*/
49+
#ifndef STM32F0xx
4950
#include "stm32_def.h"
5051
#include "hw_config.h"
5152
#include "uart.h"
@@ -763,5 +764,5 @@ void HAL_UART_Emul_RxCpltCallback(UART_Emul_HandleTypeDef *huart)
763764
#ifdef __cplusplus
764765
}
765766
#endif
766-
767+
#endif
767768
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

cores/arduino/stm32/uart.h

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,14 @@
4949

5050
/* Exported types ------------------------------------------------------------*/
5151
typedef enum {
52-
USART3_E = 0,
53-
USART6_E = 1,
52+
#ifdef STM32F0xx
53+
USART1_E = 0,
54+
USART2_E = 1,
55+
USART4_E = 2,
56+
#else
57+
USART3_E = 0,
58+
USART6_E = 1,
59+
#endif
5460
NB_UART_MANAGED,
5561
} uart_id_e;
5662

@@ -87,8 +93,11 @@ int8_t uart_emul_read(uart_emul_id_e uart_id);
8793
size_t uart_emul_write(uart_emul_id_e uart_id, uint8_t data);
8894
int8_t uart_emul_peek(uart_emul_id_e uart_id);
8995
void uart_emul_flush(uart_emul_id_e uart_id);
96+
#ifdef STM32F0xx
97+
void uart_emul_attached_handler(void (*irqHandle)(void));
98+
#else
9099
void uart_emul_attached_handler(stimer_t *obj, void (*irqHandle)(void));
91-
100+
#endif
92101
#ifdef __cplusplus
93102
}
94103
#endif

0 commit comments

Comments
 (0)