Index: output/eeprom.dat
===================================================================
--- /YC1308AC/branch/mouse_project/YDN_Project/usb_16M_AutoPair/output/eeprom.dat	(revision 720)
+++ /YC1308AC/branch/mouse_project/YDN_Project/usb_16M_AutoPair/output/eeprom.dat	(working copy)
@@ -2,80 +2,36 @@
 02
 aa
 55
-ae
-01
+86
+00
 c2
 84
 00
-07
+04
 c0
 41
 80
-1c
+16
 c0
 45
 80
-12
-c0
-57
-00
-25
-c0
-5d
-80
-2d
-c0
-5e
-00
-33
+06
 20
 20
 13
 7c
 c0
-48
-00
-54
-c0
 4a
 80
-65
-c0
-54
-80
-0c
-c0
-73
-00
-2f
+1b
 20
 20
 13
 7c
-20
-40
-16
-a6
 70
-8a
-6d
-89
-6f
-f0
-8a
-43
-1f
-e1
-fe
-0f
-67
-f0
-8a
-43
-20
-60
-00
-00
+41
+ea
+ff
 20
 40
 12
@@ -113,54 +69,10 @@
 69
 76
 20
-20
+40
 12
 56
 70
-89
-00
-05
-20
-00
-00
-02
-70
-89
-00
-00
-6f
-e0
-c0
-c5
-c0
-0c
-11
-68
-c0
-04
-00
-23
-20
-20
-11
-68
-70
-8a
-87
-29
-20
-20
-11
-7d
-d8
-40
-aa
-00
-20
-40
-23
-20
-70
 48
 64
 02
@@ -168,246 +80,38 @@
 48
 65
 02
-20
-40
-36
-20
-20
-40
-62
-3c
-58
-00
-00
-7d
-20
-20
-62
-2d
-20
-40
-00
-2b
-20
-20
-36
-b5
-6f
-e0
-c8
-bf
-c1
-80
-80
-00
 70
-41
-e8
-85
-20
-20
-24
-99
-6f
-e0
-c8
-bf
-c1
-80
-00
-00
-20
-40
-24
-91
-20
-40
-00
-38
-20
-20
-36
-f2
-20
-40
-36
-8a
-20
-40
-00
-3b
-20
-20
-00
-47
-6f
-e0
-c9
-06
-20
-7a
-00
-00
+48
+b8
+1e
 d8
-e0
-00
-0e
-20
 40
-7d
-74
-24
-7a
-00
-00
-70
-49
-06
+aa
 00
-d8
-a0
-0c
-0f
-df
 20
-00
-02
 20
-40
-7d
-17
-6f
-e4
-0c
-0f
-67
-e4
-48
-f2
-20
-20
-36
-a2
-6f
-e0
-c9
-07
-20
-7a
-00
-00
-d8
-e0
-00
-0c
+23
 20
-40
-7d
-74
-24
-7a
-00
-00
 70
-49
-07
+89
 00
-d8
-a0
-0c
-1f
-df
+05
 20
 00
+00
 02
-20
-40
-7d
-17
 70
-0c
-1f
-03
-6f
-e1
-8c
-1f
-67
-e1
-c8
-fd
-20
-20
-36
-b2
-79
-3f
-80
-23
-6f
-e0
-8b
-59
-1f
-e1
-7e
-80
-c0
-00
-00
-59
-20
-20
-7a
-34
-6f
-e0
-8b
-59
-1f
-f1
-fe
-00
-1f
-e3
-7e
-00
-1f
-e1
-7e
-03
-c0
-00
-7a
-53
-c0
+89
 00
-80
-60
-20
-20
-7a
-43
-6f
-e0
-8b
-5a
-c0
-04
-80
-63
-20
-20
-7a
-5c
-20
 00
-3a
-98
+70
+8a
+87
+29
 20
 20
-7b
-d8
+11
+7d
 6f
 e0
 8b
@@ -432,8 +136,8 @@
 20
 7c
 59
