Index: fw/sdk/yc_bt.h
===================================================================
--- /YC3121_SDK/fw/sdk/yc_bt.h	(revision 949)
+++ /YC3121_SDK/fw/sdk/yc_bt.h	(working copy)
@@ -75,6 +75,7 @@
 #define BIT_LE_SET_VISIBILITY             47
 #define BIT_BT_SET_VISIBILITY             48
 #define BIT_LE_SEND_ENC_RSP               49
+#define BIT_SET_LPM_MODE                  50
 /*CMD*/
 #define HCI_CMD_SET_BT_ADDR               0x00  //设置 BT3.0 地址
 #define HCI_CMD_SET_BLE_ADDR              0x01  //设置 BLE 地址
Index: fw/sdk/yc_bt.c
===================================================================
--- /YC3121_SDK/fw/sdk/yc_bt.c	(revision 949)
+++ /YC3121_SDK/fw/sdk/yc_bt.c	(working copy)
@@ -169,7 +169,7 @@
     BluetoothBuf.count = 0;
     BluetoothBuf.ReadIndex = 0;
     BluetoothBuf.WriteIndex =0;
-    hci_bt.p_data =  ipcrecbuf;
+    hci_bt.p_data = ipcrecbuf;
     enable_intr(INTR_BT);
     ipc_inited=TRUE;
 #ifdef BT_ERROR_LOG
@@ -218,7 +218,10 @@
     msg.DataLen = 6;
     msg.p_data = bt_addr;
     BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_SET_BT_ADDR);
-    SendCMD(&msg);
+    if(FALSE == SendCMD(&msg))
+    {
+        return FALSE;
+    }
     StartTick=SysTick_GetTick();
     do
     {
@@ -238,7 +241,10 @@
     msg.DataLen = 6;
     msg.p_data = bt_addr;
     BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_SET_BLE_ADDR);
-    SendCMD(&msg);
+    if(FALSE == SendCMD(&msg))
+    {
+        return FALSE;
+    }
     StartTick=SysTick_GetTick();
     do
     {
@@ -265,7 +271,10 @@
     msg.DataLen = 0x01;
     msg.p_data = &visibility_data;
     BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_SET_VISIBILITY);
-    SendCMD(&msg);
+    if(FALSE == SendCMD(&msg))
+    {
+        return FALSE;
+    }
     StartTick=SysTick_GetTick();
     do
     {
@@ -288,7 +297,10 @@
     msg.DataLen = 0x01;
     msg.p_data = &visibility_data;
     BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_LE_SET_VISIBILITY);
-    SendCMD(&msg);
+    if(FALSE == SendCMD(&msg))
+    {
+        return FALSE;
+    }
     StartTick=SysTick_GetTick();
     do
     {
@@ -313,7 +325,10 @@
     msg.DataLen = 0x01;
     msg.p_data = &visibility_data;
     BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_BT_SET_VISIBILITY);
-    SendCMD(&msg);
+    if(FALSE == SendCMD(&msg))
+    {
+        return FALSE;
+    }
     StartTick=SysTick_GetTick();
     do
     {
@@ -332,7 +347,10 @@
     msg.DataLen = name_len;
     msg.p_data  = bt_name;
     BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_SET_BT_NAME);
-    SendCMD(&msg);
+    if(FALSE == SendCMD(&msg))
+    {
+        return FALSE;
+    }
     StartTick=SysTick_GetTick();
     do
     {
@@ -352,7 +370,10 @@
     msg.DataLen = name_len;
     msg.p_data  = ble_name;
     BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_SET_BLE_NAME);
-    SendCMD(&msg);
+    if(FALSE == SendCMD(&msg))
+    {
+        return FALSE;
+    }
     StartTick=SysTick_GetTick();
     do
     {
@@ -373,7 +394,10 @@
     msg.DataLen = DataLen;
     msg.p_data = spp_data;
     BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_SEND_SPP_DATA);
