gustavonihei commented on a change in pull request #3642:
URL: https://github.com/apache/incubator-nuttx/pull/3642#discussion_r625863710
##########
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))
Review comment:
```suggestion
#define REG_MASK(_reg, _field) (((_reg) & (_field##_M)) >> (_field##_S))
```
Wrap macro argument in parentheses to avoid surprises with operator
precedence
--
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]