-91
-8b
+d2
+36
 aa
 55
 40
@@ -461,9 +165,7 @@
 00
 00
 00
-40
 00
-18
 00
 00
 00
@@ -490,36 +192,29 @@
 00
 00
 00
-21
 00
 00
-02
+20
+00
+00
+00
+00
 00
 00
 00
 00
 00
 00
-40
 00
 00
 00
 aa
 55
-0a
+01
 00
 09
 49
 86
-01
-51
-31
-30
-10
-51
-31
-30
-30
 aa
 55
 06
@@ -534,31 +229,6 @@
 12
 aa
 55
-02
-00
-b8
-48
-1e
-00
-aa
-55
-01
-00
-7b
-48
-4e
-aa
-55
-04
-00
-77
-48
-20
-15
-10
-05
-aa
-55
 01
 00
 9a
@@ -571,39 +241,11 @@
 7b
 41
 1f
-aa
-55
-01
-00
-7d
-41
-70
-aa
-55
-01
-00
-d0
-44
-00
-aa
-55
-01
-00
-ea
-41
-ff
-aa
-55
-01
-00
-ee
-41
-00
 55
 aa
 aa
 55
-0c
-1c
-e8
-7d
+ec
+09
+ab
+3f
Index: output/program.lis
===================================================================
--- /YC1308AC/branch/mouse_project/YDN_Project/usb_16M_AutoPair/output/program.lis	(revision 720)
+++ /YC1308AC/branch/mouse_project/YDN_Project/usb_16M_AutoPair/output/program.lis	(working copy)
@@ -1,148 +1,48 @@
               include "bt_format "
               org 0x0000
-0000 c2840007 bbit1 8 ,pf_patch_ext 
-0001 c041801c beq patch10_3 ,p_set_sync_on 
-0002 c0458012 beq patch11_3 ,p_initialize_radio_cont 
-0003 c0570025 beq patch15_6 ,p_app_init 
-0004 c05d802d beq patch17_3 ,p_dongle_usb_dispatch 
-0005 c05e0033 beq patch17_4 ,p_dongle_work_mode_auto 
-0006 2020137c branch loop 
+0000 c2840004 bbit1 8 ,pf_patch_ext 
+0001 c0418016 beq patch10_3 ,p_set_sync_on 
+0002 c0458006 beq patch11_3 ,p_initialize_radio_cont 
+0003 2020137c branch loop 
 
 pf_patch_ext:
-0007 c0480054 beq patch32_0 ,p_usb_class_type 
-0008 c04a8065 beq patch32_5 ,p_usb_tx 
-0009 c054800c beq patch35_1 ,p_le_enable 
-000a c073002f beq patch3c_6 ,p_g24_bind_mode_auto 
-000b 2020137c branch loop 
-
-p_le_enable:
-000c 204016a6 call le_enable + 1 
-000d 708a6d89 jam 0x89 ,core_rx_bq_cfg0 
-000e 6ff08a43 fetch 1 ,core_syn_cal_ctrl 
-000f 1fe1fe0f or pdata ,0x0f ,pdata 
-0010 67f08a43 store 1 ,core_syn_cal_ctrl 
-0011 20600000 rtn 
+0004 c04a801b beq patch32_5 ,p_usb_tx 
+0005 2020137c branch loop 
 
 p_initialize_radio_cont:
