[riot-notifications] [RIOT-OS/RIOT] sam0 flashpage: wait for READY bit in INTFLAG after write command (#10880)

Kees Bakker notifications at github.com
Tue Jan 29 22:17:03 CET 2019


For example
```
static inline bool nvm_is_ready() __attribute__((always_inline));
static inline bool nvm_is_ready()
{
#ifdef CPU_SAML1X
    return _NVMCTRL->STATUS.bit.READY;
#else
    return _NVMCTRL->INTFLAG.bit.READY;
#endif
}
```

And to use it:
```
    _NVMCTRL->CTRLA.reg = (NVMCTRL_CTRLA_CMDEX_KEY | NVMCTRL_CTRLA_CMD_WP);
    while (!nvm_is_ready()) {}
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/RIOT-OS/RIOT/pull/10880#issuecomment-458710232
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.riot-os.org/pipermail/notifications/attachments/20190129/75ec4321/attachment.html>


More information about the notifications mailing list