This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts

why use do while?

#define APP_ERROR_CHECK(ERR_CODE)
do
{
const uint32_t LOCAL_ERR_CODE = (ERR_CODE);
if (LOCAL_ERR_CODE != NRF_SUCCESS)
{
APP_ERROR_HANDLER(LOCAL_ERR_CODE);
}
} while (0)

I saw this a lot, is it for save one int from stack? if so how about just use {}

Related