Index: format/app_dongle.format
===================================================================
--- /YC1308AC/branch/usb/format/app_dongle.format	(revision 1341)
+++ /YC1308AC/branch/usb/format/app_dongle.format	(working copy)
@@ -71,6 +71,9 @@
 1 mem_g24_reportrate_add
 1 mem_g24_reportrate_continue
 0 mem_dongle_end
+
+1 mem_24g_mouse_bind_enable
+1 mem_24g_keyboard_bind_enable
 )
 
 
Index: output/eeprom.dat
===================================================================
--- /YC1308AC/branch/usb/output/eeprom.dat	(revision 1341)
+++ /YC1308AC/branch/usb/output/eeprom.dat	(working copy)
@@ -2,8 +2,8 @@
 02
 aa
 55
-46
-04
+26
+05
 c2
 84
 00
@@ -11,31 +11,31 @@
 c0
 41
 80
-2c
+2d
 c0
 45
 00
-1d
+1e
 c0
 45
 80
-1e
+1f
 c0
 46
 00
-7b
+7c
 c0
 57
 00
-33
+34
 c0
 5d
 80
-43
+44
 c0
 5e
 00
-45
+46
 20
 20
 13
@@ -43,7 +43,7 @@
 c0
 47
 00
-19
+1a
 c0
 47
 fa
@@ -55,27 +55,31 @@
 c0
 48
 00
-66
+67
 c0
 4a
 80
-90
+91
 c0
 54
 80
-13
+14
 c0
 6f
 00
-99
+9a
 c0
 70
 00
-e0
+e1
 c0
 70
 80
-f1
+f2
+c0
+72
+01
+12
 20
 20
 13
@@ -227,7 +231,7 @@
 58
 00
 00
-96
+97
 67
 e1
 48
@@ -275,7 +279,7 @@
 20
 40
 00
-41
+42
 20
 20
 36
@@ -295,7 +299,7 @@
 20
 40
 00
-4a
+4b
 20
 20
 36
@@ -307,11 +311,11 @@
 20
 40
 00
-4d
+4e
 20
 20
 00
-59
+5a
 6f
 e0
 c9
@@ -427,7 +431,7 @@
 c0
 00
 00
-6b
+6c
 20
 20
 7a
@@ -451,7 +455,7 @@
 c0
 00
 80
-71
+72
 20
 20
 7a
@@ -463,7 +467,7 @@
 c0
 04
 80
-74
+75
 20
 20
 7a
@@ -543,7 +547,7 @@
 20
 40
 00
-76
+77
 1f
 e6
 7e
@@ -567,7 +571,7 @@
 24
 20
 80
-8e
+8f
 58
 00
 00
@@ -667,7 +671,7 @@
 c5
 97
 80
-a9
+aa
 78
 3c
 fc
@@ -751,7 +755,7 @@
 24
 22
 80
-98
+99
 78
 58
 fc
@@ -823,7 +827,7 @@
 24
 21
 00
-98
+99
 1f
 e2
 72
@@ -831,7 +835,7 @@
 20
 22
 80
-d2
+d3
 20
 40
 22
@@ -843,11 +847,11 @@
 c2
 00
 00
-cf
+d0
 c5
 13
 80
-d7
+d8
 18
 a2
 22
@@ -895,7 +899,7 @@
 20
 23
 00
-98
+99
 20
 20
 22
@@ -963,7 +967,7 @@
 20
 40
 00
-f7
+f8
 20
 20
 22
@@ -1023,7 +1027,7 @@
 c5
 16
 81
-05
+06
 19
 31
 7e
@@ -1063,7 +1067,7 @@
 c2
 00
 01
-07
+08
 19
 31
 7e
@@ -1095,9 +1099,229 @@
 20
 20
 01
-03
-4e
+04
+6f
+e0
+c8
+93
+c0
+55
+01
+17
+c0
+2a
+81
+21
+c0
 11
+01
+31
+20
+20
+23
+ba
+6f
+e0
+c8
+94
+c0
+00
+81
+1b
+c0
+01
+01
+1e
+20
+60
+00
+00
+6f
+e0
+c9
+92
+24
+7a
+00
+00
+20
+20
+23
+c0
+6f
+e0
+c9
+93
+24
+7a
+00
+00
+20
+20
+23
+c6
+6f
+e0
+c8
+5b
+20
+3a
+01
+27
+6f
+e2
+48
+95
+68
+4a
+40
+a8
+98
+46
+7c
+00
+24
+62
+80
+00
+6f
+e0
+c8
+94
+c0
+00
+81
+2b
+c0
+01
+01
+2e
+20
+60
+00
+00
+6f
+e0
+c9
+92
+24
+7a
+00
+00
+20
+20
+23
+d3
+6f
+e0
+c9
+93
+24
+7a
+00
+00
+20
+20
+23
+de
+6f
+e0
+c8
+5b
+20
+3a
+01
+37
+6f
+e2
+48
+95
+68
+4a
+48
+cd
+98
+46
+7c
+00
+24
+62
+80
+00
+6f
+e0
+c8
+94
+c0
+00
+81
+3b
+c0
+01
+01
+42
+20
+60
+00
+00
+6f
+e0
+c9
+92
+24
+7a
+00
+00
+6f
+e0
+c8
+7e
+c0
+01
+01
+40
+20
+60
+00
+00
+70
+49
+92
+01
+20
+20
+23
+f3
+6f
+e0
+c9
+93
+24
+7a
+00
+00
+6f
+e0
+c8
+7f
+c0
+80
+01
+47
+20
+60
+00
+00
+70
+49
+93
+01
+20
+20
+23
+fd
+43
+b7
 aa
 55
 40