-0012 204012d1 call init_lpm_ctrl 
-0013 20000064 nop 100 
-0014 708a0e0b jam 0x0b ,core_rf_ldo_cfg2 
-0015 708a0f05 jam 0x05 ,core_rf_ldo_cfg3 
-0016 708a8390 jam 0x90 ,core_syn_pfd_lkd_cfg 
-0017 708a8500 jam 0x00 ,core_syn_loopdiv_dsm_cfg 
-0018 70892140 jam 0x40 ,0x8921 
-0019 70896876 jam 0x76 ,core_agc_wb_sat_th 
-001a 70896976 jam 0x76 ,core_agc_nb_sat_th 
-001b 20201256 branch initialize_radio_cont + 1 
+0006 7041eaff jam 0xff ,mem_gain_fix 
+0007 204012d1 call init_lpm_ctrl 
+0008 20000064 nop 100 
+0009 708a0e0b jam 0x0b ,core_rf_ldo_cfg2 
+000a 708a0f05 jam 0x05 ,core_rf_ldo_cfg3 
+000b 708a8390 jam 0x90 ,core_syn_pfd_lkd_cfg 
+000c 708a8500 jam 0x00 ,core_syn_loopdiv_dsm_cfg 
+000d 70892140 jam 0x40 ,0x8921 
+000e 70896876 jam 0x76 ,core_agc_wb_sat_th 
+000f 70896976 jam 0x76 ,core_agc_nb_sat_th 
+0010 20401256 call initialize_radio_cont + 1 
+0011 70486402 jam 0x02 ,mem_24g_rx_phy 
+0012 70486502 jam 0x02 ,mem_24g_tx_phy 
+0013 7048b81e jam 0x1e ,mem_24g_hop_interval 
+0014 d840aa00 arg 0xaa00 ,temp 
+0015 20202320 branch g24_rx_window_store 
 
 p_set_sync_on:
-001c 70890005 jam 0x5 ,modem_en 
-001d 20000002 nop 2 
-001e 70890000 jam 0x0 ,modem_en 
-001f 6fe0c0c5 fetch 1 ,mem_fcomp_div 
-0020 c00c1168 beq xtal_24m ,set_sync_on_24m 
-0021 c0040023 beq xtal_16m ,p_set_sync_on_16m 
-0022 20201168 branch set_sync_on_24m 
+0016 70890005 jam 0x5 ,modem_en 
+0017 20000002 nop 2 
+0018 70890000 jam 0x0 ,modem_en 
 
 p_set_sync_on_16m:
