mirror of
https://github.com/paparazzi/paparazzi.git
synced 2026-05-27 17:06:31 +08:00
[uart] Fix stupid weak errors
This commit is contained in:
@@ -36,6 +36,27 @@
|
||||
// #define TRACE(fmt,args...) fprintf(stderr, fmt, args)
|
||||
#define TRACE(fmt,args...)
|
||||
|
||||
#if USE_UART0
|
||||
static inline void uart0_handler(void);
|
||||
#endif
|
||||
#if USE_UART1
|
||||
static inline void uart1_handler(void);
|
||||
#endif
|
||||
#if USE_UART2
|
||||
static inline void uart2_handler(void);
|
||||
#endif
|
||||
#if USE_UART3
|
||||
static inline void uart3_handler(void);
|
||||
#endif
|
||||
#if USE_UART4
|
||||
static inline void uart4_handler(void);
|
||||
#endif
|
||||
#if USE_UART5
|
||||
static inline void uart5_handler(void);
|
||||
#endif
|
||||
#if USE_UART6
|
||||
static inline void uart6_handler(void);
|
||||
#endif
|
||||
|
||||
void uart_periph_set_baudrate(struct uart_periph* periph, uint32_t baud) {
|
||||
struct SerialPort* port;
|
||||
@@ -117,6 +138,30 @@ static inline void uart_handler(struct uart_periph* periph) {
|
||||
|
||||
}
|
||||
|
||||
void uart_event(void) {
|
||||
#if USE_UART0
|
||||
uart0_handler();
|
||||
#endif
|
||||
#if USE_UART1
|
||||
uart1_handler();
|
||||
#endif
|
||||
#if USE_UART2
|
||||
uart2_handler();
|
||||
#endif
|
||||
#if USE_UART3
|
||||
uart3_handler();
|
||||
#endif
|
||||
#if USE_UART4
|
||||
uart4_handler();
|
||||
#endif
|
||||
#if USE_UART5
|
||||
uart5_handler();
|
||||
#endif
|
||||
#if USE_UART6
|
||||
uart6_handler();
|
||||
#endif
|
||||
}
|
||||
|
||||
#if USE_UART0
|
||||
void uart0_init( void ) {
|
||||
uart_periph_init(&uart0);
|
||||
@@ -124,7 +169,7 @@ void uart0_init( void ) {
|
||||
uart_periph_set_baudrate(&uart0, UART0_BAUD);
|
||||
}
|
||||
|
||||
void uart0_handler(void) {
|
||||
static inline void uart0_handler(void) {
|
||||
uart_handler(&uart0);
|
||||
}
|
||||
#endif /* USE_UART0 */
|
||||
@@ -136,7 +181,7 @@ void uart1_init( void ) {
|
||||
uart_periph_set_baudrate(&uart1, UART1_BAUD);
|
||||
}
|
||||
|
||||
void uart1_handler(void) {
|
||||
static inline void uart1_handler(void) {
|
||||
uart_handler(&uart1);
|
||||
}
|
||||
#endif /* USE_UART1 */
|
||||
@@ -148,7 +193,7 @@ void uart2_init(void) {
|
||||
uart_periph_set_baudrate(&uart2, UART2_BAUD);
|
||||
}
|
||||
|
||||
void uart2_handler(void) {
|
||||
static inline void uart2_handler(void) {
|
||||
uart_handler(&uart2);
|
||||
}
|
||||
#endif /* USE_UART2 */
|
||||
@@ -160,7 +205,7 @@ void uart3_init(void) {
|
||||
uart_periph_set_baudrate(&uart3, UART3_BAUD);
|
||||
}
|
||||
|
||||
void uart3_handler(void) {
|
||||
static inline void uart3_handler(void) {
|
||||
uart_handler(&uart3);
|
||||
}
|
||||
#endif /* USE_UART3 */
|
||||
@@ -172,7 +217,7 @@ void uart4_init(void) {
|
||||
uart_periph_set_baudrate(&uart4, UART4_BAUD);
|
||||
}
|
||||
|
||||
void uart4_handler(void) {
|
||||
static inline void uart4_handler(void) {
|
||||
uart_handler(&uart4);
|
||||
}
|
||||
#endif /* USE_UART4 */
|
||||
@@ -184,7 +229,7 @@ void uart5_init(void) {
|
||||
uart_periph_set_baudrate(&uart5, UART5_BAUD);
|
||||
}
|
||||
|
||||
void uart5_handler(void) {
|
||||
static inline void uart5_handler(void) {
|
||||
uart_handler(&uart5);
|
||||
}
|
||||
#endif /* USE_UART5 */
|
||||
@@ -196,7 +241,7 @@ void uart6_init(void) {
|
||||
uart_periph_set_baudrate(&uart6, UART6_BAUD);
|
||||
}
|
||||
|
||||
void uart6_handler(void) {
|
||||
static inline void uart6_handler(void) {
|
||||
uart_handler(&uart6);
|
||||
}
|
||||
#endif /* USE_UART6 */
|
||||
|
||||
@@ -214,25 +214,5 @@ uint8_t uart_getch(struct uart_periph* p) {
|
||||
}
|
||||
|
||||
void WEAK uart_event(void) {
|
||||
#if USE_UART0
|
||||
uart0_handler();
|
||||
#endif
|
||||
#if USE_UART1
|
||||
uart1_handler();
|
||||
#endif
|
||||
#if USE_UART2
|
||||
uart2_handler();
|
||||
#endif
|
||||
#if USE_UART3
|
||||
uart3_handler();
|
||||
#endif
|
||||
#if USE_UART4
|
||||
uart4_handler();
|
||||
#endif
|
||||
#if USE_UART5
|
||||
uart5_handler();
|
||||
#endif
|
||||
#if USE_UART6
|
||||
uart6_handler();
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ extern void uart_periph_set_mode(struct uart_periph* p, bool_t tx_enabled, bool_
|
||||
extern void uart_transmit(struct uart_periph* p, uint8_t data);
|
||||
extern bool_t uart_check_free_space(struct uart_periph* p, uint8_t len);
|
||||
extern uint8_t uart_getch(struct uart_periph* p);
|
||||
extern void WEAK uart_event(void);
|
||||
extern void uart_event(void);
|
||||
|
||||
/**
|
||||
* Check UART for available chars in receive buffer.
|
||||
@@ -99,7 +99,6 @@ static inline uint16_t uart_char_available(struct uart_periph* p) {
|
||||
#if USE_UART0
|
||||
extern struct uart_periph uart0;
|
||||
extern void uart0_init(void);
|
||||
extern void WEAK uart0_handler(void);
|
||||
|
||||
#define UART0Init() uart_periph_init(&uart0)
|
||||
#define UART0CheckFreeSpace(_x) uart_check_free_space(&uart0, _x)
|
||||
@@ -116,7 +115,6 @@ extern void WEAK uart0_handler(void);
|
||||
#if USE_UART1
|
||||
extern struct uart_periph uart1;
|
||||
extern void uart1_init(void);
|
||||
extern void WEAK uart1_handler(void);
|
||||
|
||||
#define UART1Init() uart_periph_init(&uart1)
|
||||
#define UART1CheckFreeSpace(_x) uart_check_free_space(&uart1, _x)
|
||||
@@ -133,7 +131,6 @@ extern void WEAK uart1_handler(void);
|
||||
#if USE_UART2
|
||||
extern struct uart_periph uart2;
|
||||
extern void uart2_init(void);
|
||||
extern void WEAK uart2_handler(void);
|
||||
|
||||
#define UART2Init() uart_periph_init(&uart2)
|
||||
#define UART2CheckFreeSpace(_x) uart_check_free_space(&uart2, _x)
|
||||
@@ -150,7 +147,6 @@ extern void WEAK uart2_handler(void);
|
||||
#if USE_UART3
|
||||
extern struct uart_periph uart3;
|
||||
extern void uart3_init(void);
|
||||
extern void WEAK uart3_handler(void);
|
||||
|
||||
#define UART3Init() uart_periph_init(&uart3)
|
||||
#define UART3CheckFreeSpace(_x) uart_check_free_space(&uart3, _x)
|
||||
@@ -167,7 +163,6 @@ extern void WEAK uart3_handler(void);
|
||||
#if USE_UART4
|
||||
extern struct uart_periph uart4;
|
||||
extern void uart4_init(void);
|
||||
extern void WEAK uart4_handler(void);
|
||||
|
||||
#define UART4Init() uart_periph_init(&uart4)
|
||||
#define UART4CheckFreeSpace(_x) uart_check_free_space(&uart4, _x)
|
||||
@@ -184,7 +179,6 @@ extern void WEAK uart4_handler(void);
|
||||
#if USE_UART5
|
||||
extern struct uart_periph uart5;
|
||||
extern void uart5_init(void);
|
||||
extern void WEAK uart5_handler(void);
|
||||
|
||||
#define UART5Init() uart_periph_init(&uart5)
|
||||
#define UART5CheckFreeSpace(_x) uart_check_free_space(&uart5, _x)
|
||||
@@ -201,7 +195,6 @@ extern void WEAK uart5_handler(void);
|
||||
#if USE_UART6
|
||||
extern struct uart_periph uart6;
|
||||
extern void uart6_init(void);
|
||||
extern void WEAK uart6_handler(void);
|
||||
|
||||
#define UART6Init() uart_periph_init(&uart6)
|
||||
#define UART6CheckFreeSpace(_x) uart_check_free_space(&uart6, _x)
|
||||
|
||||
Reference in New Issue
Block a user