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

How to shutdown the BLE?

I write some function, it can run ok before I start he BLE function. When I start the BLE function, the function can not run ok. but , I get some data from APP throuth BLE. I want to shutdown the BLE, and run the function , When I run the function OK, I restart the BLE .

Now, I only can start he BLE ok, but I can not shutdown the BLE.

I can reset the whole CODE , but if I do that , the data read from APP throught BLE will be all lost.

the code I insert is as below:

void write32dataY(unsigned int xyab)
{
	while (NRF_NVMC->READY == 0);
	NRF_NVMC->ERASEPAGE = FLASH_ERASE_LG;
	while (NRF_NVMC->READY == 0);
	NRF_NVMC->ERASEPCR1 = FLASH_ERASE_LG;
	while (NRF_NVMC->READY == 0);
	NRF_NVMC->ERASEUICR = 1;
	while (NRF_NVMC->READY == 0);
	//NRF_NVMC->ERASEALL=1;
	NRF_NVMC->CONFIG = 2; //FOR DEL
	while (NRF_NVMC->READY == 0);
	NRF_NVMC->ERASEPAGE = FLASH_ERASE_LG;
	while (NRF_NVMC->READY == 0);
	NRF_NVMC->ERASEPCR1 = FLASH_ERASE_LG;
	while (NRF_NVMC->READY == 0);
	NRF_NVMC->ERASEUICR = 1;
	while (NRF_NVMC->READY == 0);

	//NRF_NVMC->ERASEUICR=1;
	//while(NRF_NVMC->READY==0);
	NRF_NVMC->CONFIG = 1; //FOR write
	while (NRF_NVMC->READY == 0);
	//password[0]=170;
	FLASH_DEAL->PASSWORD = xyab;

	while (NRF_NVMC->READY == 0);
	NRF_NVMC->CONFIG = 0; //FOR READ
	while (NRF_NVMC->READY == 0);
}
Parents Reply Children
No Data
Related