-    SendCMD(&msg);
+    if(FALSE == SendCMD(&msg))
+    {
+        return FALSE;
+    }
     StartTick=SysTick_GetTick();
     do
     {
@@ -394,7 +418,10 @@
 
     msg.p_data = ble_data;
     BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_SEND_BLE_DATA);
-    SendCMD(&msg);
+    if(FALSE == SendCMD(&msg))
+    {
+        return FALSE;
+    }
     StartTick=SysTick_GetTick();
     do
     {
@@ -414,7 +441,10 @@
     msg.DataLen = 0;
     msg.p_data=NULL;
     BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_STATUS_REQUEST);
-    SendCMD(&msg);
+    if(FALSE == SendCMD(&msg))
+    {
+        return FALSE;
+    }
     StartTick=SysTick_GetTick();
     do
     {
@@ -434,7 +464,10 @@
     msg.DataLen = 1;
     msg.p_data = &tmode;
     BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_SET_PAIRING_MODE);
-    SendCMD(&msg);
+    if(FALSE == SendCMD(&msg))
+    {
+        return FALSE;
+    }
     StartTick=SysTick_GetTick();
     do
     {
@@ -453,7 +486,10 @@
     msg.DataLen = DataLen;
     msg.p_data = Pincode;
     BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_SET_PINCODE);
-    SendCMD(&msg);
+    if(FALSE == SendCMD(&msg))
+    {
+        return FALSE;
+    }
     StartTick=SysTick_GetTick();
     do
     {
@@ -474,7 +510,10 @@
     msg.DataLen = 0;
     msg.p_data = NULL;
     BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_BT_DISCONNECT);
-    SendCMD(&msg);
+    if(FALSE == SendCMD(&msg))
+    {
+        return FALSE;
+    }
     StartTick=SysTick_GetTick();
     do
     {
@@ -494,7 +533,10 @@
     msg.DataLen = 0;
     msg.p_data = NULL;
     BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_GET_VERSION);
-    SendCMD(&msg);
+    if(FALSE == SendCMD(&msg))
+    {
+        return FALSE;
+    }
     StartTick=SysTick_GetTick();
     do
     {
@@ -515,7 +557,10 @@
     msg.DataLen = 0;
     msg.p_data = NULL;
     BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_BLE_DISCONNECT);
-    SendCMD(&msg);
+    if(FALSE == SendCMD(&msg))
+    {
+        return FALSE;
+    }
     StartTick=SysTick_GetTick();
     do
     {
@@ -535,7 +580,10 @@
     msg.DataLen = len;
     msg.p_data = NvData;
     BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_SET_NVRAM);
