diff --git a/arch/xtensa/src/esp32/hardware/esp32_soc.h b/arch/xtensa/src/esp32/hardware/esp32_soc.h index a784dacf34..bff4b28e30 100644 --- a/arch/xtensa/src/esp32/hardware/esp32_soc.h +++ b/arch/xtensa/src/esp32/hardware/esp32_soc.h @@ -113,7 +113,7 @@ * used when _f is not left shifted by _f##_S */ -#define REG_SET_FIELD(addr, field, val) (modifyreg32(addr, (((~((uint32_t) val)) & field##_V) << field##_S), (((uint32_t) val) << field##_S))) +#define REG_SET_FIELD(addr, field, val) (modifyreg32(addr, field##_M, (((uint32_t) val) & field##_V) << field##_S)) /* Set field value from a variable, * used when _f is not left shifted by _f##_S