You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2023/09/16 10:30:04 UTC

[nuttx] branch master updated: arch/risc-v/esp32c6: fix compilation of esp32c6 serial driver

This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 017ccca5d6 arch/risc-v/esp32c6: fix compilation of esp32c6 serial driver
017ccca5d6 is described below

commit 017ccca5d67bddcfed42461eb585bbd1ea43051b
Author: Petro Karashchenko <pe...@gmail.com>
AuthorDate: Sat Sep 16 10:39:45 2023 +0300

    arch/risc-v/esp32c6: fix compilation of esp32c6 serial driver
    
    The commit fix regression introduced by c56aa7b527ddd4617950a03259f01859ad86af52
    
    Signed-off-by: Petro Karashchenko <pe...@gmail.com>
---
 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))