-    SendCMD(&msg);
+    if(FALSE == SendCMD(&msg))
+    {
+        return FALSE;
+    }
     StartTick=SysTick_GetTick();
     do
     {
@@ -554,7 +602,10 @@
     msg.DataLen = len;
     msg.p_data = NvData;
     BT_BIT_CLEAR(HCI_CMD_BIT_FLAG, BIT_CREAT_BT_RECONNECT);
-    SendCMD(&msg);
+    if(FALSE == SendCMD(&msg))
+    {
+        return FALSE;
+    }
     StartTick = SysTick_GetTick();
     do
     {
@@ -573,7 +624,10 @@
     msg.DataLen = 0;
     msg.p_data = NULL;
     BT_BIT_CLEAR(HCI_CMD_BIT_FLAG, BIT_CANCEL_BT_RECONNECT);
-    SendCMD(&msg);
+    if(FALSE == SendCMD(&msg))
+    {
+        return FALSE;
+    }
     StartTick = SysTick_GetTick();
     do
     {
@@ -591,20 +645,35 @@
     msg.opcode = HCI_CMD_ENTER_SLEEP_MODE;
     msg.DataLen = 0;
     msg.p_data = NULL;
-    SendCMD(&msg);
+    if(FALSE == SendCMD(&msg))
+    {
+        return FALSE;
+    }
     return TRUE;
 }
 
 Boolean BT_SetLpmMode(uint8_t mode)
 {
     HCI_TypeDef msg;
-    uint8_t temp_mode=mode;
+    uint8_t temp_mode = mode;
     msg.opcode = HCI_CMD_SET_LPM_MODE;
-    msg.DataLen =1;
+    msg.DataLen = 1;
     msg.p_data = &temp_mode;
-    SendCMD(&msg);
-    bt_lpm_mode = mode;
-    return TRUE;
+    BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_SET_LPM_MODE);
+    if(FALSE == SendCMD(&msg))
+    {
+        return FALSE;
+    }
+    StartTick = SysTick_GetTick();
+    do
+    {
+        if(BT_BIT_GET(HCI_CMD_BIT_FLAG, BIT_SET_LPM_MODE))
+        {
+            bt_lpm_mode = mode;
+            return TRUE;
+        }
+    } while(!SysTick_IsTimeOut(StartTick, BTTIMEOUT));
+    return FALSE;
 }
 
 Boolean BT_SetWakeupGpio(uint8_t islow_wakeup, uint32_t GPIO_Pin0_Pin31, uint16_t GPIO_Pin32_Pin47)
@@ -630,7 +699,10 @@
     wake_gpio[6] = (GPIO_Pin32_Pin47 >> 8) & 0xff;
     msg.p_data = wake_gpio;
     BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_SET_GPIO_WAKEUPE);
-    SendCMD(&msg);
+    if(FALSE == SendCMD(&msg))
+    {
+        return FALSE;
+    }
     StartTick=SysTick_GetTick();
     do
     {
@@ -650,7 +722,10 @@
     uint32_t bt_rtc_wakeup = time;
     msg.p_data = (uint8_t *)&bt_rtc_wakeup;
     BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_SET_RTC_WAKEUP);
-    SendCMD(&msg);
+    if(FALSE == SendCMD(&msg))
+    {
+        return FALSE;
+    }
     StartTick=SysTick_GetTick();
     do
     {
@@ -671,7 +746,10 @@
     msg.DataLen =1;
     msg.p_data = &tmismatching;
     BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_CONFIRM_GKEY);
-    SendCMD(&msg);
+    if(FALSE == SendCMD(&msg))
+    {
+        return FALSE;
+    }
     StartTick=SysTick_GetTick();
     do
     {
@@ -691,7 +769,10 @@
     uint8_t temp_packetNum=packetNum;
     msg.p_data = &temp_packetNum;
     BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_GET_CREADIT_GIVEN);
-    SendCMD(&msg);
+    if(FALSE == SendCMD(&msg))
+    {
+        return FALSE;
+    }
     return TRUE;//no event responce
 }
 
@@ -704,7 +785,10 @@
     msg.DataLen = PKLEN;
     msg.p_data = key_data;
     BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_PASSKEY_ENTRY);
-    SendCMD(&msg);
+    if(FALSE == SendCMD(&msg))
+    {
+        return FALSE;
+    }
     StartTick=SysTick_GetTick();
     do
     {
@@ -724,7 +808,10 @@
     uint8_t temp_mode=mode;
     msg.p_data = &temp_mode;
     BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_LE_SET_PARING);
-    SendCMD(&msg);
+    if(FALSE == SendCMD(&msg))
+    {
+        return FALSE;
+    }
     StartTick=SysTick_GetTick();
     do
     {
@@ -743,7 +830,10 @@
     msg.DataLen = DataLen;
     msg.p_data = adv_data;
     BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_LE_SET_ADV_DATA);
-    SendCMD(&msg);
+    if(FALSE == SendCMD(&msg))
+    {
+        return FALSE;
+    }
     StartTick=SysTick_GetTick();
     do
     {
@@ -762,7 +852,10 @@
     msg.DataLen = DataLen;
     msg.p_data = scan_data;
     BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_LE_SET_SCAN_DATA);
