From fd9a7717ce740be9e92f4d29e41062ffca20b91d Mon Sep 17 00:00:00 2001 From: Tobias Diedrich Date: Sat, 4 Apr 2026 21:54:56 +0200 Subject: [PATCH] Fix declaration of tx_buf_empty bit var __sbit is for SFRs, for regular data __bit should be used. Otherwise the variables is not correctly declared in the BSEG section, leading to bit temporaries being allocated in the same location. When this causes the tx_buf_empty to be overwritten to 0, then the next write_char will hang forever. --- rtlplayground.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/rtlplayground.c b/rtlplayground.c index 88a584c..f0cf525 100644 --- a/rtlplayground.c +++ b/rtlplayground.c @@ -137,7 +137,7 @@ __xdata char sfp_module_serial[2][17]; __xdata uint8_t sfp_options[2]; __xdata bool button_last; __xdata uint8_t button_sec_counter_last; -__sbit tx_buf_empty; +volatile __bit tx_buf_empty; #define ETHERTYPE_OFFSET (12 + VLAN_TAG_SIZE + RTL_TAG_SIZE)