Example #1
0
	/*
 	 *	Init TX and RX buffers, they are in EM but not in the retainable part
 	 *  so the pointers have to be programmed again	*
 	 */
	if(func_check_mem_flag)
	{
		if (func_check_mem_flag==2)
		{
	  //init TX/RX buffers after DEEPSLEEP	
		co_buf_init_deep_sleep();
		// Set the first RX descriptor pointer into the HW
        ble_currentrxdescptr_set(REG_BLE_EM_RX_ADDR_GET(co_buf_rx_current_get()));
		}   	
       //INIT NONE RET. HEAP after DEEPSLEEP	
       	ke_mem_init(KE_MEM_NON_RETENTION, (uint8_t*)(jump_table_struct[rwip_heap_non_ret_pos]), jump_table_struct[rwip_heap_non_ret_size]);

		func_check_mem_flag = 0;//false;
		
	}
 #endif //RW_BLE_SUPPORT
#endif //DEEP_SLEEP
}

#endif //0

// /*********************************************************************************
//  *** SLP_INT ISR
//  ***/
void BLE_SLP_Handler(void)
//void BLE_SLP_Handler_func(void)
{
	ble_regs_pop();
	//smpc_regs_pop();
    
//#if !DEEP_SLEEP_ENABLED
//# if  DEVELOPMENT__NO_OTP    
//	SetBits16(SYS_CTRL_REG, DEBUGGER_ENABLE, 1);
//# else
//  SetBits16(SYS_CTRL_REG, DEBUGGER_ENABLE, 0);   
//# endif	// DEVELOPMENT__NO_OTP
//#endif // !DEEP_SLEEP_ENABLED

	SetBits16(GP_CONTROL_REG, BLE_WAKEUP_REQ, 0);   //just to be sure    

    if(jump_table_struct[0] == TASK_GTL)	
	{
		// UART and pads have already been activated by periph_init() which is called
		// at initialization by main_func() and during wakeup by BLE_WAKEUP_LP_Handler().
		
		gtl_eif_init();
	}

	SetBits32(BLE_INTACK_REG, SLPINTACK, 1);

#if DEEP_SLEEP //Needed only for compilation. Remove when ROM code is ready.
#if RW_BLE_SUPPORT
	rwip_wakeup();
#endif //RW_BLE_SUPPORT
#endif //DEEP_SLEEP
    
    if (lp_clk_sel == LP_CLK_RCX20)
        calibrate_rcx20(20);
}
Example #2
0
void BLE_SLP_Handler(void)
//void BLE_SLP_Handler_func(void)
{
	ble_regs_pop();
//	smpc_regs_pop();
    

//	SetBits16(SYS_CTRL_REG, DEBUGGER_ENABLE, 0);   

	SetBits16(GP_CONTROL_REG, BLE_WAKEUP_REQ, 0);   //just to be sure    

    if((jump_table_struct[0] == TASK_GTL) || (BLE_INTEGRATED_HOST_GTL == 1 ))
	{
		// UART and pads have already been activated by periph_init() which is called
		// at initialization by main_func() and during wakeup by BLE_WAKEUP_LP_Handler().
		
		gtl_eif_init();
	}

	SetBits32(BLE_INTACK_REG, SLPINTACK, 1);

#if DEEP_SLEEP //Needed only for compilation. Remove when ROM code is ready.
#if RW_BLE_SUPPORT
	rwip_wakeup();
#endif //RW_BLE_SUPPORT
#endif //DEEP_SLEEP
    
	/*
	* Radio Subsystem initialization. Execute here after making sure that BLE core is awake.
	*/
	rf_workaround_init();
	rf_reinit();	

    if (lp_clk_sel == LP_CLK_RCX20)
        calibrate_rcx20(20);
    
    rwble_last_event = BLE_EVT_SLP;
    
}