-    SendCMD(&msg);
+    if(FALSE == SendCMD(&msg))
+    {
+        return FALSE;
+    }
     StartTick=SysTick_GetTick();
     do
     {
@@ -783,7 +876,10 @@
     msg.DataLen = len;
     msg.p_data = data;
     BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_LE_SEND_CONN_UPDATE);
-    SendCMD(&msg);
+    if(FALSE == SendCMD(&msg))
+    {
+        return FALSE;
+    }
     StartTick=SysTick_GetTick();
     do
     {
@@ -805,7 +901,10 @@
     ble_adv_interval_buf[1]=((ble_adv_interval>>8)&0xff);
     msg.p_data = ble_adv_interval_buf;
     BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_LE_SET_ADV_PARM);
-    SendCMD(&msg);
+    if(FALSE == SendCMD(&msg))
+    {
+        return FALSE;
+    }
     StartTick=SysTick_GetTick();
     do
     {
@@ -827,7 +926,10 @@
     msg.DataLen = 0x01;
     msg.p_data = &td;
     BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_REJECT_JUSTWORK);
-    SendCMD(&msg);
+    if(FALSE == SendCMD(&msg))
+    {
+        return FALSE;
+    }
     StartTick=SysTick_GetTick();
     do
     {
@@ -847,7 +949,10 @@
     msg.DataLen = 0x01;
     msg.p_data = &tpower;
     BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_SET_TXPOWER);
-    SendCMD(&msg);
+    if(FALSE == SendCMD(&msg))
+    {
+        return FALSE;
+    }
     StartTick=SysTick_GetTick();
     do
     {
@@ -866,7 +971,10 @@
     msg.DataLen = 0x05;
     msg.p_data = key;
     BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_LE_SET_FIXED_PASSKEY);
-    SendCMD(&msg);
+    if(FALSE == SendCMD(&msg))
+    {
+        return FALSE;
+    }
     StartTick=SysTick_GetTick();
     do
     {
@@ -886,7 +994,10 @@
     msg.DataLen = 0x00;
     msg.p_data = NULL;
     BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_LE_SEND_ENC_RSP);
-    SendCMD(&msg);
+    if(FALSE == SendCMD(&msg))
+    {
+        return FALSE;
+    }
     StartTick=SysTick_GetTick();
     do
     {
@@ -906,7 +1017,10 @@
     msg.DataLen = 3;
     msg.p_data = bt_cod;
     BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_SET_COD);
-    SendCMD(&msg);
+    if(FALSE == SendCMD(&msg))
+    {
+        return FALSE;
+    }
     StartTick=SysTick_GetTick();
     do
     {
@@ -926,7 +1040,10 @@
     msg.DataLen = 0;
     msg.p_data = NULL;
     BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_DELETE_SERVICE);
-    SendCMD(&msg);
+    if(FALSE == SendCMD(&msg))
+    {
+        return FALSE;
+    }
     StartTick=SysTick_GetTick();
     do
     {
@@ -945,7 +1062,10 @@
     msg.DataLen = service_uuid_len;
     msg.p_data  = ble_service_uuid;
     BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_ADD_UUID);
-    SendCMD(&msg);
+    if(FALSE == SendCMD(&msg))
+    {
+        return FALSE;
+    }
     StartTick=SysTick_GetTick();
     do
     {
@@ -967,7 +1087,10 @@
     msg.DataLen = service_Characteristic_payload_len;
     msg.p_data  = ble_Characteristic_uuid;
     BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_ADD_UUID);
-    SendCMD(&msg);
+    if(FALSE == SendCMD(&msg))
+    {
+        return FALSE;
+    }
     StartTick=SysTick_GetTick();
     do
     {
@@ -987,7 +1110,10 @@
     msg.DataLen = service_length;
     msg.p_data  = service_table;
     BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_ADD_UUID);
