Skip to content

Commit ac16a90

Browse files
Bl00d-B0bLN882H Fix
authored andcommitted
[lightning-ln882h] Fix default log UART port to UART1 (libretiny-eu#373)
Per Tuya WL2H-U datasheet, UART1 (PB8/PB9) is the designated log output port on LN882H modules. UART0 (PA2/PA3) is the user UART and is typically connected to GPIOs on CB3S-footprint boards (e.g. indicator LEDs on the DS-101JL wall switch). Using UART0 as the default log port was introduced in libretiny-eu#312 and caused PA2/PA3 to be claimed by AFIO, preventing their use as GPIO. Change lt_family.h to prefer UART1 over UART0 as the default, consistent with how beken-72xx defaults to UART2/UART1 and avoids UART0.
1 parent fc8c881 commit ac16a90

1 file changed

Lines changed: 5 additions & 3 deletions

File tree

cores/lightning-ln882h/base/lt_family.h

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@
55
#include <lt_pins.h>
66

77
// Choose the main UART output port
8+
// Per Tuya WL2H-U datasheet, UART1 (PB8/PB9) is the designated log port;
9+
// UART0 (PA2/PA3) is the user UART and should remain free as GPIO.
810
#ifndef LT_UART_DEFAULT_PORT
9-
#if LT_HW_UART0
10-
#define LT_UART_DEFAULT_PORT 0
11-
#elif LT_HW_UART1
11+
#if LT_HW_UART1
1212
#define LT_UART_DEFAULT_PORT 1
13+
#elif LT_HW_UART0
14+
#define LT_UART_DEFAULT_PORT 0
1315
#elif LT_HW_UART2
1416
#define LT_UART_DEFAULT_PORT 2
1517
#else

0 commit comments

Comments
 (0)