Skip to content

Commit 78a014e

Browse files
committed
move check LIB_PICO_STDIO_UART to board.h
1 parent 9e7e890 commit 78a014e

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

hw/bsp/rp2040/board.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@
4040
#define BUTTON_BOOTSEL
4141
#define BUTTON_STATE_ACTIVE 0
4242

43-
#if defined(PICO_DEFAULT_UART_TX_PIN) && defined(PICO_DEFAULT_UART_RX_PIN) && defined(PICO_DEFAULT_UART)
43+
#if defined(PICO_DEFAULT_UART_TX_PIN) && defined(PICO_DEFAULT_UART_RX_PIN) && \
44+
defined(PICO_DEFAULT_UART) && defined(LIB_PICO_STDIO_UART)
4445
#define UART_DEV PICO_DEFAULT_UART
4546
#define UART_TX_PIN PICO_DEFAULT_UART_TX_PIN
4647
#define UART_RX_PIN PICO_DEFAULT_UART_RX_PIN

hw/bsp/rp2040/family.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ void stdio_rtt_init(void)
115115

116116
#endif
117117

118-
#if defined(UART_DEV) && defined(LIB_PICO_STDIO_UART)
118+
#if defined(UART_DEV)
119119
static uart_inst_t *uart_inst;
120120
#endif
121121

@@ -148,7 +148,7 @@ void board_init(void)
148148
#ifndef BUTTON_BOOTSEL
149149
#endif
150150

151-
#if defined(UART_DEV) && defined(LIB_PICO_STDIO_UART)
151+
#if defined(UART_DEV)
152152
bi_decl(bi_2pins_with_func(UART_TX_PIN, UART_TX_PIN, GPIO_FUNC_UART));
153153
uart_inst = uart_get_instance(UART_DEV);
154154
stdio_uart_init_full(uart_inst, CFG_BOARD_UART_BAUDRATE, UART_TX_PIN, UART_RX_PIN);
@@ -191,7 +191,7 @@ uint32_t board_button_read(void)
191191

192192
int board_uart_read(uint8_t* buf, int len)
193193
{
194-
#if defined(UART_DEV) && defined(LIB_PICO_STDIO_UART)
194+
#if defined(UART_DEV)
195195
int count = 0;
196196
while ( (count < len) && uart_is_readable(uart_inst) )
197197
{
@@ -207,7 +207,7 @@ int board_uart_read(uint8_t* buf, int len)
207207

208208
int board_uart_write(void const * buf, int len)
209209
{
210-
#if defined(UART_DEV) && defined(LIB_PICO_STDIO_UART)
210+
#if defined(UART_DEV)
211211
char const* bufch = (char const*) buf;
212212
for(int i=0;i<len;i++) {
213213
uart_putc(uart_inst, bufch[i]);

0 commit comments

Comments
 (0)