-    SendCMD(&msg);
+    if(FALSE == SendCMD(&msg))
+    {
+        return FALSE;
+    }
     StartTick=SysTick_GetTick();
     do
     {
@@ -1000,8 +1126,6 @@
 }
 
 
-
-
 Boolean BT_DnsReq( uint8_t *dns_data,int len)
 {
     uint8_t format_dns[DOMAIN_MAX_LEN];
@@ -1015,7 +1139,10 @@
     msg.DataLen = format_dns_len;
     msg.p_data = format_dns;
     BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_DNS_REQ);
-    SendCMD(&msg);
+    if(FALSE == SendCMD(&msg))
+    {
+        return FALSE;
+    }
     StartTick=SysTick_GetTick();
     do
     {
@@ -1034,7 +1161,10 @@
     msg.DataLen = len;
     msg.p_data = phone_mac_addr;
     BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_CONNECT_BNEP);
-    SendCMD(&msg);
+    if(FALSE == SendCMD(&msg))
+    {
+        return FALSE;
+    }
     StartTick=SysTick_GetTick();
     do
     {
@@ -1058,7 +1188,10 @@
     msg.DataLen = len;
     msg.p_data = tcp_ip_addr;
     BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_CONNECT_TCP);
-    SendCMD(&msg);
+    if(FALSE == SendCMD(&msg))
+    {
+        return FALSE;
+    }
     StartTick=SysTick_GetTick();
     do
     {
@@ -1080,7 +1213,10 @@
     msg.DataLen = len;
     msg.p_data = tcpdata;
     BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_BNEP_SEND_TCP_DATA);
-    SendCMD(&msg);
+    if(FALSE == SendCMD(&msg))
+    {
+        return FALSE;
+    }
     StartTick=SysTick_GetTick();
     do
     {
@@ -1127,7 +1263,10 @@
         }
 
         BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_BNEP_SEND_TCP_BIG_DATA);
-        SendCMD(&msg);
+        if(FALSE == SendCMD(&msg))
+        {
+            return FALSE;
+        }
         StartTick=SysTick_GetTick();
         while(!BT_BIT_GET(HCI_CMD_BIT_FLAG,BIT_BNEP_SEND_TCP_BIG_DATA))
         {
@@ -1168,7 +1307,10 @@
     msg.DataLen = len;
     msg.p_data = udpdata;
     BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_BNEP_SEND_UDP_DATA);