-0023 708a8729 jam 0x29 ,core_syn_afc_cfg1 
-0024 2020117d branch set_sync_on_16m 
-
-p_app_init:
-0025 d840aa00 arg 0xaa00 ,temp 
-0026 20402320 call g24_rx_window_store 
-0027 70486402 jam 0x02 ,mem_24g_rx_phy 
-0028 70486502 jam 0x02 ,mem_24g_tx_phy 
-0029 20403620 call dongle_init 
-002a 2040623c call wdt_set_enable 
-
-p_wdt_kick:
-002b 5800007d setarg 125 
-002c 2020622d branch wdt_init_config 
-
-p_dongle_usb_dispatch:
-002d 2040002b call p_wdt_kick 
-002e 202036b5 branch dongle_usb_dispatch + 1 
-
-p_g24_bind_mode_auto:
-002f 6fe0c8bf fetch 1 ,mem_24g_work_mode 
-0030 c1808000 rtnne dongle_bind 
-0031 7041e885 jam tx_power_f5db ,mem_tx_power 
-0032 20202499 branch g24_bind_mode_auto + 3 
-
-p_dongle_work_mode_auto:
-0033 6fe0c8bf fetch 1 ,mem_24g_work_mode 
-0034 c1800000 rtnne dongle_work 
-0035 20402491 call g24_work_mode_start 
-0036 20400038 call p_dongle_g24_blank_data_process 
-0037 202036f2 branch dongle_work_mode_auto + 5 
-
-p_dongle_g24_blank_data_process:
-0038 2040368a call dongle_g24_ms_blank_data 
-0039 2040003b call p_dongle_g24_kb_blank_data 
-003a 20200047 branch p_dongle_g24_kb_mul_blank_data 
-
-p_dongle_g24_kb_blank_data:
-003b 6fe0c906 fetch 1 ,mem_dg_kb_blank_data_enable 
-003c 207a0000 rtn blank 
-003d d8e0000e arg timer_kb_blank ,queue 
-003e 20407d74 call timer_check 
-003f 247a0000 nrtn blank 
-0040 70490600 jam 0 ,mem_dg_kb_blank_data_enable 
-0041 d8a00c0f arg mem_usb_kb_data ,contw 
-0042 df200002 arg 2 ,loopcnt 
-0043 20407d17 call memset0 
-0044 6fe40c0f fetch 8 ,mem_usb_kb_data 
-0045 67e448f2 store 8 ,mem_dg_kb_data_last_data 
-0046 202036a2 branch dongle_usb_tx_kb_data 
-
-p_dongle_g24_kb_mul_blank_data:
-0047 6fe0c907 fetch 1 ,mem_dg_kb_mul_blank_data_enable 
-0048 207a0000 rtn blank 
-0049 d8e0000c arg timer_kb_mul_blank ,queue 
-004a 20407d74 call timer_check 
-004b 247a0000 nrtn blank 
-004c 70490700 jam 0 ,mem_dg_kb_mul_blank_data_enable 
-004d d8a00c1f arg mem_usb_kb_multikey ,contw 
-004e df200002 arg 2 ,loopcnt 
-004f 20407d17 call memset0 
-0050 700c1f03 jam kb_multikey_report_id ,mem_usb_kb_multikey 
-0051 6fe18c1f fetch 3 ,mem_usb_kb_multikey 
-0052 67e1c8fd store 3 ,mem_dg_kb_multikey_last_data 
-0053 202036b2 branch dongle_usb_tx_multikey_data 
-
-p_usb_class_type:
-0054 793f8023 set0 mark_isstr ,mark 
-0055 6fe08b59 fetch 1 ,mem_usb_setup_bmrequesttype 
-0056 1fe17e80 and_into 0x80 ,pdata 
-0057 c0000059 beq out_device ,p_usb_out_device 
-0058 20207a34 branch usb_class_type + 4 
-
-p_usb_out_device:
-0059 6fe08b59 fetch 1 ,mem_usb_setup_bmrequesttype 
-005a 1ff1fe00 rshift4 pdata ,pdata 
-005b 1fe37e00 rshift pdata ,pdata 
-005c 1fe17e03 and_into 0x03 ,pdata 
-005d c0007a53 beq standard_req ,usb_out_standard_req 
-005e c0008060 beq class_req ,p_usb_out_class_req 
-005f 20207a43 branch usb_out_device + 4 
-
-p_usb_out_class_req:
-0060 6fe08b5a fetch 1 ,mem_usb_setup_brequest 
-0061 c0048063 beq set_report ,p_usb_set_report 
-0062 20207a5c branch usb_out_class_req + 1 
-
-p_usb_set_report:
-0063 20003a98 nop 15000 
-0064 20207bd8 branch usb_set_report 
+0019 708a8729 jam 0x29 ,core_syn_afc_cfg1 
+001a 2020117d branch set_sync_on_16m 
 
 p_usb_tx:
-0065 6fe08bf9 fetch 1 ,mem_usb_tx_enable 
-0066 207a0000 rtn blank 
-0067 6ff08c24 fetch 1 ,core_usb_txbusy 
-0068 1fe17e0f and_into 0x0f ,pdata 
-0069 243a7ca4 nbranch usb_inwake_state_tx_dispose ,blank 
-006a 20207c59 branch usb_tx + 3 
+001b 6fe08bf9 fetch 1 ,mem_usb_tx_enable 
+001c 207a0000 rtn blank 
+001d 6ff08c24 fetch 1 ,core_usb_txbusy 
+001e 1fe17e0f and_into 0x0f ,pdata 
+001f 243a7ca4 nbranch usb_inwake_state_tx_dispose ,blank 
+0020 20207c59 branch usb_tx + 3 
               org 0x800
 
 start:
