This post is older than 2 years and might not be relevant anymore
More Info: Consider searching for newer posts
This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Migration to SD functions

I have to update my non soft device source code to SD because now I will use Radio.

My question is if it is necessary to rewrite all functions which are in SD API. Like:

NVIC_SetPriority(ADC_IRQn, APP_IRQ_PRIORITY_LOW);
NVIC_ClearPendingIRQ(ADC_IRQn);
NVIC_EnableIRQ(ADC_IRQn);
NRF_POWER->SYSTEMOFF = 1;	
NRF_CLOCK->TASKS_HFCLKSTART = 1;
NRF_RTC1->EVENTS_COMPARE[0] = 0;
__WFI();
__WFE();
and similiar

I'm assume that SD alternate function has just some assert to control if I'm passing right arguments or so. So if I'm sure I didn't use any resources against SD, is it necessary to use strictly only SD functions?

Parents
  • If you are absolutely using only the interrupts, resources and priority levels (important) that you are allowed to use then in reality you can get away with using the NVIC_* calls, it ends up being the same thing. The sd_ calls just check the parameters and hardfault you if you, even accidentally, do something incorrect.

    I have mine #defined so I can switch between the two of them after going through dev testing if I want, it's a bit quicker calling the NVIC ones directly as you don't have to go through a SVC call. By the time I get to that point I'm pretty sure I'm doing the right thing.

Reply
  • If you are absolutely using only the interrupts, resources and priority levels (important) that you are allowed to use then in reality you can get away with using the NVIC_* calls, it ends up being the same thing. The sd_ calls just check the parameters and hardfault you if you, even accidentally, do something incorrect.

    I have mine #defined so I can switch between the two of them after going through dev testing if I want, it's a bit quicker calling the NVIC ones directly as you don't have to go through a SVC call. By the time I get to that point I'm pretty sure I'm doing the right thing.

Children
No Data
Related