Hi, sorry for the late response. Somehow I missed this. On Mon, Jan 16, 2017 at 08:22:27PM -0800, will sanfilippo wrote: > Yes, Mynewt works the same way as FreeRTOS in this respect. Well, at least in > the way you are describing FreeRTOS. We have a tickless OS and when we decide > to go to sleep we are waiting for an interrupt to wake us up. > > Regarding the radio: there are some registers that are only programmed once, > so if you switch to your own custom RF stack and you want to switch back to > bluetooth, you would either have to write some custom code or reset the link > layer. There is an API to do this but I am not sure if it is accessible to > the application developer.
It's not a part of the published host API, but the following function should cause the host to reset the controller: void ble_hs_sched_reset(int reason) The reason code doesn't matter; it is just something the host uses when reporting terminated connections. You can just specify 1. Since this function isn't part of the API, you'll need to declare a prototype by hand: void ble_hs_sched_reset(int reason); Thanks, Chris