@@ -1164,7 +1388,7 @@
 00
 00
 40
-03
+13
 00
 00
 00
@@ -1396,11 +1620,16 @@
 85
 49
 20
-55
-aa
 aa
 55
-dc
-2d
+05
+00
+32
+49
+02
+40
+00
+64
 06
-53
+6f
+aa
Index: output/memmap.format
===================================================================
--- /YC1308AC/branch/usb/output/memmap.format	(revision 1341)
+++ /YC1308AC/branch/usb/output/memmap.format	(working copy)
@@ -1944,6 +1944,8 @@
 0x4990 mem_g24_reportrate_add
 0x4991 mem_g24_reportrate_continue
 0x4992 mem_dongle_end
+0x4992 mem_24g_mouse_bind_enable
+0x4993 mem_24g_keyboard_bind_enable
 0x487e mem_rssi_hex_received
 0x487f mem_24g_pair_sm
 0x4880 mem_24g_pair_no_ack
Index: program/g24_protocol_stack/24g_pair.prog
===================================================================
--- /YC1308AC/branch/usb/program/g24_protocol_stack/24g_pair.prog	(revision 1341)
+++ /YC1308AC/branch/usb/program/g24_protocol_stack/24g_pair.prog	(working copy)
@@ -221,6 +221,7 @@
 	arg mem_24g_rxdata_temp,contw
 	call memcpy8
 	bpatchx patch3c_4,mem_patch3c
+g24_bind_data_parse_next:
 	fetch 1,mem_24g_rxdata_temp+2
 	beq DATATYPE_BIND,g24_bind_first_step	//bind step 1
 	beq DATATYPE_CONFIG,g24_bind_second_step
Index: program/patch.prog
===================================================================
--- /YC1308AC/branch/usb/program/patch.prog	(revision 1341)
+++ /YC1308AC/branch/usb/program/patch.prog	(working copy)
@@ -27,6 +27,7 @@
 	beq patch3b_6,p_g24_receive_packet
 	beq patch3c_0,p_g24_receive_skip_rssi_next
 	beq patch3c_1,p_g24_transmit
+	beq patch3c_4,p_g24_bind_data_parse_next
 	branch loop
 
 p_le_enable:
@@ -1508,5 +1509,80 @@
 	copy temp,pdata
 	inject mod,40
 	branch p_g24_transmit_packet
+
+
+p_g24_bind_data_parse_next:
+	fetch 1,mem_24g_rxdata_temp+2
+	beq DATATYPE_BIND,p_g24_bind_first_step	//bind step 1
+	beq DATATYPE_CONFIG,p_g24_bind_second_step
+	beq DATATYPE_OK,p_g24_bind_third_step
+	branch g24_bind_data_parse_next+4
 	
+p_g24_bind_first_step:
+	fetch 1,mem_24g_rxdata_temp+3
+	beq DATATYPE_DEVICE1,p_g24_bind_first_step_device1
+	beq DATATYPE_DEVICE2,p_g24_bind_first_step_device2
+	rtn
+p_g24_bind_first_step_device1:
+	fetch 1,mem_24g_mouse_bind_enable
+	nrtn blank
+	branch g24_bind_first_step_device1
+p_g24_bind_first_step_device2:
+	fetch 1,mem_24g_keyboard_bind_enable
+	nrtn blank
+	branch g24_bind_first_step_device2
 	
+p_g24_bind_second_step:
+	fetch 1,mem_24g_pair_switch
+	branch p_g24_bind_second_step_skip,blank
+	fetch 4,mem_24g_rxdata_temp+4
+	fetcht 4,mem_lap
+	isub temp,null
+	nrtn zero
+p_g24_bind_second_step_skip:	
+	fetch 1,mem_24g_rxdata_temp+3
+	beq DATATYPE_DEVICE1,p_g24_bind_second_step_device1
+	beq DATATYPE_DEVICE2,p_g24_bind_second_step_device2
+	rtn
+p_g24_bind_second_step_device1:
+	fetch 1,mem_24g_mouse_bind_enable
+	nrtn blank
+	branch g24_bind_second_step_device1
+p_g24_bind_second_step_device2:
+	fetch 1,mem_24g_keyboard_bind_enable
+	nrtn blank
+	branch g24_bind_second_step_device2
+
+p_g24_bind_third_step:
+	fetch 1,mem_24g_pair_switch
+	branch p_g24_bind_third_step_skip,blank
+	fetch 4,mem_24g_rxdata_temp+4
+	fetcht 4,mem_24g_transmitter_addr
+	isub temp,null
+	nrtn zero
+p_g24_bind_third_step_skip:
+	fetch 1,mem_24g_rxdata_temp+3
+	beq DATATYPE_DEVICE1,p_g24_bind_third_step_device1
+	beq DATATYPE_DEVICE2,p_g24_bind_third_step_device2
+	rtn
+p_g24_bind_third_step_device1:
+	fetch 1,mem_24g_mouse_bind_enable
+	nrtn blank
+	fetch 1,mem_24g_device1_bind_step
+	beq 2,p_g24_bind_dvc1_step_success
+	rtn
+p_g24_bind_dvc1_step_success:
+	jam 1,mem_24g_mouse_bind_enable	
+	branch g24_bind_dvc1_step_success
+	
+p_g24_bind_third_step_device2:
+	fetch 1,mem_24g_keyboard_bind_enable
+	nrtn blank
+	fetch 1,mem_24g_device2_bind_step
+	bne 0,p_g24_bind_dvc2_step_success
+	rtn
+p_g24_bind_dvc2_step_success:
+	jam 1,mem_24g_keyboard_bind_enable
+	branch g24_bind_dvc2_step_success
+
+
