From 017ccca5d67bddcfed42461eb585bbd1ea43051b Mon Sep 17 00:00:00 2001 From: Petro Karashchenko Date: Sat, 16 Sep 2023 10:39:45 +0300 Subject: [PATCH] arch/risc-v/esp32c6: fix compilation of esp32c6 serial driver The commit fix regression introduced by c56aa7b527ddd4617950a03259f01859ad86af52 Signed-off-by: Petro Karashchenko --- arch/risc-v/src/esp32c6/hardware/esp32c6_soc.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/arch/risc-v/src/esp32c6/hardware/esp32c6_soc.h b/arch/risc-v/src/esp32c6/hardware/esp32c6_soc.h index c16768d81e..6b0bd3d76d 100644 --- a/arch/risc-v/src/esp32c6/hardware/esp32c6_soc.h +++ b/arch/risc-v/src/esp32c6/hardware/esp32c6_soc.h @@ -148,6 +148,10 @@ #define BIT(nr) (1UL << (nr)) +/* Extract the field from the register and shift it to avoid wrong reading */ + +#define REG_MASK(_reg, _field) (((_reg) & (_field##_M)) >> (_field##_S)) + /* Helper to place a value in a field */ #define VALUE_TO_FIELD(_value, _field) (((_value) << (_field##_S)) & (_field##_M))