microsoft / uf2-samdx1

USB Mass Storage bootloader (based on UF2) for SAMD21 and SAMD51
Other
250 stars 305 forks source link

WMODE not entirely correct #98

Open Sympatron opened 3 years ago

Sympatron commented 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

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.