Index: program/patch.prog
===================================================================
--- /YC1308AC/branch/mouse_project/YDN_Project/usb_16M_AutoPair/program/patch.prog	(revision 720)
+++ /YC1308AC/branch/mouse_project/YDN_Project/usb_16M_AutoPair/program/patch.prog	(working copy)
@@ -2,17 +2,18 @@
 	bbit1 8,pf_patch_ext
 	beq patch10_3,p_set_sync_on
 	beq patch11_3,p_initialize_radio_cont
-	beq patch15_6,p_app_init
-	beq patch17_3,p_dongle_usb_dispatch
-	beq patch17_4,p_dongle_work_mode_auto
+//	beq patch15_6,p_app_init
+//	beq patch17_3,p_dongle_usb_dispatch
+//	beq patch17_4,p_dongle_work_mode_auto
 	branch loop
 
 pf_patch_ext:
-	beq patch32_0,p_usb_class_type
+//	beq patch32_0,p_usb_class_type
 	beq patch32_5,p_usb_tx
-	beq patch35_1,p_le_enable
-	beq patch3c_6,p_g24_bind_mode_auto
+//	beq patch35_1,p_le_enable
+//	beq patch3c_6,p_g24_bind_mode_auto
 	branch loop
+/*	
 p_le_enable:
 	call le_enable+1
 	jam 0x89,core_rx_bq_cfg0
@@ -20,11 +21,14 @@
 	or pdata,0x0f,pdata
 	store 1,core_syn_cal_ctrl
 	rtn
-	
+*/	
 
 
 /********************rx fail patch************************/
 p_initialize_radio_cont:
+	//hw agc
+	jam 0xff,mem_gain_fix
+	
 	//config osc_xtal_ctrim
 	call init_lpm_ctrl
 	nop 100
@@ -36,53 +40,64 @@
 
 	jam 0x00,core_syn_loopdiv_dsm_cfg
 	jam 0x40,0x8921
+
 	//Improve auto agc
 	jam 0x76,core_agc_wb_sat_th
 	jam 0x76,core_agc_nb_sat_th
 
-	branch initialize_radio_cont+1
+	call initialize_radio_cont+1
+
+	jam 0x02,mem_24g_rx_phy
+	jam 0x02,mem_24g_tx_phy
+
+	//config hop interval
+	jam 0x1e,mem_24g_hop_interval
+	arg 0xaa00,temp
+	branch g24_rx_window_store
 
 p_set_sync_on:
 	jam 0x5,modem_en
 	nop 2
 	jam 0x0,modem_en					/* if called from tx or rx */
-	fetch 1,mem_fcomp_div
-	beq XTAL_24M,set_sync_on_24m
-	beq XTAL_16M,p_set_sync_on_16m
-	branch set_sync_on_24m
-
+//	fetch 1,mem_fcomp_div
+//	beq XTAL_24M,set_sync_on_24m
+//	beq XTAL_16M,p_set_sync_on_16m
+//	branch set_sync_on_24m
 p_set_sync_on_16m:
 	jam 0x29,core_syn_afc_cfg1
 	branch set_sync_on_16m
-p_app_init:
+
+
+//p_app_init:
 /********************dongle rx window patch************************/
-	arg 0xaa00,temp
-	call g24_rx_window_store
-	jam 0x02,mem_24g_rx_phy
-	jam 0x02,mem_24g_tx_phy
+//	arg 0xaa00,temp
+//	call g24_rx_window_store
+//	jam 0x02,mem_24g_rx_phy
+//	jam 0x02,mem_24g_tx_phy
 
-	call dongle_init
+//	call dongle_init
 	
 	//watch dog enable
-	call wdt_set_enable
-p_wdt_kick:
+//	call wdt_set_enable
+//p_wdt_kick:
 	//about 128ms
-	setarg 125
-	branch wdt_init_config
+//	setarg 125
+//	branch wdt_init_config
 
 
 /********************add wdt************************/
