Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
b225b37
fix(uart): Add weak attribute to hal_uart_notify_pins_detached
SuGlider Feb 26, 2026
4a05880
fix(uart): conditional call to hal_uart_notify_pins_detached weak fun…
SuGlider Feb 26, 2026
41abbf4
fix(uart): improved comentary
SuGlider Feb 26, 2026
954b7c9
fix(uart): typo
SuGlider Mar 1, 2026
8ae3a48
feat(uart): Implement UART registration and unregistration
SuGlider Mar 1, 2026
2d5337a
feat(uart): call hardware_serial_end on UART pin detachment
SuGlider Mar 1, 2026
4fec4b7
feat(uart): emove unused UART notifier prototype
SuGlider Mar 1, 2026
6eb34d0
feat(uart): change uart_register and uart_unregister to use uint8_t
SuGlider Mar 1, 2026
f13ef32
fix(uart): typo in comment
SuGlider Mar 1, 2026
6641ff0
fix(uart): uart_unregister shall to use SOC_UART_NUM
SuGlider Mar 1, 2026
f2d351d
fix(uart): reduce extern C scope
SuGlider Mar 1, 2026
8e75abb
fix(uart): better commentary
SuGlider Mar 1, 2026
eb45970
feat(uart): Enhance HardwareSerial with validation checks
SuGlider Mar 1, 2026
97245e3
fix(uart): typo
SuGlider Mar 1, 2026
dc81f3d
feat(uart): Improve UART number validation error logging
SuGlider Mar 1, 2026
3d9b675
fix(uart): allow any number of object to reference an uart
SuGlider Mar 2, 2026
9bb8f3e
fix(uart): non existant function
SuGlider Mar 2, 2026
b0cebb8
fix(uart): roll back not necessary changes
SuGlider Mar 2, 2026
3856de1
Merge branch 'master' into fix/no_global_serial
SuGlider Mar 2, 2026
f1d98e5
Merge branch 'master' into fix/no_global_serial
SuGlider Mar 6, 2026
f9f1470
fix(uart): replaces NO_GLOBAL_SERIAL with weak function
SuGlider Mar 7, 2026
d86b928
ci(pre-commit): Apply automatic fixes
pre-commit-ci-lite[bot] Mar 7, 2026
c09954f
Merge branch 'master' into fix/no_global_serial
SuGlider Mar 13, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions cores/esp32/esp32-hal-uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,6 @@
static int s_uart_debug_nr = 0; // UART number for debug output
#define REF_TICK_BAUDRATE_LIMIT 250000 // this is maximum UART badrate using REF_TICK as clock

/* C prototype for the notifier implemented in HardwareSerial.cpp */
extern void hal_uart_notify_pins_detached(int uart_num);

struct uart_struct_t {

#if !CONFIG_DISABLE_HAL_LOCKS
Expand Down Expand Up @@ -296,7 +293,9 @@ static bool _uartDetachBus_RX(void *busptr) {
}
if (bus->_txPin < 0) { // both rx and tx pins are detached, terminate the uart driver
log_d("_uartDetachBus_RX: both RX and TX pins detached for UART%d, terminating driver", bus->num);
hal_uart_notify_pins_detached(bus->num);
if (hal_uart_notify_pins_detached) {
hal_uart_notify_pins_detached(bus->num);
}
return true;
Comment thread
SuGlider marked this conversation as resolved.
}
return _uartDetachPins(bus->num, bus->_rxPin, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE);
Expand All @@ -315,7 +314,9 @@ static bool _uartDetachBus_TX(void *busptr) {
}
if (bus->_rxPin < 0) { // both rx and tx pins are detached, terminate the uart driver
log_d("_uartDetachBus_TX: both RX and TX pins detached for UART%d, terminating driver", bus->num);
hal_uart_notify_pins_detached(bus->num);
if (hal_uart_notify_pins_detached) {
hal_uart_notify_pins_detached(bus->num);
}
return true;
Comment thread
SuGlider marked this conversation as resolved.
}
return _uartDetachPins(bus->num, UART_PIN_NO_CHANGE, bus->_txPin, UART_PIN_NO_CHANGE, UART_PIN_NO_CHANGE);
Expand Down
3 changes: 3 additions & 0 deletions cores/esp32/esp32-hal-uart.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,9 @@ extern "C" {
struct uart_struct_t;
typedef struct uart_struct_t uart_t;

// C prototype for the notifier that may be implemented in HardwareSerial.cpp
Comment thread
SuGlider marked this conversation as resolved.
Outdated
Comment thread
SuGlider marked this conversation as resolved.
Outdated
extern void hal_uart_notify_pins_detached(int uart_num) __attribute__((weak));

bool _testUartBegin(
uint8_t uart_nr, uint32_t baudrate, uint32_t config, int8_t rxPin, int8_t txPin, uint32_t rx_buffer_size, uint32_t tx_buffer_size, bool inverted,
uint8_t rxfifo_full_thrhd
Expand Down
Loading