Fix define macros, was missing the do {} while (0) wrapping

This commit is contained in:
René van Dorst
2026-08-30 19:35:37 +02:00
parent fc3c686564
commit 4e04735a5f
2 changed files with 7 additions and 4 deletions
+4 -2
View File
@@ -31,11 +31,13 @@ void rtl8224_write_reg_u16(uint16_t reg, uint16_t val) __banked;
void rtl8224_sds_write(uint16_t sds_cmd, uint16_t val) __banked;
void phy_config_8261(uint8_t phy, uint8_t sds) __banked;
#define RTL8224_SDS_WRITE(sds_id, page, reg, v) uint16_t _sdscmd = (uint16_t)(sds_id & 0x01) | (1 << 14) | (1 << 15); \
#define RTL8224_SDS_WRITE(sds_id, page, reg, v) do { \
uint16_t _sdscmd = (uint16_t)(sds_id & 0x01) | (1 << 14) | (1 << 15); \
_sdscmd |= (page & 0x3F) << 1; \
_sdscmd |= ((uint16_t)(reg & 0x1f)) << 7; \
print_string("CMD: "); print_short(_sdscmd); \
write_char('-'); print_short(v); \
rtl8224_sds_write(_sdscmd, v);
rtl8224_sds_write(_sdscmd, v); \
} while (0)
#endif