-    SendCMD(&msg);
+    if(FALSE == SendCMD(&msg))
+    {
+        return FALSE;
+    }
     StartTick=SysTick_GetTick();
     do
     {
@@ -1189,7 +1331,10 @@
     uint8_t temp_tcp_handle=tcp_handle;
     msg.p_data = &temp_tcp_handle;
     BT_BIT_CLEAR(HCI_CMD_BIT_FLAG,BIT_DISCONNECT_TCP);
-    SendCMD(&msg);
+    if(FALSE == SendCMD(&msg))
+    {
+        return FALSE;
+    }
     StartTick=SysTick_GetTick();
     do
     {
@@ -1559,7 +1704,14 @@
                         BT_BIT_SET(HCI_CMD_BIT_FLAG,BIT_DNS_REQ);
                     }
                     break;
-
+                    
+                case HCI_CMD_SET_LPM_MODE:
+                    if(!hci_bt.p_data[1])
+                    {
+                        BT_BIT_SET(HCI_CMD_BIT_FLAG,BIT_SET_LPM_MODE);
+                    }
+                    break;
+                    
                 case HCI_CMD_CREAT_BT_RECONNECT:
                     if (!hci_bt.p_data[1])
                     {
Index: fw/sdk/yc_ipc.h
===================================================================
--- /YC3121_SDK/fw/sdk/yc_ipc.h	(revision 949)
+++ /YC3121_SDK/fw/sdk/yc_ipc.h	(working copy)
@@ -7,6 +7,8 @@
 #include "misc.h"
 #include "yc_lpm.h"
 
+#define M0_WAKEUP_HOLD_BT_GPIO     9   //Hold BT gpio, Unused IO
+
 #define IPCREVSIZE                 256
 #define HW_REG_8BIT(reg, value)    (*((volatile uint8_t *)((uint32_t)reg)) = value)
 #define HR_REG_8BIT(reg)           (*(volatile uint8_t *)((uint32_t)reg))
Index: fw/sdk/yc_ipc.c
===================================================================
--- /YC3121_SDK/fw/sdk/yc_ipc.c	(revision 949)
+++ /YC3121_SDK/fw/sdk/yc_ipc.c	(working copy)
@@ -336,15 +336,15 @@
 
 void IPC_hold_bt()
 {
-    WAKEUP_BT |= (1 << WAKEUP_BT_FLAG);
-    IPC_HOLD_BT  = 1;
-    delay_ms(10);
+	GPIO_CONFIG(M0_WAKEUP_HOLD_BT_GPIO)=GPCFG_OUTPUT_HIGH;
+	delay_ms(3);
 }
 
 void IPC_dishold_bt()
 {
     IPC_HOLD_BT = 0;
     WAKEUP_BT &= ~(1 << WAKEUP_BT_FLAG);
+	GPIO_CONFIG(M0_WAKEUP_HOLD_BT_GPIO)=GPCFG_PD;
 }
 
 //打印HCI数据包
Index: fw/sdk/yc_lpm.h
===================================================================
--- /YC3121_SDK/fw/sdk/yc_lpm.h	(revision 949)
+++ /YC3121_SDK/fw/sdk/yc_lpm.h	(working copy)
@@ -25,7 +25,6 @@
 
 uint32_t lpm_bt_read(uint8_t type);
 
-void lpm_sleep(void);
 
 void setlpmval(volatile int *addr, uint8_t startbit, uint8_t bitwidth, uint32_t val);
 
Index: fw/sdk/yc_lpm.c
===================================================================
--- /YC3121_SDK/fw/sdk/yc_lpm.c	(revision 949)
+++ /YC3121_SDK/fw/sdk/yc_lpm.c	(working copy)
@@ -40,11 +40,6 @@
     }
 }
 
-void lpm_sleep(void)
-{
-  ((void(*)(uint8_t cmd))(0x4708 + 1))(0xB9); //flash power down
-  ((void(*)())FUNC_LPM_SLEEP_ADDR)();
-}
 
 void setlpmval(volatile int *addr, uint8_t startbit, uint8_t bitwidth, uint32_t val)
 {
@@ -122,7 +117,7 @@
 {
     SYSCTRL_HCLKConfig(SYSCTRL_HCLK_Div8);
 }
-
+extern void lpm_sleep(void);
 void CM0_Sleep(uint32_t time, uint32_t GPIO_Pin0_Pin31, uint16_t GPIO_Pin32_Pin47, uint8_t islow_wakeup, uint8_t bt_status)
 {
     if(time)
@@ -199,7 +194,6 @@
     {
         BT_SetLpmMode(0x01);
         IPC_dishold_bt();
-
     }
     else if (bt_status == 2)
     {
@@ -214,8 +208,11 @@
                               SYSCTRL_AHBPeriph_7811 | SYSCTRL_AHBPeriph_ADC7811 | \
                               SYSCTRL_AHBPeriph_CP, DISABLE);
 
+	__asm("CPSID i");//رirqж
+	
     uint32_t lpm_sleep_addr = (uint32_t)lpm_sleep;
     ((void(*)(void *, void *))FUNC_PREFETCH)(((void *)lpm_sleep_addr), ((void *)(lpm_sleep_addr + 100)));
+
     lpm_sleep();
 }
 
