saramonteiro commented on a change in pull request #3642:
URL: https://github.com/apache/incubator-nuttx/pull/3642#discussion_r625983556



##########
File path: arch/risc-v/src/esp32c3/hardware/esp32c3_soc.h
##########
@@ -257,4 +257,12 @@
 
 #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))

Review comment:
       done

##########
File path: arch/xtensa/src/esp32/hardware/esp32_soc.h
##########
@@ -183,6 +183,14 @@
 
 #define GET_PERI_REG_BITS2(reg, mask,shift)      
((READ_PERI_REG(reg)>>(shift))&(mask))
 
+/* Extract the field from the register and shift it to avoid wrong reading */
+
+#define REG_MASK(_reg, _field) ((_reg & (_field##_M)) >> (_field##_S))

Review comment:
       done

##########
File path: arch/xtensa/src/esp32/hardware/esp32_soc.h
##########
@@ -183,6 +183,14 @@
 
 #define GET_PERI_REG_BITS2(reg, mask,shift)      
((READ_PERI_REG(reg)>>(shift))&(mask))
 
+/* 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))

Review comment:
       done




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to