Open Sympatron opened 3 years ago
Technically the following line would have to set NVMCTRL_CTRLA_WMODE_MAN_Val instead of NVMCTRL_CTRLA_WMODE_MAN, because the latter is already shifted and therefore not meant to be written to the bitfield. This only worked, because NVMCTRL_CTRLA_WMODE_MAN_Val is 0x0, otherwise this would not have worked. https://github.com/microsoft/uf2-samdx1/blob/df89a1f91a7464a51cd11cb3ad7ca10051028bc4/src/selfmain.c#L91
NVMCTRL_CTRLA_WMODE_MAN_Val
NVMCTRL_CTRLA_WMODE_MAN
I know this is nitpicky since it works, but this code would break down if somebody used it as a reference and tried to use another mode.
Technically the following line would have to set
NVMCTRL_CTRLA_WMODE_MAN_Val
instead ofNVMCTRL_CTRLA_WMODE_MAN
, because the latter is already shifted and therefore not meant to be written to the bitfield. This only worked, becauseNVMCTRL_CTRLA_WMODE_MAN_Val
is 0x0, otherwise this would not have worked. https://github.com/microsoft/uf2-samdx1/blob/df89a1f91a7464a51cd11cb3ad7ca10051028bc4/src/selfmain.c#L91I know this is nitpicky since it works, but this code would break down if somebody used it as a reference and tried to use another mode.