From: cheng.chen Date: Fri, 26 Sep 2025 10:05:33 +0000 (+0800) Subject: 20250926,8251_8373 X-Git-Url: http://git.snicker.com.cn/Users/apple/Desktop/static/gitweb.css?a=commitdiff_plain;p=mirrors%2FVmouse-tlw-huoshan.git 20250926,8251_8373 --- diff --git a/3.code_8251_8373/B85m_driver_dongle/demo/vendor/8373_dongle/AAA_app.c b/3.code_8251_8373/B85m_driver_dongle/demo/vendor/8373_dongle/AAA_app.c index e2f495f..c29c0bb 100644 --- a/3.code_8251_8373/B85m_driver_dongle/demo/vendor/8373_dongle/AAA_app.c +++ b/3.code_8251_8373/B85m_driver_dongle/demo/vendor/8373_dongle/AAA_app.c @@ -3079,6 +3079,10 @@ void pull_usb_data() if(p1) { //USB_DATA_S *p=(USB_DATA_S*)usb_fifo_aaa.fifo[usb_fifo_aaa.rptr&(USB_FIFO_NUM1-1)];//usb data + + // printf("pull_usb_data ...\n"); + + USB_DATA_S *p=(USB_DATA_S*)p1; if(p->type==NORMAL_KB_DATA_TYPE) { @@ -3107,7 +3111,20 @@ void pull_usb_data() else if(p->type==PC_DATA_TYPE) { //success=usb_app_hid_report(0x0b,p->buf, 7); - success=usb_app_hid_report(0x05,p->buf, 63); + + + success=usb_app_hid_report(0x05,p->buf, 33); + + if(success) + printf("the pc_data_type is %d %d ...\n",p->buf[5],p->buf[6]); + else{ + + printf("pc_data_type1212,fail ...\n"); + } + + // success=usb_app_hid_report(0x05,p->buf, 33); + + } if(success)//push suc { diff --git a/3.code_8251_8373/B85m_driver_dongle/demo/vendor/8373_dongle/AAA_project_config.h b/3.code_8251_8373/B85m_driver_dongle/demo/vendor/8373_dongle/AAA_project_config.h index d3bdadf..69fd2c0 100644 --- a/3.code_8251_8373/B85m_driver_dongle/demo/vendor/8373_dongle/AAA_project_config.h +++ b/3.code_8251_8373/B85m_driver_dongle/demo/vendor/8373_dongle/AAA_project_config.h @@ -62,7 +62,7 @@ extern "C" { #define ID_SAVE_STORAGE_ADDR 0x1A000 //address storage paired device_id #define CFG_MAC_ADDR 0x1F000 //address storage MAC(need burn) #define PARING_MAX_NUM (4096/ID_LEN) //the max num of paired device_id - #define EMI_TEST_FUN_ENABLE_AAA 0 //Enable + #define EMI_TEST_FUN_ENABLE_AAA 1 //Enable #define USB_OTA_ENABLE_AAA (USB_OTA_AND_APP_ENABLE) //Enable #define D24G_OTA_ENABLE_AAA 0 //2.4G-OTA Enable #endif diff --git a/3.code_8251_8373/B85m_driver_dongle/demo/vendor/8373_dongle/AAA_usb_desc.c b/3.code_8251_8373/B85m_driver_dongle/demo/vendor/8373_dongle/AAA_usb_desc.c index 88a4af2..fd1ba29 100644 --- a/3.code_8251_8373/B85m_driver_dongle/demo/vendor/8373_dongle/AAA_usb_desc.c +++ b/3.code_8251_8373/B85m_driver_dongle/demo/vendor/8373_dongle/AAA_usb_desc.c @@ -787,7 +787,8 @@ int usb_app_hid_report(u8 report_id,u8 *data, u16 length) //printf("%01x",data[i]); reg_usb_ep_dat(USB_EDP_SPP_IN) = data[i]; } - //printf("\r\n"); + + printf("usb_app_hid_report is %d \n",length); usbhw_data_ep_ack(USB_EDP_SPP_IN); return 1; diff --git a/3.code_8251_8373/B85m_driver_dongle/demo/vendor/8373_dongle/application/usbstd/usb.c b/3.code_8251_8373/B85m_driver_dongle/demo/vendor/8373_dongle/application/usbstd/usb.c index 61a7d19..d6742ec 100644 --- a/3.code_8251_8373/B85m_driver_dongle/demo/vendor/8373_dongle/application/usbstd/usb.c +++ b/3.code_8251_8373/B85m_driver_dongle/demo/vendor/8373_dongle/application/usbstd/usb.c @@ -339,6 +339,9 @@ void usb_handle_out_class_intf_req(int data_request) { u8 Entity = (control_request.Index >> 8) & 0xff; #endif + printf("usb_handle_out_class_intf_req %d %d...\n",property,value_h); + + switch (property) { #if(USB_CDC_ENABLE)//for cdc // #if(0)//for cdc @@ -737,6 +740,8 @@ void usb_handle_request(u8 data_request) { u8 Request = control_request.Request; usbhw_reset_ctrl_ep_ptr(); + + // printf("the usb handle request %d...\n",RequestType); switch (RequestType) { case (REQDIR_DEVICETOHOST | REQTYPE_STANDARD | REQREC_DEVICE): // if (REQ_GetDescriptor == Request) { diff --git a/3.code_8251_8373/B85m_driver_dongle/demo/vendor/8373_dongle/main.c b/3.code_8251_8373/B85m_driver_dongle/demo/vendor/8373_dongle/main.c index 8d5b95f..6100ac7 100644 --- a/3.code_8251_8373/B85m_driver_dongle/demo/vendor/8373_dongle/main.c +++ b/3.code_8251_8373/B85m_driver_dongle/demo/vendor/8373_dongle/main.c @@ -231,7 +231,7 @@ int main (void) //must on ramcode { loop_cnt ++; loop_tick = clock_time(); - printf("---loop_cnt = %d.\n", loop_cnt); + // printf("---loop_cnt = %d.\n", loop_cnt); } #endif } diff --git a/3.code_8251_8373/b85_ble_sdk/.cproject b/3.code_8251_8373/b85_ble_sdk/.cproject index 6b65d81..53407c0 100644 --- a/3.code_8251_8373/b85_ble_sdk/.cproject +++ b/3.code_8251_8373/b85_ble_sdk/.cproject @@ -78,7 +78,255 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -156,7 +404,255 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -235,7 +731,255 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -314,7 +1058,255 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -392,7 +1384,255 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -470,7 +1710,255 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -549,7 +2037,255 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -627,7 +2363,255 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -705,7 +2689,255 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -783,7 +3015,255 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -861,7 +3341,255 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -940,7 +3668,255 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1018,7 +3994,255 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1098,7 +4322,255 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1176,7 +4648,255 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1255,7 +4975,255 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1335,7 +5303,255 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1415,7 +5631,255 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1467,6 +5931,7 @@ @@ -1495,7 +5960,255 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/3.code_8251_8373/b85_ble_sdk/application/audio/audio_config.h b/3.code_8251_8373/b85_ble_sdk/application/audio/audio_config.h index 7791197..e87898e 100644 --- a/3.code_8251_8373/b85_ble_sdk/application/audio/audio_config.h +++ b/3.code_8251_8373/b85_ble_sdk/application/audio/audio_config.h @@ -46,6 +46,9 @@ #include "application/audio/audio_common.h" #include "tl_common.h" +// TL_AUDIO_RCU_ADPCM_GATT_TLEINK + +#define TL_AUDIO_MODE TL_AUDIO_RCU_ADPCM_GATT_TLEINK // #ifndef TL_AUDIO_MODE #define TL_AUDIO_MODE AUDIO_DISABLE diff --git a/3.code_8251_8373/b85_ble_sdk/vendor/8258_dual_mouse/AAA_24G_APP.c b/3.code_8251_8373/b85_ble_sdk/vendor/8258_dual_mouse/AAA_24G_APP.c index be21a07..3633671 100644 --- a/3.code_8251_8373/b85_ble_sdk/vendor/8258_dual_mouse/AAA_24G_APP.c +++ b/3.code_8251_8373/b85_ble_sdk/vendor/8258_dual_mouse/AAA_24G_APP.c @@ -198,6 +198,8 @@ void d24_user_init() set_pair_flag(); //set pair } else { has_been_paired_flag = 1; //record have pair flag + + // clear_pair_flag(); } #endif @@ -205,6 +207,7 @@ void d24_user_init() set_pair_flag();//set pair #endif + if (pair_flag) // pair flag 1 { device_status = STATE_PAIRING; //device into pair status @@ -249,7 +252,10 @@ void check_rf_complet_status() flash_dev_info.dongle_id = dongle_id; //update dongle id my_printf_aaa("pairing success------------\n"); // debug pair success save_dev_info_flash(); // save dev + } + + OPTSensor_Init(1); clear_pair_flag(); // clear pair flag reset_idle_status(); //reset idle params @@ -281,7 +287,7 @@ void check_rf_complet_status() if(no_ack>125) {//noack times over 250 connect_ok=0;//connect not ok - printf("no ack over 125\n"); + // printf("no ack over 125\n"); } } } @@ -582,12 +588,24 @@ void pm_poll() } +extern u8 need_send_btn_key; + void d24_main_loop() { u32 temp = 0;//tmp init 0 static u32 tick_loop = 0; //tick loop 0 + + #if APP_24G_AUDIO_EN proc_audio(); + + // if(need_send_btn_key>0){ + + // device_key_send(need_send_btn_key); + + // need_send_btn_key=0; + + // } #endif #if (ADAPT_ALL_HW_AUTO_DRAW_IN_D24G_MODE_DEBUG||TEST_DRAW_A_SQUARE) //auto draw hw en //report_rate = 8;//report rate 1 diff --git a/3.code_8251_8373/b85_ble_sdk/vendor/8258_dual_mouse/AAA_Public.c b/3.code_8251_8373/b85_ble_sdk/vendor/8258_dual_mouse/AAA_Public.c index 9278327..ff9e490 100644 --- a/3.code_8251_8373/b85_ble_sdk/vendor/8258_dual_mouse/AAA_Public.c +++ b/3.code_8251_8373/b85_ble_sdk/vendor/8258_dual_mouse/AAA_Public.c @@ -66,7 +66,7 @@ _attribute_data_retention_user int ui_mtu_size_exchange_req = 0; _attribute_data_retention_user u8 ui_mic_enable = 0; _attribute_data_retention_user u8 has_mic_data_flag = 0; _attribute_data_retention_user u8 appdata[8]={0}; -u32 mic_duration = 60; +u32 mic_duration = 36000; _attribute_data_retention_user u16 btn_value = 0; @@ -288,7 +288,7 @@ _attribute_ram_code_ void task_audio (void) index_d24g_mic[0]= j; memcpy((u8*)&index_d24g_mic[1],(u8*)&d24g_mic_data[j*32],32); my_fifo_push_app(&d24g_txfifo, (u8*)&index_d24g_mic[0], 33, MIC_DATA_CMD); - printf("push mic data now %d\n",j); + // printf("push mic data now %d\n",j); } buffer_mic_pkt_rptr++; @@ -312,7 +312,7 @@ _attribute_ram_code_ void task_audio (void) } else { - printf("mic tx fifo over 10\n"); + // printf("mic tx fifo over 10\n"); } #endif @@ -325,12 +325,12 @@ void proc_audio(void){ //if(audio_start || (audio_stick && clock_time_exceed(audio_stick, 17*1000))){// for 8278 if(audio_start || (audio_stick && clock_time_exceed(audio_stick, 1*1000))){ audio_start = 1; - if(clock_time_exceed(audio_stick, mic_duration*1000*1000)) - { - ui_enable_mic(0); - printf("mic open too long so close\n"); - } - else + //if(clock_time_exceed(audio_stick, mic_duration*1000*1000)) + //{ + // ui_enable_mic(0); + // printf("mic open %d debug11 too long so close\n",mic_duration); + //} + //else task_audio(); } } @@ -386,15 +386,15 @@ void proc_audio_ble(void){ audio_start = 1; if(blc_ll_getCurrentState() == BLS_LINK_STATE_CONN) { - if(clock_time_exceed(audio_stick, mic_duration*1000*1000)) - { - ui_enable_mic (0); - printf("mic open too long so close\n"); - } - else - { + // if(clock_time_exceed(audio_stick, mic_duration*1000*1000)) + // { + // ui_enable_mic (0); + // printf("mic open %d debug12 too long so close\n",mic_duration); + // } + //else + //{ task_audio_ble(); - } + //} } else { @@ -529,6 +529,10 @@ static void btn_init_hw() } void ble_start_pair() { + + + // OPTSensor_Shutdown(); + printf("ble_start_pair123\n"); set_pair_flag(); if(connect_ok) { @@ -564,6 +568,24 @@ void two_speed_switch_pair() { if ((((btn_value&COMB_BTN_PAIR)==COMB_BTN_PAIR)||((btn_value&MS_BTN_MODE)==MS_BTN_MODE)) && (clock_time_exceed(btn_tick, 2100000))) { + + //int tempk=flash_dev_info.mast_id +1; + //flash_dev_info.mast_id = tempk;//mast 1 + + printf("two_speed_switch_pairble\n"); + + flash_erase_sector(CFG_MAST_ADDR); + + flash_dev_info.mast_id = 0; + flash_dev_info.slave_mac_addr[0] = 0; + flash_dev_info.slave_mac_addr[1] = 0; + flash_dev_info.slave_mac_addr[2] = 0; + flash_dev_info.slave_mac_addr[3] = 0; + + // save_dev_info_flash(); + + // save_dev_info_flash(); + ble_start_pair(); } } @@ -670,17 +692,17 @@ void button_process_telink_v21a(u8 event_new) printf("voice btn press\n"); } #if(BK_AUT) - if((btn_value & MS_BTN_MODE_SWITCH) == MS_BTN_MODE_SWITCH)//ģʽ�л������� + if((btn_value & MS_BTN_MODE_SWITCH) == MS_BTN_MODE_SWITCH)//模式锟叫伙拷锟斤拷锟斤拷锟斤拷 { if(event_new != 0) // voice key new short press { mode_switch_key_flgg = 1; - + //w_snd_val(0x03); } else if(clock_time_exceed(btn_tick, 2100000)) - { - if(mode_switch_key_flgg == 1) //����һֱ�ظ��������� + { + if(mode_switch_key_flgg == 1) //锟斤拷锟斤拷一直锟截革拷锟斤拷锟斤拷锟斤拷锟斤拷 { mode_switch_key_flgg = 2; //voice key new long press , start voice record @@ -688,30 +710,30 @@ void button_process_telink_v21a(u8 event_new) { #if BK_AUT && BK_AUT_KEY_CMD bk_printf("mode long press\n"); - BK_button_callback(mode_button,LONG_PRESS_START);// + BK_button_callback(mode_button,LONG_PRESS_START);// //bk_printf("mode long press\n"); - -#else - + +#else + #endif } } } - + } - else if((last_btn_value & MS_BTN_MODE_SWITCH) == MS_BTN_MODE_SWITCH)//ģʽ�л����ͷ� // voice key new release + else if((last_btn_value & MS_BTN_MODE_SWITCH) == MS_BTN_MODE_SWITCH)//模式锟叫伙拷锟斤拷锟酵凤拷 // voice key new release { if(event_new != 0) { if(mode_switch_key_flgg == 2) //voice key long press rel { -#if BK_AUT && BK_AUT_KEY_CMD - BK_button_callback(mode_button,PRESS_UP);//�����ͷ� - printf("mode long release\n"); - -#else +#if BK_AUT && BK_AUT_KEY_CMD + printf("mode long release123\n"); + BK_button_callback(mode_button,PRESS_UP);//锟斤拷锟斤拷锟酵凤拷 +#else + #endif } else @@ -720,9 +742,9 @@ void button_process_telink_v21a(u8 event_new) printf("mode short release\n"); BK_button_callback(mode_button,SINGLE_CLICK);// //printf("mode short release\n"); - -#else - + +#else + #endif } mode_switch_key_flgg = 0; @@ -749,11 +771,11 @@ void button_process_telink_v21a(u8 event_new) middle_flg = 1; } else if(clock_time_exceed(btn_tick, 2800000)) - { + { if(middle_flg == 1) { middle_flg = 0; - + if((url_state == 0) && connect_ok) { url_state = 1; @@ -775,9 +797,9 @@ void button_process_telink_v21a(u8 event_new) ui_mtu_size_exchange_req = 0; blc_att_requestMtuSizeExchange(BLS_CONN_HANDLE, 0x009e); } - } + } } - + //-----------------mode change ------------------------ if(switch_type==THREE_SPEED_SWITCH) { @@ -831,12 +853,12 @@ u16 btn_scan() button_status = button_get_status(PIN_BTN_LEFT); if (button_status == 1) { - now_value |= MS_BTN_MIDDLE;//MS_BTN_LEFT; + now_value |= MS_BTN_LEFT; } else if (button_status == 2) { #if(BK_AUT) - now_value |= MS_BTN_LEFT;//MS_BTN_voice; + now_value |= MS_BTN_voice; #else now_value |= MS_BTN_K4; #endif @@ -849,47 +871,38 @@ u16 btn_scan() } else if (button_status == 2) { - // #if(BK_AUT) - // now_value |= MS_BTN_m; - // #else - // now_value |= MS_BTN_K5; - // #endif + #if(BK_AUT) + now_value |= MS_BTN_m; + #else + now_value |= MS_BTN_K5; + #endif //now_value |= MS_BTN_VOICE; } - button_status = button_get_status(PIN_BTN_M); + button_status = button_get_status(PIN_BTN_MIDDLE); if (button_status == 1) { - now_value |= MS_BTN_m; + now_value |= MS_BTN_MIDDLE; } else if (button_status == 2) { - // #if(BK_AUT) - // now_value |= MS_BTN_ai; - // #else + #if(BK_AUT) + now_value |= MS_BTN_ai; + #else now_value |= MS_BTN_VOICE; - //#endif + #endif //now_value |= MS_BTN_K5; } - button_status = button_get_status(PIN_MODE_SWITCH); - if (button_status == 1) - { - now_value |= MS_BTN_MODE_SWITCH; - } - else if (button_status == 2) - { - now_value |= MS_BTN_ai ; + if(!gpio_read(PIN_MODE_SWITCH )) + { + #if(BK_AUT) + now_value |= MS_BTN_MODE_SWITCH ; + #else + now_value |= MS_BTN_MODE; + #endif + printf("btn mode press\n"); } - // if(!gpio_read(PIN_MODE_SWITCH )) - // { - // #if(BK_AUT) - // now_value |= MS_BTN_MODE_SWITCH ; - // #else - // now_value |= MS_BTN_MODE; - // #endif - // printf("btn mode press\n"); - // } return now_value; } @@ -1020,7 +1033,7 @@ static void wheel_init_hw() write_reg8(0xd3, WHEEL_ADDRES_D3); - write_reg8(0xd7, 0x01); //BIT(0) 0: 1¸ñ 1: 2¸ñ BIT(1) wakeup enable + write_reg8(0xd7, 0x01); //BIT(0) 0: 1赂帽 1: 2赂帽 BIT(1) wakeup enable write_reg8(0xd1, 0x01); //filter 00-07 00 is best @@ -1069,11 +1082,11 @@ _attribute_ram_code_ s8 mouse_wheel_process(u32 wheel_prepare_tick) wheel_cnt += accumulate_wheel_cnt; - if (wheel_cnt & 1) //Ææ + if (wheel_cnt & 1) //脝忙 { accumulate_wheel_cnt = wheel_cnt > 0 ? 1 : -1; } - else //ż + else //脜录 { accumulate_wheel_cnt = 0; } @@ -1324,6 +1337,8 @@ void ble_notify_data_proc_aaa() else { my_printf_aaa("notify_fail_reason=%x\r\n", status);//debug notify fail + + //my_printf_aaa("txFifoNumber=%d\r\n", txFifoNumber);//debug notify fail } #endif } @@ -1509,6 +1524,7 @@ void clear_pair_flag() } void set_pair_flag() { + printf("set_pair_flag123\n"); pair_flag = 1; analog_write(USED_DEEP_ANA_REG1, ana_reg1_aaa | PAIR_ANA_FLG); } @@ -1734,6 +1750,9 @@ void w_snd_val(char k_val) } void bk_button_handle( u8 event_new) { + + // printf("btn_value %d last_btn_value %d\n",btn_value,last_btn_value); + if((btn_value & MS_BTN_voice) == MS_BTN_voice) { if(event_new != 0) // voice key new short press @@ -1741,25 +1760,25 @@ void bk_button_handle( u8 event_new) voice_key_flg = 1; #if BK_AUT && BK_AUT_KEY_CMD - //BK_aut_hal_send("���������\n",sizeof("���������\n")); - BK_button_callback(voice_button,PRESS_DOWN);//��������ï¿? + //BK_aut_hal_send("锟斤拷锟斤拷锟斤拷锟斤拷锟絓n",sizeof("锟斤拷锟斤拷锟斤拷锟斤拷锟絓n")); + BK_button_callback(voice_button,PRESS_DOWN);//锟斤拷锟斤拷锟斤拷锟斤拷锟� bk_printf("voice button \n"); #endif //w_snd_val(0x01); } - else if(clock_time_exceed(btn_tick, 290000))//������������ï¿? + else if(clock_time_exceed(btn_tick, 290000))//锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟� { - if(voice_key_flg == 1) //����һֱ�ظ��������� + if(voice_key_flg == 1) //锟斤拷锟斤拷一直锟截革拷锟斤拷锟斤拷锟斤拷锟斤拷 { voice_key_flg = 2; //voice key new long press , start voice record #if BK_AUT && BK_AUT_KEY_CMD - //BK_aut_hal_send("���������\n",sizeof("���������\n")); + //BK_aut_hal_send("锟斤拷锟斤拷锟斤拷锟斤拷锟絓n",sizeof("锟斤拷锟斤拷锟斤拷锟斤拷锟絓n")); printf("voice button long press start\n"); - BK_button_callback(voice_button,LONG_PRESS_START);//�����������Ê? + BK_button_callback(voice_button,LONG_PRESS_START);//锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟绞� #else if(connect_ok) { - if(!ui_mic_enable)//��ʼ¼�� + if(!ui_mic_enable)//锟斤拷始录锟斤拷 { w_snd_val(0x09); audio_stick = clock_time()|1; @@ -1771,27 +1790,27 @@ void bk_button_handle( u8 event_new) } } - else if((last_btn_value & MS_BTN_voice) == MS_BTN_voice) //������ͷï¿? voice key new release + else if((last_btn_value & MS_BTN_voice) == MS_BTN_voice) //锟斤拷锟斤拷锟斤拷头锟� voice key new release { if(event_new != 0) { - if(voice_key_flg == 2) //�����ͷ�voice key long press rel + if(voice_key_flg == 2) //锟斤拷锟斤拷锟酵凤拷voice key long press rel { #if BK_AUT && BK_AUT_KEY_CMD - //BK_aut_hal_send("����������ͷ�\n",sizeof("����������ͷ�\n")); + //BK_aut_hal_send("锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷头锟絓n",sizeof("锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷头锟絓n")); printf("voice button long release\n"); - BK_button_callback(voice_button,PRESS_UP);//����������ï¿? + BK_button_callback(voice_button,PRESS_UP);//锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟� #else w_snd_val(0x10); ui_enable_mic(0); //voice off #endif } - else //�̰��ͷ� + else //锟教帮拷锟酵凤拷 { #if BK_AUT && BK_AUT_KEY_CMD - //BK_aut_hal_send("������̰��ͷ�\n",sizeof("������̰��ͷ�\n")); + //BK_aut_hal_send("锟斤拷锟斤拷锟斤拷贪锟斤拷头锟絓n",sizeof("锟斤拷锟斤拷锟斤拷贪锟斤拷头锟絓n")); printf("voice button short release\n"); - BK_button_callback(voice_button,SINGLE_CLICK);//������̰ï¿? + BK_button_callback(voice_button,SINGLE_CLICK);//锟斤拷锟斤拷锟斤拷贪锟� #else if(!ui_mic_enable) { @@ -1811,7 +1830,7 @@ void bk_button_handle( u8 event_new) } - if((btn_value & MS_BTN_ai) == MS_BTN_ai)//AI������ + if((btn_value & MS_BTN_ai) == MS_BTN_ai)//AI锟斤拷锟斤拷锟斤拷 { if(event_new != 0) // voice key new short press { @@ -1829,15 +1848,15 @@ void bk_button_handle( u8 event_new) } else if(clock_time_exceed(btn_tick, 300000)) { - if(ai_key_flg == 1) //����һֱ�ظ��������� + if(ai_key_flg == 1) //锟斤拷锟斤拷一直锟截革拷锟斤拷锟斤拷锟斤拷锟斤拷 { ai_key_flg = 2; //voice key new long press , start voice record if(connect_ok) { #if BK_AUT && BK_AUT_KEY_CMD printf("AI button long press start\n"); - //BK_aut_hal_send("AI��������\n",sizeof("AI��������\n")); - BK_button_callback(AI_button,LONG_PRESS_START);//������ʼ + //BK_aut_hal_send("AI锟斤拷锟斤拷锟斤拷锟斤拷\n",sizeof("AI锟斤拷锟斤拷锟斤拷锟斤拷\n")); + BK_button_callback(AI_button,LONG_PRESS_START);//锟斤拷锟斤拷锟斤拷始 #else w_snd_val(0x13); if(!ui_mic_enable) @@ -1851,27 +1870,27 @@ void bk_button_handle( u8 event_new) } } - else if((last_btn_value & MS_BTN_ai) == MS_BTN_ai) //AI���ͷ� voice key new release + else if((last_btn_value & MS_BTN_ai) == MS_BTN_ai) //AI锟斤拷锟酵凤拷 voice key new release { if(event_new != 0) { - if(ai_key_flg == 2) //���� voice key long press rel + if(ai_key_flg == 2) //锟斤拷锟斤拷 voice key long press rel { #if BK_AUT && BK_AUT_KEY_CMD printf("AI button long release\n"); - //BK_aut_hal_send("AI�����ͷ�\n",sizeof("AI�����ͷ�\n")); - BK_button_callback(AI_button,PRESS_UP);//�������� + //BK_aut_hal_send("AI锟斤拷锟斤拷锟酵凤拷\n",sizeof("AI锟斤拷锟斤拷锟酵凤拷\n")); + BK_button_callback(AI_button,PRESS_UP);//锟斤拷锟斤拷锟斤拷锟斤拷 #else w_snd_val(0x14); ui_enable_mic(0); //voice off #endif } - else //�̰� + else //锟教帮拷 { #if BK_AUT && BK_AUT_KEY_CMD printf("AI button short release\n"); - //BK_aut_hal_send("AI�̰��ͷ�\n",sizeof("AI�̰��ͷ�\n")); - BK_button_callback(AI_button,SINGLE_CLICK);//������̰ï¿? + //BK_aut_hal_send("AI锟教帮拷锟酵凤拷\n",sizeof("AI锟教帮拷锟酵凤拷\n")); + BK_button_callback(AI_button,SINGLE_CLICK);//锟斤拷锟斤拷锟斤拷贪锟� #else w_snd_val(0x06); #endif @@ -1881,7 +1900,7 @@ void bk_button_handle( u8 event_new) } - if((btn_value & MS_BTN_m) == MS_BTN_m)//M������ + if((btn_value & MS_BTN_m) == MS_BTN_m)//M锟斤拷锟斤拷锟斤拷 { if(event_new != 0) // voice key new short press { @@ -1890,7 +1909,7 @@ void bk_button_handle( u8 event_new) } else if(clock_time_exceed(btn_tick, 300000)) { - if(m_key_flg == 1) //����һֱ�ظ��������� + if(m_key_flg == 1) //锟斤拷锟斤拷一直锟截革拷锟斤拷锟斤拷锟斤拷锟斤拷 { m_key_flg = 2; //voice key new long press , start voice record @@ -1898,8 +1917,8 @@ void bk_button_handle( u8 event_new) { #if BK_AUT && BK_AUT_KEY_CMD printf("M long press start\n"); - //BK_aut_hal_send("M����������\n",sizeof("M����������\n")); - BK_button_callback(m_button,LONG_PRESS_START);//������ʼ + //BK_aut_hal_send("M锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷\n",sizeof("M锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷\n")); + BK_button_callback(m_button,LONG_PRESS_START);//锟斤拷锟斤拷锟斤拷始 #else w_snd_val(0x11); if(!ui_mic_enable) @@ -1914,16 +1933,16 @@ void bk_button_handle( u8 event_new) } } - else if((last_btn_value & MS_BTN_m) == MS_BTN_m)//M���ͷ� // voice key new release + else if((last_btn_value & MS_BTN_m) == MS_BTN_m)//M锟斤拷锟酵凤拷 // voice key new release { if(event_new != 0) { if(m_key_flg == 2) //voice key long press rel { #if BK_AUT && BK_AUT_KEY_CMD - //BK_aut_hal_send("M�������ͷ�\n",sizeof("M�������ͷ�\n")); + //BK_aut_hal_send("M锟斤拷锟斤拷锟斤拷锟酵凤拷\n",sizeof("M锟斤拷锟斤拷锟斤拷锟酵凤拷\n")); printf("M long release\n"); - BK_button_callback(m_button,PRESS_UP);//�����ͷ� + BK_button_callback(m_button,PRESS_UP);//锟斤拷锟斤拷锟酵凤拷 #else w_snd_val(0x12); ui_enable_mic(0); //voice off @@ -1932,9 +1951,9 @@ void bk_button_handle( u8 event_new) else { #if BK_AUT && BK_AUT_KEY_CMD - //BK_aut_hal_send("M���̰��ͷ�\n",sizeof("M���̰��ͷ�\n")); + //BK_aut_hal_send("M锟斤拷锟教帮拷锟酵凤拷\n",sizeof("M锟斤拷锟教帮拷锟酵凤拷\n")); printf("M short release\n"); - BK_button_callback(m_button,SINGLE_CLICK);//�̰� + BK_button_callback(m_button,SINGLE_CLICK);//锟教帮拷 #else w_snd_val(0x03); #endif @@ -1944,7 +1963,7 @@ void bk_button_handle( u8 event_new) } #if(0) - if((btn_value & MS_BTN_MODE_SWITCH) == MS_BTN_MODE_SWITCH)//ģʽ�л������� + if((btn_value & MS_BTN_MODE_SWITCH) == MS_BTN_MODE_SWITCH)//模式锟叫伙拷锟斤拷锟斤拷锟斤拷 { if(event_new != 0) // voice key new short press { @@ -1954,7 +1973,7 @@ void bk_button_handle( u8 event_new) } else if(clock_time_exceed(btn_tick, 300000)) { - if(mode_switch_key_flgg == 1) //����һֱ�ظ��������� + if(mode_switch_key_flgg == 1) //锟斤拷锟斤拷一直锟截革拷锟斤拷锟斤拷锟斤拷锟斤拷 { mode_switch_key_flgg = 2; //voice key new long press , start voice record @@ -1973,14 +1992,14 @@ void bk_button_handle( u8 event_new) } } - else if((last_btn_value & MS_BTN_MODE_SWITCH) == MS_BTN_MODE_SWITCH)//ģʽ�л����ͷ� // voice key new release + else if((last_btn_value & MS_BTN_MODE_SWITCH) == MS_BTN_MODE_SWITCH)//模式锟叫伙拷锟斤拷锟酵凤拷 // voice key new release { if(event_new != 0) { if(mode_switch_key_flgg == 2) //voice key long press rel { #if BK_AUT && BK_AUT_KEY_CMD - BK_button_callback(mode_button,PRESS_UP);//�����ͷ� + BK_button_callback(mode_button,PRESS_UP);//锟斤拷锟斤拷锟酵凤拷 printf("mode long release\n"); #else @@ -2475,7 +2494,7 @@ void vendor_protocol_handler (const u8* pData, u8 Len) //luyong direct pc if(!ui_mic_enable) { audio_stick = clock_time()|1; - ui_enable_mic(1);//¼��ï¿? + ui_enable_mic(1);//录锟斤拷锟� } } else if(pData[0] == AP_CMD_CONNECT_REQ) //connect start @@ -2522,8 +2541,8 @@ void vendor_protocol_handler (const u8* pData, u8 Len) //luyong direct pc pData_cmd[4] = 1; //version H pData_cmd[5] = flash_dpi_info.bt_dpi;; //dpi L pData_cmd[6] = 0x00; //dpi H - pData_cmd[7] = 0; //���״Ì? �� 0 �ï¿? �� 1. ���״Ì? - pData_cmd[8] = my_batVal[0]; //���� + pData_cmd[7] = 0; //锟斤拷锟阶刺� 锟斤拷 0 未锟斤拷锟� 锟斤拷 1. 锟斤拷锟阶刺� + pData_cmd[8] = my_batVal[0]; //锟斤拷锟斤拷 //bls_att_pushNotifyData(USER_REPORT_INPUT_CD2_H, pData_cmd, 16); if(user_data.mouse_mode != RF_2M_2P4G_MODE) { @@ -2537,8 +2556,8 @@ void vendor_protocol_handler (const u8* pData, u8 Len) //luyong direct pc pData_cmd[0] = AP_CMD_MOUCE_STATE_RSP; pData_cmd[1] = 4; //response suscess pData_cmd[2] = 16; //len - memcpy(&pData_cmd[3], mouse_passwd, 8); //���� - memcpy(&pData_cmd[11], user_cfg.dev_sn, 16); //���к� + memcpy(&pData_cmd[3], mouse_passwd, 8); //锟斤拷锟斤拷 + memcpy(&pData_cmd[11], user_cfg.dev_sn, 16); //锟斤拷锟叫猴拷 bls_att_pushNotifyData(USER_REPORT_INPUT_CD2_H, pData_cmd, 20); #endif @@ -2614,8 +2633,8 @@ void vendor_protocol_handler (const u8* pData, u8 Len) //luyong direct pc { static char m_url[80]; char m_url_tmp[16]; - u8 len = pData[2]; //���ݰ��ij��� - u8 pack_inx = pData[3]; //data[0] = inx����һ������ + u8 len = pData[2]; //锟斤拷锟捷帮拷锟侥筹拷锟斤拷 + u8 pack_inx = pData[3]; //data[0] = inx锟斤拷锟斤拷一锟斤拷锟斤拷锟斤拷 pData_cmd[1] = 2; //ok if(pack_inx == 1) @@ -2726,7 +2745,7 @@ void vendor_protocol_handler (const u8* pData, u8 Len) //luyong direct pc return 0; } -//������Э�����ݽ������¼����� +//锟斤拷锟斤拷锟斤拷协锟斤拷锟斤拷锟捷斤拷锟斤拷锟斤拷锟铰硷拷锟斤拷锟斤拷 void user_protocol_handler (const u8* pData, u8 Len) //luyong for dongle { unsigned short nCmd, seq; @@ -2743,7 +2762,7 @@ void user_protocol_handler (const u8* pData, u8 Len) //luyong for dongle pData_cmd[1] = 2; pData_cmd[2] = 1; pData_cmd[3] = 1; - //bls_att_pushNotifyData(HID_USER_REPORT_INPUT_DP_H, pData_cmd, 8);//�ظ������� + //bls_att_pushNotifyData(HID_USER_REPORT_INPUT_DP_H, pData_cmd, 8);//锟截革拷锟斤拷锟斤拷锟斤拷 if(user_data.mouse_mode != RF_2M_2P4G_MODE) { bls_att_pushNotifyData(HID_USER_REPORT_INPUT_DP_H, pData_cmd, 8); @@ -2788,8 +2807,8 @@ void user_protocol_handler (const u8* pData, u8 Len) //luyong for dongle pData_cmd[3] = 1; pData_cmd[4] = flash_dpi_info.bt_dpi; //1 -4 pData_cmd[5] = 0x00; - pData_cmd[6] = 0; //���״Ì? �� 0 �ï¿? �� 1. ���״Ì? - pData_cmd[7] = my_batVal[0]; //���� + pData_cmd[6] = 0; //锟斤拷锟阶刺� 锟斤拷 0 未锟斤拷锟� 锟斤拷 1. 锟斤拷锟阶刺� + pData_cmd[7] = my_batVal[0]; //锟斤拷锟斤拷 //bls_att_pushNotifyData(HID_USER_REPORT_INPUT_DP_H, pData_cmd, 8); if(user_data.mouse_mode != RF_2M_2P4G_MODE) { @@ -2803,8 +2822,8 @@ void user_protocol_handler (const u8* pData, u8 Len) //luyong for dongle pData_cmd[0] = 0x0D|0x80; pData_cmd[1] = 4; //response suscess pData_cmd[2] = 16; //len - memcpy(&pData_cmd[3], mouse_passwd, 8); //���� - memcpy(&pData_cmd[11], user_cfg.dev_sn, 8); //���к� + memcpy(&pData_cmd[3], mouse_passwd, 8); //锟斤拷锟斤拷 + memcpy(&pData_cmd[11], user_cfg.dev_sn, 8); //锟斤拷锟叫猴拷 bls_att_pushNotifyData(HID_USER_REPORT_INPUT_DP_H, pData_cmd, 20); #endif @@ -2903,8 +2922,8 @@ void user_protocol_handler (const u8* pData, u8 Len) //luyong for dongle static char m_url[80]; char m_url_tmp[16]; - u8 len = pData[1]; //���ݰ��ij��� - u8 pack_inx = pData[2]; //data[0] = inx����һ������ + u8 len = pData[1]; //锟斤拷锟捷帮拷锟侥筹拷锟斤拷 + u8 pack_inx = pData[2]; //data[0] = inx锟斤拷锟斤拷一锟斤拷锟斤拷锟斤拷 if(pack_inx == 1) { @@ -2998,27 +3017,36 @@ int userWrite(void *p) void bk_init() { #if BK_AUT - BK_aut_init();//���Ƴ�ʼ�� + BK_aut_init();//锟斤拷锟狡筹拷始锟斤拷 #include "stb_app.h" stb_app_init(); stb_app_deinit(); /* - ��������stb_app_device_init - ������������ʼ��Ӧ�õĵײ� SDK��ִ�б�Ҫ�ij�ʼ���������������Դ�����ó�ʼ״Ì?�ȡ� - ����: uint8_t *pk_str - ָ��PK�ַ������ӻ�ɽ�Ŷӻ�ȡ - uint8_t *ps_str - ָ��PS�ַ������ӻ�ɽ�Ŷӻ�ȡ - uint8_t *mac_str - ָ���豸����MAC�ַ��� - ����ֵ��0 ��ʾ�ɹ�������ֵ��ʾʧ�ܡ� + 锟斤拷锟斤拷锟斤拷锟斤拷stb_app_device_init + 锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷始锟斤拷应锟矫的底诧拷 SDK锟斤拷执锟叫憋拷要锟侥筹拷始锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟皆达拷锟斤拷锟斤拷贸锟绞甲刺拷取锟� + 锟斤拷锟斤拷: uint8_t *pk_str - 指锟斤拷PK锟街凤拷锟斤拷锟斤拷锟接伙拷山锟脚队伙拷取 + uint8_t *ps_str - 指锟斤拷PS锟街凤拷锟斤拷锟斤拷锟接伙拷山锟脚队伙拷取 + uint8_t *mac_str - 指锟斤拷锟借备锟斤拷锟斤拷MAC锟街凤拷锟斤拷 + 锟斤拷锟斤拷值锟斤拷0 锟斤拷示锟缴癸拷锟斤拷锟斤拷锟斤拷值锟斤拷示失锟杰★拷 */ + + //PK:k1r8dNeY2Ui + //: A8uyKmFtYR7Oko2k + //:app_10dyx2ai21r2qkar + // ,这个信息仅供你们使用 + unsigned char pk_str[20] = {0};//= "k1r8dWlSOjM"; - memcpy(pk_str,"k1r8dWlSOjM",strlen("k1r8dWlSOjM")+1); + memcpy(pk_str,"k1r8dNeY2Ui",strlen("k1r8dNeY2Ui")+1); unsigned char ps_str[20] = {0};//"wZUBUo2vnR0LvMq9"; - memcpy(ps_str,"wZUBUo2vnR0LvMq9",strlen("wZUBUo2vnR0LvMq9")+1); + memcpy(ps_str,"A8uyKmFtYR7Oko2k",strlen("A8uyKmFtYR7Oko2k")+1); unsigned char mac_str[13] = {0}; - printf(mac_str,"%02X%02X%02X%02X%02X%02X", + + //printf("GetMac") + sprintf(mac_str,"%02X%02X%02X%02X%02X%02X", user_data.peer_addr.addr[5],user_data.peer_addr.addr[4],user_data.peer_addr.addr[3], user_data.peer_addr.addr[2],user_data.peer_addr.addr[1],user_data.peer_addr.addr[0]); + printf("getmac:%s\n\n",mac_str); int ret = stb_app_device_init(pk_str, ps_str, mac_str); printf("stb_app_device_init:%d",ret); #endif diff --git a/3.code_8251_8373/b85_ble_sdk/vendor/8258_dual_mouse/AAA_app.c b/3.code_8251_8373/b85_ble_sdk/vendor/8258_dual_mouse/AAA_app.c index a9c5bcd..06fe51f 100644 --- a/3.code_8251_8373/b85_ble_sdk/vendor/8258_dual_mouse/AAA_app.c +++ b/3.code_8251_8373/b85_ble_sdk/vendor/8258_dual_mouse/AAA_app.c @@ -207,6 +207,9 @@ void BufToHexString(u8 *rp, u8 *sp, u8 len) void set_adv_scanRsp_data() { + + printf("set_adv_scanRsp_data1 %d\n",device_name_len); + if (device_name_len == 0) { #if (DEVICE_NAME_INCLUDE_MAC_DEBUG) @@ -229,6 +232,10 @@ void set_adv_scanRsp_data() device_name_len = USER_DEVICE_NAME_MAX_LEN; } } + + printf("set_adv_scanRsp_data2 %s\n",user_cfg.device_name); + + memset(&user_cfg.device_name[device_name_len], 0, 18 - device_name_len); memcpy(&tbl_advData_aaa[DEV_POSITION], user_cfg.device_name, device_name_len); @@ -637,8 +644,12 @@ void task_gpio_eary_wakeup(u8 e, u8 *p, int n) void save_smp_inf() { + + // return ; if (pair_success) { + + my_printf_aaa("save_smp_inf\r\n"); pair_success=0; u32 CurStartAddr=0; smp_param_save_t smp_param_new; @@ -754,6 +765,8 @@ int app_host_event_callback(u32 h, u8 *para, int n) pair_success=1; #if UART_PRINT_DEBUG_ENABLE my_printf_aaa("pair success\r\n"); + + //blc_att_requestMtuSizeExchange(BLS_CONN_HANDLE, 0x009e); //blc_att_requestMtuSizeExchange(BLS_CONN_HANDLE, 0x00de); #endif @@ -761,6 +774,7 @@ int app_host_event_callback(u32 h, u8 *para, int n) } break; + case GAP_EVT_SMP_CONN_ENCRYPTION_DONE: { @@ -769,6 +783,8 @@ int app_host_event_callback(u32 h, u8 *para, int n) { conn_step = SMP_FIRST_CONNECT_DONE_AAA; + OPTSensor_Init(1); + //bls_smp_enableParing (SMP_PARING_CONN_TRRIGER); #if UART_PRINT_DEBUG_ENABLE my_printf_aaa("first connected\r\n"); @@ -780,6 +796,8 @@ int app_host_event_callback(u32 h, u8 *para, int n) conn_step = SMP_RECONNECT_DONE_AAA; #if UART_PRINT_DEBUG_ENABLE my_printf_aaa("reconnected\r\n"); + + OPTSensor_Init(1); #endif } connect_begin_tick = clock_time() | 1; @@ -812,12 +830,22 @@ void change_ble_stack_smp_inf() u8 *last=&tmp[0].flag; binding_master_addr_idx = flash_info_load_aaa(CFG_MAST_ADDR, src, LENGHT_USER_BOND_INF); + + printf("binding_master_addr_idx %d\n",binding_master_addr_idx); + if(binding_master_addr_idx<0) { set_pair_flag(); return; - } + }else{ + + + } + + printf("SMP_PARAM_NV_ADDR_START %d\n",SMP_PARAM_NV_ADDR_START); + flash_read_page(SMP_PARAM_NV_ADDR_START, 256, last); + for(u8 i=0;i<8;i++) { if(memcmp(last,src, 256)) @@ -1235,7 +1263,7 @@ void ble_status_proc_aaa(u8 is_new_key_event) if(pair_success) { ble_status_aaa = OK_CONNECTED_STATUS_AAA; - save_smp_inf(); + // save_smp_inf(); } } else if (conn_step == SMP_RECONNECT_DONE_AAA) @@ -1330,8 +1358,10 @@ void ui_loop() idle_status_poll(); ble_status_proc_aaa(has_new_key_event); + if (connect_ok && (ble_status_aaa==T5S_CONNECTED_STATUS_AAA)) { + // OPTSensor_recover(); ble_notify_data_proc_aaa(); } else @@ -1457,7 +1487,22 @@ void main_loop(void) #endif - proc_audio_ble(); + + + if(ui_mic_enable){ + + u8 txFifoNumber123 = blc_ll_getTxFifoNumber();//get tx fifo num + + if(txFifoNumber123<9){ + proc_audio_ble(); + } + else{ + my_printf_aaa("txFifoNumber123=%d\r\n", txFifoNumber123);//debug notify fail + } + + } + + u16 time_interval = 4500; #if(BLT_SOFTWARE_TIMER_ENABLE) blt_soft_timer_process(MAINLOOP_ENTRY); @@ -1489,8 +1534,15 @@ void main_loop(void) // idle_status_poll(); // ble_status_proc_aaa(has_new_key_event); + has_new_key_event = 0; + + + // if(ui_mic_enable) + // return ; + + #if BLE_APP_PM_ENABLE ble_pm_aaa(); diff --git a/3.code_8251_8373/b85_ble_sdk/vendor/8258_dual_mouse/AAA_app_config.h b/3.code_8251_8373/b85_ble_sdk/vendor/8258_dual_mouse/AAA_app_config.h index db3db6f..7bc485d 100644 --- a/3.code_8251_8373/b85_ble_sdk/vendor/8258_dual_mouse/AAA_app_config.h +++ b/3.code_8251_8373/b85_ble_sdk/vendor/8258_dual_mouse/AAA_app_config.h @@ -71,7 +71,7 @@ enum //---------------------------security References---------------------------------------- #define BLE_REMOTE_SECURITY_ENABLE 1 -#define RF_TX_FIFO_ALLOW_NUM 9//14-5 audio -1 mouse =8 +#define RF_TX_FIFO_ALLOW_NUM 14//14-5 audio -1 mouse =8 //-------------------------------24g----------------------- #if(1) typedef enum diff --git a/3.code_8251_8373/b85_ble_sdk/vendor/8258_dual_mouse/AAA_app_config_Telink_QFN32.h b/3.code_8251_8373/b85_ble_sdk/vendor/8258_dual_mouse/AAA_app_config_Telink_QFN32.h index d79ec5e..696b680 100644 --- a/3.code_8251_8373/b85_ble_sdk/vendor/8258_dual_mouse/AAA_app_config_Telink_QFN32.h +++ b/3.code_8251_8373/b85_ble_sdk/vendor/8258_dual_mouse/AAA_app_config_Telink_QFN32.h @@ -15,10 +15,10 @@ #define DEVICE_NAME_INCLUDE_MAC_DEBUG 0 //for debug #define MUTI_DEVICE_SWITCH_DEBUG 0 //for debug - #define ADC_BATT_DEBUG 0 //enbale : in ble mode £¬notify adc value. + #define ADC_BATT_DEBUG 0 //enbale : in ble mode ��notify adc value. // test mcu current ,in the mode,sensor shut down , - // when both left and right button are pressed £¬mouse auto draw a square in conencted + // when both left and right button are pressed ��mouse auto draw a square in conencted #define TEST_MCU_CURRENT_DEBUG 0 #define SHOW_MAST_REAL_MAC_DEBUG 0//for test get master real addr @@ -66,7 +66,7 @@ #define OTA_ENABLE_AAA 1 - #define EMI_TEST_FUN_ENABLE_AAA ((!ADAPT_ALL_HW_AUTO_DRAW_IN_D24G_MODE_DEBUG)&&1)//If the flash is 128k, must be set 0£¬save 2k + #define EMI_TEST_FUN_ENABLE_AAA ((!ADAPT_ALL_HW_AUTO_DRAW_IN_D24G_MODE_DEBUG)&&1)//If the flash is 128k, must be set 0��save 2k #define BATT_CHECK_ENABLE ((!ADAPT_ALL_HW_AUTO_DRAW_IN_D24G_MODE_DEBUG)&&1) @@ -77,7 +77,7 @@ #define SENSOR_FUN_ENABLE_AAA ((!ADAPT_ALL_HW_AUTO_DRAW_IN_D24G_MODE_DEBUG)&&1) #define SENSOR_MOTION_ENABLE 1 #define SENSOR_CS_ENABLE 0 - #define SENSOR_SHUT_DOWN_ENABLE 0 + #define SENSOR_SHUT_DOWN_ENABLE 1 #define BLT_APP_LED_ENABLE ((!ADAPT_ALL_HW_AUTO_DRAW_IN_D24G_MODE_DEBUG)&&1) #define LED_OFF_AAA 1 @@ -186,25 +186,25 @@ #define BTN_PM_WAKEUP_SRC PM_PIN_PULLUP_1M - #define PIN_BTN_LEFT GPIO_PB5 + #define PIN_BTN_LEFT GPIO_PD2 #define PD2_INPUT_ENABLE 1 #define PD2_OUTPUT_ENABLE 0 #define PD2_DATA_OUT 1 #define PULL_WAKEUP_SRC_PD2 BTN_PM_WAKEUP_SRC - #define PIN_BTN_RIGHT GPIO_PB6 + #define PIN_BTN_RIGHT GPIO_PD3 #define PD3_INPUT_ENABLE 1 #define PD3_OUTPUT_ENABLE 0 #define PD3_DATA_OUT 1 #define PULL_WAKEUP_SRC_PD3 BTN_PM_WAKEUP_SRC - #define PIN_BTN_M GPIO_PD3 + #define PIN_BTN_MIDDLE GPIO_PB5 #define PB5_INPUT_ENABLE 1 #define PB5_OUTPUT_ENABLE 0 #define PB5_DATA_OUT 1 #define PULL_WAKEUP_SRC_PB5 BTN_PM_WAKEUP_SRC - #define PIN_MODE_SWITCH GPIO_PD2 + #define PIN_MODE_SWITCH GPIO_PB6 #define PB6_INPUT_ENABLE 1 #define PB6_OUTPUT_ENABLE 0 #define PB6_DATA_OUT 1 @@ -213,7 +213,7 @@ #define PB6_FUNC AS_GPIO #define IS_BLE_MODE_AAA (gpio_read(PIN_MODE_SWITCH)!=0) - #define BTN_MATRIX {PIN_BTN_LEFT,PIN_BTN_RIGHT,PIN_BTN_M,PIN_MODE_SWITCH} + #define BTN_MATRIX {PIN_BTN_LEFT,PIN_BTN_RIGHT,PIN_BTN_MIDDLE,PIN_MODE_SWITCH} #endif @@ -246,21 +246,20 @@ #define PULL_WAKEUP_SRC_PC3 PM_PIN_UP_DOWN_FLOAT - #define PIN_BLE_LED GPIO_PC2 + #define PIN_BLE_LED GPIO_PA7 + #define PA7_INPUT_ENABLE 0 + #define PA7_OUTPUT_ENABLE 1 + #define PA7_DATA_OUT LED_OFF_AAA + #define PULL_WAKEUP_SRC_PA7 PM_PIN_UP_DOWN_FLOAT + #define PA7_FUNC AS_GPIO + + #define PIN_BLE2_LED GPIO_PC2 #define PC2_INPUT_ENABLE 0 #define PC2_OUTPUT_ENABLE 1 #define PC2_DATA_OUT LED_OFF_AAA #define PULL_WAKEUP_SRC_PC2 PM_PIN_UP_DOWN_FLOAT #define PC2_FUNC AS_GPIO - #define PIN_BLE2_LED GPIO_PA7 - #define PA7_INPUT_ENABLE 0 - #define PA7_OUTPUT_ENABLE 1 - #define PA7_DATA_OUT LED_OFF_AAA - #define PULL_WAKEUP_SRC_PA7 PM_PIN_UP_DOWN_FLOAT - #define PA7_FUNC AS_GPIO - - #endif diff --git a/3.code_8251_8373/b85_ble_sdk/vendor/8258_dual_mouse/AAA_main.c b/3.code_8251_8373/b85_ble_sdk/vendor/8258_dual_mouse/AAA_main.c index 70e1ea3..8ac0c13 100644 --- a/3.code_8251_8373/b85_ble_sdk/vendor/8258_dual_mouse/AAA_main.c +++ b/3.code_8251_8373/b85_ble_sdk/vendor/8258_dual_mouse/AAA_main.c @@ -289,6 +289,7 @@ _attribute_ram_code_ int main(void) //must run in ramcode dev_info_idx = flash_info_load_aaa(CFG_DEVICE_MODE_ADDR, (u8 *)&flash_dev_info.dongle_id, SAVE_MAX_IN_FLASH); if (dev_info_idx < 0) { + printf("dev_info_idx111\n"); //flash_dev_info.mode = RF_2M_2P4G_MODE; flash_dev_info.mode = RF_1M_BLE_MODE; flash_dev_info.mast_id = 0; @@ -297,6 +298,10 @@ _attribute_ram_code_ int main(void) //must run in ramcode flash_dev_info.slave_mac_addr[2] = 0; flash_dev_info.slave_mac_addr[3] = 0; flash_dev_info.dongle_id = 0; + }else{ + + printf("dev_info_idx222\n"); + } blc_app_loadCustomizedParameters(); //load customized freq_offset cap value @@ -372,6 +377,9 @@ _attribute_ram_code_ int main(void) //must run in ramcode printf("init ok\r\n"); irq_enable(); + if(pair_flag==1) + OPTSensor_Shutdown(); + while (1) { #if (MODULE_WATCHDOG_ENABLE) @@ -400,7 +408,7 @@ _attribute_ram_code_ int main(void) //must run in ramcode if (clock_time_exceed(tick, 3000000)) { tick = clock_time(); - if(fun_mode!= RF_2M_2P4G_MODE) + //if(fun_mode!= RF_2M_2P4G_MODE) my_printf_aaa("poll mode=%x,ble_status=%x,fifoNum=%x,interval=%x,latency=%x,timeout=%x\r\n", fun_mode, ble_status_aaa, blc_ll_getTxFifoNumber(), bls_ll_getConnectionInterval(), bls_ll_getConnectionLatency(), bls_ll_getConnectionTimeout()); } #endif diff --git a/3.code_8251_8373/b85_ble_sdk/vendor/8258_dual_mouse/BK_aut.c b/3.code_8251_8373/b85_ble_sdk/vendor/8258_dual_mouse/BK_aut.c index 891cd67..be1a237 100644 --- a/3.code_8251_8373/b85_ble_sdk/vendor/8258_dual_mouse/BK_aut.c +++ b/3.code_8251_8373/b85_ble_sdk/vendor/8258_dual_mouse/BK_aut.c @@ -13,7 +13,7 @@ //#define sprintf u_sprintf #if BK_UART_DEBUG -extern int _print(char **out, const char *format, va_list args); + extern int _print(char **out, const char *format, va_list args); bk_uart_data_t bk_uart_buff={UART_PRINT_BUF_MAX_LEN,{0}}; void bk_uart_irq_proc(void) { @@ -67,7 +67,7 @@ void bk_send_log(unsigned char*data,int len) //memcpy(bk_uart_buff.uart_print_buf,data,len); uart_dma_send( (unsigned char*)&bk_uart_buff); } -//´®¿Ú³õʼ»¯ +//???????? void bk_uart_init(void) { @@ -128,15 +128,15 @@ int hexstringtobyte(char *in, unsigned char *out) int len = (int)strlen(in); for (int i = 0; i < len; i+=2) { - //Сдת´óд + //����???�� if(in[i] >= 'a' && in[i] <= 'f') in[i] = in[i] & ~0x20; if(in[i+1] >= 'a' && in[i] <= 'f') in[i+1] = in[i+1] & ~0x20; - //´¦ÀíµÚǰ4λ + //???????4�� if(in[i] >= 'A' && in[i] <= 'F') out[i/2] = (in[i]-'A'+10)<<4; else out[i/2] = (in[i] & ~0x30)<<4; - //´¦Àíºó4λ, ²¢×éºÏÆðÀ´ + //??????4��, ????????? if(in[i+1] >= 'A' && in[i+1] <= 'F') out[i/2] |= (in[i+1]-'A'+10); else @@ -176,7 +176,7 @@ char *bk_strstr(const char *haystack, const char *needle) { return NULL; } int my_isdigit(char ch) { - // Èç¹û×Ö·ûµÄASCIIÖµÔÚ'0'µ½'9'Ö®¼ä£¨¼´48µ½57£©£¬Ôò·µ»Ø·ÇÁãÖµ£¨±íÊ¾Õæ£© + // ????????ASCII???'0'??'9'?????48??57?????????????????�� return (ch >= '0' && ch <= '9'); } char my_isblank(char ch) @@ -188,15 +188,15 @@ char my_isblank(char ch) } int my_atoi(const char *str) { int result = 0; - int sign = 1; // ¼ÙÉèΪÕýÊý - int base = 10; // ĬÈÏÊ®½øÖÆ + int sign = 1; // ????????? + int base = 10; // ???????? - // Ìø¹ýǰµ¼¿Õ¸ñ + // ?????????? while (my_isblank((unsigned char)*str)) { str++; } - // ´¦ÀíÕý¸ººÅ + // ?????????? if (*str == '-') { sign = -1; str++; @@ -205,15 +205,15 @@ int my_atoi(const char *str) { } // int send_buf_len = u_sprintf(bk_uart_buff.uart_print_buf,"my_atoi:%d i:%s!!!!!!!!!!!!!\r\n",cpi_tmp,send_buf); // bk_send_log(bk_uart_buff.uart_print_buf,send_buf_len); - // ת»»Êý×Ö×Ö·û + // ?????????? while (my_isdigit((unsigned char)*str)) { - // ×¢Ò⣺ÕâÀï¼ò»¯ÁË´¦Àí£¬Ã»Óмì²éÒç³ö - // ÔÚʵ¼ÊʵÏÖÖУ¬Ó¦¸ÃÌí¼Ó¼ì²éÒÔ±ÜÃâÕûÊýÒç³ö + // ?????????????????��????? + // ?????????��?????????????????????? result = result * base + (*str - '0'); str++; } - // ·µ»Ø´ø·ûºÅµÄ½á¹û + // ???????????? return sign * result; } @@ -253,7 +253,7 @@ void BK_aut_init(void) //int SN_len = 0; user_data_param_t user_data_tmp; - bk_uart_init();//´òÓ¡´®¿Ú³õʼ»¯ + bk_uart_init();//??????????? unsigned char check_count = 5; while(check_count--) { @@ -269,7 +269,7 @@ void BK_aut_init(void) { //printf(">>>>>>>>load user data\r\n"); - }else//ĬÈÏÅäÖà + }else//??????? { // user_data.reset_status = 0xA5A5A5A5; // user_data.reset_end = 0xA5A5A5A5; @@ -289,7 +289,7 @@ void BK_aut_init(void) //memset(user_data.deviceSecret,0,sizeof(user_data.deviceSecret)); user_data.activated_dtate = 0; //strcpy(user_data.SN,"MSCL123456789"); - user_data.mouse_mode = RF_1M_BLE_MODE; + user_data.mouse_mode = RF_1M_BLE1_MODE; user_data.url_switch = 1; user_data.record_mode = 0; memset(user_data.official_url,0,sizeof(user_data.official_url)); @@ -327,7 +327,7 @@ void read_data_resolver(unsigned char *data, unsigned int data_len) { } - if(user_parse_data((char *)data) == 0)//²»ÊÇÓû§ÃüÁî + if(user_parse_data((char *)data) == 0)//??????????? { } @@ -351,7 +351,7 @@ void BK_aut_hal_recv(unsigned char * p_data, unsigned int len) //bk_send_log(send_buf,len_tmp); // ble_debug(data_buf,len_tmp); //bls_att_pushNotifyData(APP_CMD_PD_H,"BK_aut_hal_recv end ",sizeof("BK_aut_hal_recv end ")); - if(sta_data_tmp!=NULL && end_data_tmp ==NULL)//Ö»ÓпªÍ· + if(sta_data_tmp!=NULL && end_data_tmp ==NULL)//??��?? { //ble_debug("bizbus_pack_recv1111!!!!!!s\r\n",sizeof("bizbus_pack_recv1111!!!!!!s\r\n")); data_buf_len = 0; @@ -360,10 +360,10 @@ void BK_aut_hal_recv(unsigned char * p_data, unsigned int len) len_tmp = strlen((char *)data)-strlen("-$$"); memcpy(data_buf,sta_data_tmp,len_tmp); data_buf_len += len_tmp; - }else if(sta_data_tmp == NULL && end_data_tmp ==NULL && data_buf_len != 0)//ûÓпªÍ·£¬Ã»Óнá⣬µ«Óлº´æ + }else if(sta_data_tmp == NULL && end_data_tmp ==NULL && data_buf_len != 0)//??��??????��?��?????��??? { //ble_debug("bizbus_pack_recv222!!!!!!s\r\n",sizeof("bizbus_pack_recv222!!!!!!s\r\n")); - if(data_buf_len + strlen((char *)data) >= DATA_BUF_MAX_LEN)//³¬¹ý×î´óÖµÖ±½Ó¶ª + if(data_buf_len + strlen((char *)data) >= DATA_BUF_MAX_LEN)//???????????? { memset(data_buf,0,sizeof(data_buf)); data_buf_len = 0; @@ -377,12 +377,12 @@ void BK_aut_hal_recv(unsigned char * p_data, unsigned int len) } - }else if(sta_data_tmp == NULL && end_data_tmp !=NULL)//ûÓпªÍ·£¬Óнáβ + }else if(sta_data_tmp == NULL && end_data_tmp !=NULL)//??��?????��?�� { //ble_debug("bizbus_pack_recv33333!!!!!!s\r\n",sizeof("bizbus_pack_recv33333!!!!!!s\r\n")); if(data_buf_len != 0) { - if(data_buf_len + strlen((char *)data) >= DATA_BUF_MAX_LEN)//³¬¹ý×î´óÖµÖ±½Ó¶ª + if(data_buf_len + strlen((char *)data) >= DATA_BUF_MAX_LEN)//???????????? { memset(data_buf,0,sizeof(data_buf)); data_buf_len = 0; @@ -400,7 +400,7 @@ void BK_aut_hal_recv(unsigned char * p_data, unsigned int len) data_buf_len = 0; } } - }else if(sta_data_tmp != NULL && end_data_tmp !=NULL)//ÓпªÍ·£¬Óнáβ + }else if(sta_data_tmp != NULL && end_data_tmp !=NULL)//?��?????��?�� { //ble_debug("bizbus_pack_recv444444!!!!!!s\r\n",sizeof("bizbus_pack_recv444444!!!!!!s\r\n")); if(data_buf_len != 0) @@ -429,7 +429,7 @@ void BK_aut_hal_recv(unsigned char * p_data, unsigned int len) } } -//×Ö·û´®Àï²éÕÒ×î½üÒ»¸öc×Ö·û£¬·µ»ØÆ«ÒÆÎ»Öà +//????????????????c????????????��?? unsigned int find_c(char *data,char c) { unsigned int count = 0; @@ -543,7 +543,7 @@ int cpyd_to_send(u8* tem_str1,u8* ndata, int len) return send_buf_len; } -//½âÎö³É¹¦·µ»Ø0 +//???????????0 char user_parse_data(char *data) { char ret = 0; @@ -796,7 +796,7 @@ char user_parse_data(char *data) str_tmp = bk_strstr(cmd_str_tmp,"\"get_rssi\""); if(str_tmp) { - //updata_ble_simple_link_rssi();//¸üÐÂÐźÅ,ÔÚcase GAP_EVT_LINK_RSSI:»Øµ÷»Ø·µÖµ + //updata_ble_simple_link_rssi();//???????,??case GAP_EVT_LINK_RSSI:??????? ret = 1; } diff --git a/3.code_8251_8373/b85_ble_sdk/vendor/8258_dual_mouse/BK_aut_api.c b/3.code_8251_8373/b85_ble_sdk/vendor/8258_dual_mouse/BK_aut_api.c index 4129b80..b6f382f 100644 --- a/3.code_8251_8373/b85_ble_sdk/vendor/8258_dual_mouse/BK_aut_api.c +++ b/3.code_8251_8373/b85_ble_sdk/vendor/8258_dual_mouse/BK_aut_api.c @@ -29,15 +29,15 @@ int APP_BLE_write(void *p) if (req->l2capLen >3 ) { //vendor_protocol_handler(pBuffer,req->l2capLen-3); - //bls_att_pushNotifyData(APP_CMD_PD_H,"ÊÕµ½ÁË111\n",sizeof("ÊÕµ½ÁË111\n")); + //bls_att_pushNotifyData(APP_CMD_PD_H,"锟秸碉拷锟斤拷111\n",sizeof("锟秸碉拷锟斤拷111\n")); BK_aut_hal_recv(pBuffer,req->l2capLen-3); } return 1; } -//°²È«Êý¾ÝAPI£¬ÐèÒªÒ»¿éµ¥¶À´óСΪ4KµÄÇøÓò´æ´¢£¬ÒªÇó»Ö¸´³ö³§ÉèÖò»Äܱ»Çå³ý¡¢OTA²»Äܱ»Çå³ý¡¢³£¹æÉÕ¼Éý¼¶²»Äܱ»Çå³ý +//锟斤拷全锟斤拷锟斤拷API锟斤拷锟斤拷要一锟介单锟斤拷锟斤拷小为4K锟斤拷锟斤拷锟斤拷娲拷锟揭拷锟街革拷锟斤拷锟斤拷锟斤拷锟矫诧拷锟杰憋拷锟斤拷锟斤拷锟絆TA锟斤拷锟杰憋拷锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟铰硷拷锟斤拷锟斤拷锟斤拷鼙锟斤拷锟斤拷 /** - * °²È«Êý¾ÝдÈ룬´óСΪ4K£¬ÐèÒª³§ÉÌʵÏÖ + * 锟斤拷全锟斤拷锟斤拷写锟诫,锟斤拷小为4K锟斤拷锟斤拷要锟斤拷锟斤拷实锟斤拷 * * @param[in] offset the offset of the reserved partition * @param[out] data the data need to write @@ -52,7 +52,7 @@ int BK_hal_flash_write(unsigned int offset, void *data, unsigned int write_len) } /** - * °²È«Êý¾Ý¶ÁÈ¡£¬´óСΪ4K£¬ÐèÒª³§ÉÌʵÏÖ + * 锟斤拷全锟斤拷锟捷讹拷取锟斤拷锟斤拷小为4K锟斤拷锟斤拷要锟斤拷锟斤拷实锟斤拷 * * @param[in] offset the offset of the reserved partition * @param[out] data the data need to read @@ -66,7 +66,7 @@ int BK_hal_flash_read(unsigned int offset, void *data, unsigned int read_len) return 0; } /** - * °²È«Êý¾Ý²Á³ý£¬´óСΪ4K£¬ÐèÒª³§ÉÌʵÏÖ + * 锟斤拷全锟斤拷锟捷诧拷锟斤拷锟斤拷锟斤拷小为4K锟斤拷锟斤拷要锟斤拷锟斤拷实锟斤拷 * * @param[in] erase_offset the offset of the reserved partition * @param[in] earse_len the length of the data need to erase @@ -79,18 +79,18 @@ int BK_hal_flash_erase(unsigned int erase_offset,unsigned int earse_len) flash_erase_sector(CFG_BK_APP_ADDR); return 0; } -//»ñÈ¡MACµØÖ·,¸´ÖÆ6×Ö½ÚMACµØÖ·µ½MAC_buf +//锟斤拷取MAC锟斤拷址,锟斤拷锟斤拷6锟街斤拷MAC锟斤拷址锟斤拷MAC_buf void BK_get_MAC(unsigned char *MAC_buf) { memcpy(MAC_buf,user_data.peer_addr.addr,6); } -//ÉèÖÃMACµØÖ·,ÉèÖÃ6×Ö½ÚMACµØÖ·µ½flash +//锟斤拷锟斤拷MAC锟斤拷址,锟斤拷锟斤拷6锟街斤拷MAC锟斤拷址锟斤拷flash void BK_set_MAC(unsigned char *MAC_buf) { memcpy(user_data.peer_addr.addr,MAC_buf,6); user_data_storage_do(); } -//»ñÈ¡SN,¸´ÖÆSNµ½SN_buf,·µ»ØSN³¤¶È¡£29×Ö½ÚÒÔÄÚ +//锟斤拷取SN,锟斤拷锟斤拷SN锟斤拷SN_buf,锟斤拷锟斤拷SN锟斤拷锟饺★拷29锟街斤拷锟斤拷锟斤拷 int BK_get_SN( char *SN_buf ) { int len = strlen(user_data.SN); @@ -98,7 +98,7 @@ int BK_get_SN( char *SN_buf ) len = sizeof(user_data.SN); memcpy(SN_buf,user_data.SN,len); } -//ÉèÖÃSN 29×Ö½ÚÒÔÄÚ +//锟斤拷锟斤拷SN 29锟街斤拷锟斤拷锟斤拷 void BK_set_SN( char *SN_buf ,int len) { if(len > sizeof(user_data.SN)-1) @@ -107,7 +107,7 @@ void BK_set_SN( char *SN_buf ,int len) user_data.SN[len] = 0; user_data_storage_do(); } -//»ñÈ¡µç³ØµçÁ¿°Ù·Ö±È +//锟斤拷取锟斤拷氐锟斤拷锟斤拷俜直锟� unsigned char BK_get_battery_precent(void) { //return 100; @@ -116,9 +116,9 @@ unsigned char BK_get_battery_precent(void) -//ÐèÒª³§ÉÌʵÏÖ£¬ÓëAPP SDK¶ËµÄÊý¾ÝÊÕ·¢¡£Êó±êÓ¦ÓÐÁ½¸öͨµÀ£¬APPÀ¶ÑÀͨµÀÒÔ¼°USBͨµÀ +//锟斤拷要锟斤拷锟斤拷实锟街o拷锟斤拷APP SDK锟剿碉拷锟斤拷锟斤拷锟秸凤拷锟斤拷锟斤拷锟接︼拷锟斤拷锟斤拷锟酵拷锟斤拷锟紸PP锟斤拷锟斤拷通锟斤拷锟皆硷拷USB通锟斤拷 /* - * ʵÏÖÊý¾Ý·¢ËÍ½Ó¿Ú + * 实锟斤拷锟斤拷锟捷凤拷锟酵接匡拷 */ void BK_aut_hal_send(unsigned char * p_data, unsigned int len) @@ -126,7 +126,7 @@ void BK_aut_hal_send(unsigned char * p_data, unsigned int len) // p_data[len] = 0; // sleep_ms(300); - if (user_data.mouse_mode == RF_1M_BLE1_MODE || user_data.mouse_mode ==RF_1M_BLE_MODE)//À¶ÑÀ + if (user_data.mouse_mode == RF_1M_BLE1_MODE || user_data.mouse_mode ==RF_1M_BLE_MODE)//锟斤拷锟斤拷 { //bls_att_pushNotifyData(USER_REPORT_INPUT_CD2_H, p_data, len); u8 success = bls_att_pushNotifyData(APP_CMD_PD_H,p_data,len); @@ -136,7 +136,7 @@ void BK_aut_hal_send(unsigned char * p_data, unsigned int len) } }else if(user_data.mouse_mode == RF_2M_2P4G_MODE) { - // int send_buf_len = u_sprintf(bk_uart_buff.uart_print_buf,"»Ø¸´½ÓÊÕÆ÷:%s!!!!!!!!!!!!!\r\n",p_data); + // int send_buf_len = u_sprintf(bk_uart_buff.uart_print_buf,"锟截革拷锟斤拷锟斤拷锟斤拷:%s!!!!!!!!!!!!!\r\n",p_data); // bk_send_log(bk_uart_buff.uart_print_buf,send_buf_len); // int log_tmp_len = sprintf(bk_uart_buff.uart_print_buf,"123456!!!!!!!!!!!!!\r\n"); @@ -144,22 +144,22 @@ void BK_aut_hal_send(unsigned char * p_data, unsigned int len) //sleep_ms(50); unsigned char data_tmp[20]={0}; int len_tmp = 0; - while(1)//·Ö°ü£¬Ö»ÄÜ20×Ö½ÚÒ»°ü + while(1)//锟街帮拷锟斤拷只锟斤拷20锟街斤拷一锟斤拷 { if(len - len_tmp > 19) { data_tmp[0]=0x12; memcpy(&data_tmp[1],p_data+len_tmp,19) ; - //bls_att_pushNotifyData(HID_USER_REPORT_INPUT_DP_H, data_tmp, 20);//»Ø¸´½ÓÊÕÆ÷ + //bls_att_pushNotifyData(HID_USER_REPORT_INPUT_DP_H, data_tmp, 20);//锟截革拷锟斤拷锟斤拷锟斤拷 d24g_app_data(data_tmp, 20); len_tmp += 19; - }else//½áÊø°ü + }else//锟斤拷锟斤拷锟斤拷 { memset(data_tmp,0,sizeof(data_tmp)); data_tmp[0]=0x12; memcpy(&data_tmp[1],p_data+len_tmp,len - len_tmp) ; d24g_app_data(data_tmp, 20); - //bls_att_pushNotifyData(HID_USER_REPORT_INPUT_DP_H, data_tmp, 20);//»Ø¸´½ÓÊÕÆ÷ + //bls_att_pushNotifyData(HID_USER_REPORT_INPUT_DP_H, data_tmp, 20);//锟截革拷锟斤拷锟斤拷锟斤拷 break; } @@ -180,9 +180,9 @@ unsigned char get_is_connect(void) } static bool amic_onoff = false; extern u32 audio_stick ; -void amic_start(void)//¿ªÊ¼Â¼Òô +void amic_start(void)//锟斤拷始录锟斤拷 { - // if(user_data.activated_dtate != 1)//û¼¤»îֹͣ¼Òô + // if(user_data.activated_dtate != 1)//没锟斤拷锟斤拷停止录锟斤拷 // return; if (amic_onoff == false) { @@ -193,7 +193,7 @@ void amic_start(void)// amic_onoff = true; } } -//¼ÒôÍ£Ö¹ +//录锟斤拷停止 void amic_stop(void) { if (amic_onoff == true) @@ -203,17 +203,17 @@ void amic_stop(void) amic_onoff = false; } } -//°´¼ü¼üÖµÊý¾Ý·µ»Ø +//锟斤拷锟斤拷锟斤拷值锟斤拷锟捷凤拷锟斤拷 void BK_ble_app_data_tx(unsigned char * p_data, unsigned int len) { - if (user_data.mouse_mode == RF_1M_BLE1_MODE || user_data.mouse_mode ==RF_1M_BLE_MODE)//À¶ÑÀ + if (user_data.mouse_mode == RF_1M_BLE1_MODE || user_data.mouse_mode ==RF_1M_BLE_MODE)//锟斤拷锟斤拷 { bls_att_pushNotifyData(APP_AI_PD_H,p_data,len); }else if(user_data.mouse_mode == RF_2M_2P4G_MODE) { - //bls_att_pushNotifyData(HID_USER_REPORT_INPUT_DP_H, p_data, len);//»Ø¸´½ÓÊÕÆ÷ - // int send_buf_len = u_sprintf(bk_uart_buff.uart_print_buf,"°´¼ü»Ø¸´½ÓÊÕÆ÷:%s!!!!!!!!!!!!!\r\n",p_data); + //bls_att_pushNotifyData(HID_USER_REPORT_INPUT_DP_H, p_data, len);//锟截革拷锟斤拷锟斤拷锟斤拷 + // int send_buf_len = u_sprintf(bk_uart_buff.uart_print_buf,"锟斤拷锟斤拷锟截革拷锟斤拷锟斤拷锟斤拷:%s!!!!!!!!!!!!!\r\n",p_data); // bk_send_log(bk_uart_buff.uart_print_buf,send_buf_len); unsigned char data_tmp[20]={0}; memset(data_tmp,0,sizeof(data_tmp)); @@ -222,41 +222,41 @@ void BK_ble_app_data_tx(unsigned char * p_data, unsigned int len) len = 19; memcpy(&data_tmp[1],p_data,len ) ; d24g_app_data(data_tmp, 20); - //bls_att_pushNotifyData(HID_USER_REPORT_INPUT_DP_H, data_tmp, 20);//»Ø¸´½ÓÊÕÆ÷ + //bls_att_pushNotifyData(HID_USER_REPORT_INPUT_DP_H, data_tmp, 20);//锟截革拷锟斤拷锟斤拷锟斤拷 } } /* - °´æIЭÒé + 锟斤拷锟絀协锟斤拷 byte0: 0x0A report id - byte1: Êó±êÉ豸µÄ״̬ - bit0: 2.4G ģʽÏÂ, 0: mouse disconnect 1: mouse connect - bit1: LED LOGO µÆ×´Ì¬ 0: led off 1: led on - bit2: µ¯Çý¶¯URL ¿ª¹Ø 0: off 1: on - bit3: 䶨Òå - bit5:bit4: µ±Ç°É豸֧³ÖͨµÀ 2: 2.4G/À¶ÑÀ - 3: 2.4G/À¶ÑÀ1/À¶ÑÀ2 - bit7:bit6: É豸µ±Ç°Í¨µÀËùÔÚµµÎ» 0: usb ½ÓÊÕÆ÷ - 1: À¶ÑÀ1 - 2: À¶ÑÀ2 - 3: À¶ÑÀ3 - byte2: ĬÈÏÊÇ0; ÈÏÖ¤Ëæ»úÂë - byte3: 0-100, ±íʾµçÁ¿°Ù·Ö±È - byte4: ¹âµçICËùÔÚµÄdpiµµÎ» - byte5: ÖÇÄܹ¦Äܰ´¼ü¼üÖµ + byte1: 锟斤拷锟斤拷璞革拷锟阶刺� + bit0: 2.4G 模式锟斤拷, 0: mouse disconnect 1: mouse connect + bit1: LED LOGO 锟斤拷状态 0: led off 1: led on + bit2: 锟斤拷锟斤拷锟斤拷URL 锟斤拷锟斤拷 0: off 1: on + bit3: 未锟斤拷锟斤拷 + bit5:bit4: 锟斤拷前锟借备支锟斤拷通锟斤拷 2: 2.4G/锟斤拷锟斤拷 + 3: 2.4G/锟斤拷锟斤拷1/锟斤拷锟斤拷2 + bit7:bit6: 锟借备锟斤拷前通锟斤拷锟斤拷锟节碉拷位 0: usb 锟斤拷锟斤拷锟斤拷 + 1: 锟斤拷锟斤拷1 + 2: 锟斤拷锟斤拷2 + 3: 锟斤拷锟斤拷3 + byte2: 默锟斤拷锟斤拷0; 锟斤拷证锟斤拷锟斤拷锟� + byte3: 0-100, 锟斤拷示锟斤拷锟斤拷锟劫分憋拷 + byte4: 锟斤拷锟絀C锟斤拷锟节碉拷dpi锟斤拷位 + byte5: 锟斤拷锟杰癸拷锟杰帮拷锟斤拷锟斤拷值 byte6: - byte7: µÍËÄλbit0~bit3±íʾ¹âµçICÐͺŠ1: PAW3205 + byte7: 锟斤拷锟斤拷位bit0~bit3锟斤拷示锟斤拷锟絀C锟酵猴拷 1: PAW3205 2: PAW3212 3: PAW3065 4: PAW3065XY 5: KA8 6: KA8G2 - 7£ºKA5857 - byte8: ·¢Éä¶Ë¹Ì¼þ°æ±¾ - byte9: ÓëBYTE6¸ßËÄλƴ½Ó£¬×é³ÉÊó±êÐͺÅÖµ + 7锟斤拷KA5857 + byte8: 锟斤拷锟斤拷斯碳锟斤拷姹� + byte9: 锟斤拷BYTE6锟斤拷锟斤拷位拼锟接o拷锟斤拷锟斤拷锟斤拷锟酵猴拷值 byte10: - byte11: À¶ÑÀÉ豸ÐòºÅ + byte11: 锟斤拷锟斤拷锟借备锟斤拷锟� byte12: byte13: byte14: @@ -305,7 +305,7 @@ void disconnect_button_handle(void) voice_single_start_flag = 0; amic_stop(); } -//½øÈëÖØÐÂÅä¶Ôģʽ +//锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟侥J� void mouse_enter_pairing(void) { @@ -331,7 +331,7 @@ void mouse_enter_pairing(void) } -//Çл»Ä£Ê½ +//锟叫伙拷模式 void mouse_channel_switch() { const char * work_mode_str[] = { @@ -345,7 +345,7 @@ void mouse_channel_switch() user_data.mouse_mode = RF_2M_2P4G_MODE; //fun_mode = user_data.mouse_mode; user_data_storage_do(); - //bk_printf("Çл»Ä£Ê½\r\n"); + //bk_printf("锟叫伙拷模式\r\n"); sleep_ms(20); printf("mouse_channel_switch:%s",work_mode_str[user_data.mouse_mode]); if(user_data.mouse_mode == RF_2M_2P4G_MODE) @@ -402,6 +402,11 @@ void mouse_channel_switch() //0A 27 00 63 01 25 00 FF 01 01 00 80 00 00 02 00 // 0A FF FF 2F BC 42 00040101C045028A0F79sendcmdth... + + +u8 need_send_btn_key=0; + + void BK_button_callback(Button_t btn, PressEvent event) { /* @@ -415,7 +420,7 @@ void BK_button_callback(Button_t btn, PressEvent event) // BK_ble_app_data_tx(send_buf,len_tmp); //BK_ble_app_data_tx("hahaha",6); //return; - if (btn == AI_button)//AI¼ü + if (btn == AI_button)//AI锟斤拷 { static unsigned char translate_long_press_flag = 0; @@ -427,6 +432,8 @@ void BK_button_callback(Button_t btn, PressEvent event) { if(user_data.record_mode!=1) amic_stop(); + device_key_send(0x26); + device_key_send(0x26); device_key_send(0x26); translate_long_press_flag = 0; } @@ -435,6 +442,9 @@ void BK_button_callback(Button_t btn, PressEvent event) case SINGLE_CLICK: bk_printf("AI_button SINGLE_CLICK\r\n"); device_key_send(0x42); + device_key_send(0x42); + device_key_send(0x42); + break; case LONG_PRESS_START: @@ -444,9 +454,16 @@ void BK_button_callback(Button_t btn, PressEvent event) if(user_data.record_mode!=1) amic_stop(); device_key_send(0x32); + device_key_send(0x32); + device_key_send(0x32); + voice_single_start_flag = 0; } + + device_key_send(0x25); + device_key_send(0x25); device_key_send(0x25); + if (get_is_connect() && user_data.record_mode!=1) { amic_start(); @@ -456,7 +473,7 @@ void BK_button_callback(Button_t btn, PressEvent event) } } - if (btn == voice_button)//ÓïÒô¼ü + if (btn == voice_button)//锟斤拷锟斤拷锟斤拷 { static unsigned char voice_long_press_flag = 0; @@ -469,11 +486,13 @@ void BK_button_callback(Button_t btn, PressEvent event) case PRESS_UP: bk_printf("voice_button PRESS_UP\r\n"); - // ³¤°´Ì§Æð½áÊøÂ¼Òô£¬¶Ì°´Ì§ÆðÔÚSINGLE_CLICKÖд¦Àí + // 锟斤拷锟斤拷抬锟斤拷锟斤拷锟铰硷拷锟斤拷锟斤拷贪锟教э拷锟斤拷锟絊INGLE_CLICK锟叫达拷锟斤拷 if (voice_long_press_flag == 1) { if(user_data.record_mode!=1) amic_stop(); + device_key_send(0x22); + device_key_send(0x22); device_key_send(0x22); voice_long_press_flag = 0; } @@ -486,6 +505,9 @@ void BK_button_callback(Button_t btn, PressEvent event) device_key_send(0x31); + device_key_send(0x31); + device_key_send(0x31); + if (get_is_connect()&& user_data.record_mode!=1) { amic_start(); @@ -497,6 +519,8 @@ void BK_button_callback(Button_t btn, PressEvent event) if(user_data.record_mode!=1) amic_stop(); device_key_send(0x32); + device_key_send(0x32); + device_key_send(0x32); voice_single_start_flag = 0; } break; @@ -508,9 +532,13 @@ void BK_button_callback(Button_t btn, PressEvent event) if(user_data.record_mode!=1) amic_stop(); device_key_send(0x32); + device_key_send(0x32); + device_key_send(0x32); voice_single_start_flag = 0; } device_key_send(0x21); + device_key_send(0x21); + device_key_send(0x21); if (get_is_connect()&& user_data.record_mode!=1) { amic_start(); @@ -520,7 +548,7 @@ void BK_button_callback(Button_t btn, PressEvent event) } } - if (btn == m_button)//M¼ü + if (btn == m_button)//M锟斤拷 { static unsigned char m_long_press_flag = 0; @@ -532,8 +560,12 @@ void BK_button_callback(Button_t btn, PressEvent event) { if(user_data.record_mode!=1) amic_stop(); - device_key_send(0x28); - m_long_press_flag = 0; + + // need_send_btn_key=0x28; + device_key_send(0x28); + device_key_send(0x28); + device_key_send(0x28); + m_long_press_flag = 0; } break; @@ -541,6 +573,8 @@ void BK_button_callback(Button_t btn, PressEvent event) case SINGLE_CLICK: bk_printf("m_button SINGLE_CLICK\r\n"); device_key_send(0x43); + device_key_send(0x43); + device_key_send(0x43); break; case LONG_PRESS_START: @@ -550,9 +584,14 @@ void BK_button_callback(Button_t btn, PressEvent event) if(user_data.record_mode!=1) amic_stop(); device_key_send(0x32); + device_key_send(0x32); + device_key_send(0x32); voice_single_start_flag = 0; } - device_key_send(0x27); + device_key_send(0x27); + + // need_send_btn_key=0x27; + if (get_is_connect() && user_data.record_mode!=1 ) { amic_start(); @@ -569,6 +608,13 @@ void BK_button_callback(Button_t btn, PressEvent event) switch ((unsigned char)event) { + case PRESS_UP: + + printf("[keyscan]mode_button PRESS_UP123\r\n"); + + d24_start_pair(); + + break; case SINGLE_CLICK: printf("[keyscan]mode_button SINGLE_CLICK\r\n"); if (mode_long_press_flag == 0) @@ -592,18 +638,19 @@ void BK_button_callback(Button_t btn, PressEvent event) } } break; + } } } -//»ñÈ¡µ±Ç°CPI»òDPI +//锟斤拷取锟斤拷前CPI锟斤拷DPI unsigned int BK_get_cpi(void) { return user_data.cpi; } -//»ñȡ֧³ÖµÄCPI»òDPIÁÐ±í£¬×î¶à½«5¸ö¿ÉÉèÖõÄCPI»òDPI¸´ÖƵ½cpi_list,×î´ó³¤¶ÈΪ5£¬×¢Òâ±ðÔ½½ç£¬·µ»Ø¸´ÖƳ¤¶È +//锟斤拷取支锟街碉拷CPI锟斤拷DPI锟叫憋拷锟斤拷锟斤拷嘟�5锟斤拷锟斤拷锟斤拷锟矫碉拷CPI锟斤拷DPI锟斤拷锟狡碉拷cpi_list,锟斤拷蟪ざ锟轿�5锟斤拷注锟斤拷锟皆斤拷纾拷锟斤拷馗锟斤拷瞥锟斤拷锟� unsigned char BK_get_cpi_list(int *cpi_list) { cpi_list[0] = sensor_cpi_tbl[0]; @@ -614,7 +661,7 @@ unsigned char BK_get_cpi_list(int *cpi_list) return 5; } -//ÉèÖÃCPI£¬ÉèÖóɹ¦·µ»Ø1£¬Ê§°Ü·µ»Ø0 +//锟斤拷锟斤拷CPI锟斤拷锟斤拷锟矫成癸拷锟斤拷锟斤拷1锟斤拷失锟杰凤拷锟斤拷0 unsigned char BK_set_cpi(int cpi) { int i = 0;