-p_dongle_usb_dispatch:
-	call p_wdt_kick
-	branch dongle_usb_dispatch+1
-
-p_g24_bind_mode_auto:
-	fetch 1,mem_24g_work_mode
-	rtnne DONGLE_BIND
-	jam TX_POWER_F5DB,mem_tx_power
-	branch g24_bind_mode_auto+3
+//p_dongle_usb_dispatch:
+//	call p_wdt_kick
+//	branch dongle_usb_dispatch+1
+
+//p_g24_bind_mode_auto:
+//	fetch 1,mem_24g_work_mode
+//	rtnne DONGLE_BIND
+//	jam TX_POWER_F5DB,mem_tx_power
+//	branch g24_bind_mode_auto+3
 
 /************************keyboard blank patch**********/
+/*
 p_dongle_work_mode_auto:
 	fetch 1,mem_24g_work_mode
 	rtnne DONGLE_WORK
@@ -124,9 +139,10 @@
 	fetch 3,mem_usb_kb_multikey
 	store 3,mem_dg_kb_multikey_last_data	
 	branch dongle_usb_tx_multikey_data
-	
+*/	
 
 /************************keyboard led patch**********/
+/*
 p_usb_class_type:
 	set0 mark_isstr,mark
 	fetch 1,mem_usb_setup_bmRequestType
@@ -151,7 +167,7 @@
 p_usb_set_report:
 	nop 15000	//delay 1ms
 	branch usb_set_report
-
+*/
 
 
 /************************usb mac wakeup patch**********/
Index: sched/dongle.dat
===================================================================
--- /YC1308AC/branch/mouse_project/YDN_Project/usb_16M_AutoPair/sched/dongle.dat	(revision 720)
+++ /YC1308AC/branch/mouse_project/YDN_Project/usb_16M_AutoPair/sched/dongle.dat	(working copy)
@@ -10,14 +10,14 @@
 mem_dg_sys_config:86	#6dBm#24M
 
 #usb config
-mem_dg_usb_vid_pid:
-01 #disable
+#mem_dg_usb_vid_pid:
+#01 #disable
 #mouse only#auto pair
-51 31#VID
-30 10#PID
+#51 31#VID
+#30 10#PID
 #mouse & keyboard
-51 31#VID
-30 30#PID
+#51 31#VID
+#30 30#PID
 #mem_dg_usb_tx_interval:00
 #mem_dg_usb_device_name:
 #'123456
@@ -29,17 +29,17 @@
 #mem_24g_rx_phy:01#0x01:1M/0x02:2M/0x04:S2/0x84:S8
 #mem_24g_no_ack:00#no ack
 #mem_24g_rx_window:30 75#rx
-mem_24g_hop_interval:1e
+#mem_24g_hop_interval:1e
 #mem_24g_ackpayload_enable:00#ack payload enable
 #mem_24g_ch_map1:00 13 2c 42
 #mem_24g_ch_map2:06 15 36 48
 #mem_24g_ch_map3:0f 1a 3a 4c
 #mem_24g_ch_map4:11 23 31 4d
 #mem_24g_pair_switch:00
-mem_24g_pair_mode:00
-mem_24g_pair_ch:4e
+#mem_24g_pair_mode:00
+#mem_24g_pair_ch:4e
 #mem_24g_pair_tx_power:85
-mem_24g_pair_addr:20 15 10 05
+#mem_24g_pair_addr:20 15 10 05
 #mem_24g_ch_map_update:00
 #mem_24g_ch_update_map1
 #mem_24g_ch_update_map2
@@ -56,11 +56,11 @@
 #with eeprom
 mem_device_option:04
 mem_lpm_ctrim:1f		#xtal offset
-mem_lpm_xtalcnt:70
-mem_dig_aon_vsel:00
+#mem_lpm_xtalcnt:70
+#mem_dig_aon_vsel:00
 #hw agc
-mem_gain_fix:ff
-mem_gain_second_agc_en:00
+#mem_gain_fix:ff
+#mem_gain_second_agc_en:00
 
 #mem_rf_debug_rx_gpio:92
 #mem_rf_debug_tx_gpio:92
