Index: format/app_dongle.format
===================================================================
--- /branch/usb/usb_public/format/app_dongle.format	(revision 192)
+++ /branch/usb/usb_public/format/app_dongle.format	(working copy)
@@ -30,6 +30,9 @@
 1 mem_dg_pc_sleep_flag
 
 1 mem_dg_24g_tx_power_default
+
+1 mem_24g_device1_bind_disable
+1 mem_24g_device2_bind_disable
 )
 
 
Index: output/eeprom.dat
===================================================================
--- /branch/usb/usb_public/output/eeprom.dat	(revision 192)
+++ /branch/usb/usb_public/output/eeprom.dat	(working copy)
@@ -2,20 +2,20 @@
 02
 aa
 55
-b2
-01
+aa
+02
 c2
 84
 00
-0b
+0c
 c0
 00
 00
-0d
+0f
 c0
 01
 80
-41
+7f
 c0
 0b
 b9
@@ -23,27 +23,31 @@
 c0
 31
 00
-12
+14
 c0
 4a
 80
-5e
+9c
 c0
 5c
 80
-18
+1a
+c0
+6a
+80
+62
 c0
 6f
 00
-29
+67
 c0
 71
 00
-44
+82
 c0
 74
 00
-4e
+8c
 20
 20
 3a
@@ -52,6 +56,10 @@
 7f
 80
 00
+c0
+1d
+80
+2b
 20
 20
 3a
@@ -168,6 +176,246 @@
 20
 71
 92
+6f
+e0
+c5
+2d
+c0
+55
+00
+30
+c0
+2a
+80
+3a
+c0
+11
+00
+4a
+20
+20
+49
+c8
+6f
+e0
+c5
+2e
+c0
+00
+80
+34
+c0
+01
+00
+37
+20
+60
+00
+00
+6f
+e0
+c5
+d7
+24
+7a
+00
+00
+20
+20
+49
+ce
+6f
+e0
+c5
+d8
+24
+7a
+00
+00
+20
+20
+49
+d4
+6f
+e0
+c4
+f4
+20
+3a
+00
+40
+6f
+e2
+45
+2f
+68
+4a
+44
+37
+98
+46
+7c
+00
+24
+62
+80
+00
+6f
+e0
+c5
+2e
+c0
+00
+80
+44
+c0
+01
+00
+47
+20
+60
+00
+00
+6f
+e0
+c5
+d7
+24
+7a
+00
+00
+20
+20
+49
+e1
+6f
+e0
+c5
+d8
+24
+7a
+00
+00
+20
+20
+49
+ec
+6f
+e0
+c4
+f4
+20
+3a
+00
+50
+6f
+e2
+45
+2f
+68
+4a
+45
+6f
+98
+46
+7c
+00
+24
+62
+80
+00
+6f
+e0
+c5
+2e
+c0
+00
+80
+54
+c0
+01
+00
+5b
+20
+60
+00
+00
+6f
+e0
+c5
+d7
+24
+7a
+00
+00
+6f
+e0
+c5
+18
+c0
+01
+00
+59
+20
+60
+00
+00
+70
+45
+d7
+01
+20
+20
+4a
+01
+6f
+e0
+c5
+d8
+24
+7a
+00
+00
+6f
+e0
+c5
+19
+c0
+80
+00
+60
+20
+60
+00
+00
+70
+45
+d8
+01
+20
+20
+4a
+0c
+18
+42
+7e
+00
+c2
+80
+80
+65
+20
+20
+3d
+19
+70
+8a
+6d
+89
+20
+20
+3d
+1f
 20
 40
 3d
@@ -175,7 +423,7 @@
 c5
 97
 80
-2f
+6d
 78
 3c
 fc
@@ -219,7 +467,7 @@
 20
 37
 00
-38
+76
 1b
 42
 04
@@ -271,7 +519,7 @@
 24
 22
 80
-3f
+7d
 20
 20
 38
@@ -359,7 +607,7 @@
 c5
 16
 80
-5a
+98
 20
 20
 3e
@@ -375,7 +623,7 @@
 c2
 00
 00
-5b
+99
 20
 20
 3f
@@ -436,8 +684,8 @@
 20
 6c
 a7
-7c
-62
+fb
+03
 aa
 55
 40
@@ -470,7 +718,7 @@
 02
 00
 00
-00
+20
 40
 04
 01
@@ -483,7 +731,7 @@
 00
 00
 00
-00
+08
 00
 00
 00
@@ -711,7 +959,7 @@
 aa
 aa
 55
-cc
+f4
 37
-ac
-00
+2c
+8b
Index: output/memmap.format
===================================================================
--- /branch/usb/usb_public/output/memmap.format	(revision 192)
+++ /branch/usb/usb_public/output/memmap.format	(working copy)
@@ -1321,6 +1321,8 @@
 0x45d4 mem_dg_kb_bind_success
 0x45d5 mem_dg_pc_sleep_flag
 0x45d6 mem_dg_24g_tx_power_default
+0x45d7 mem_24g_device1_bind_disable
+0x45d8 mem_24g_device2_bind_disable
 0x4518 mem_rssi_hex_received
 0x4519 mem_24g_pair_sm
 0x451a mem_24g_pair_no_ack
Index: output/program.lis
===================================================================
--- /branch/usb/usb_public/output/program.lis	(revision 192)
+++ /branch/usb/usb_public/output/program.lis	(working copy)
@@ -1,143 +1,237 @@
               include "bt_format "
               org 0x0000
-0000 c284000b bbit1 8 ,pf_patch_ext 
-0001 c000000d beq patch00_0 ,p_soft_reset 
-0002 c0018041 beq patch00_3 ,p_connection_incontext 
+0000 c284000c bbit1 8 ,pf_patch_ext 
+0001 c000000f beq patch00_0 ,p_soft_reset 
+0002 c001807f beq patch00_3 ,p_connection_incontext 
 0003 c00bb9ff beq patch02_7 ,set_tx_power_10db 
-0004 c0310012 beq patch0c_2 ,p_app_init 
-0005 c04a805e beq patch12_5 ,p_enable_adc 
-0006 c05c8018 beq patch17_1 ,p_usb_init 
-0007 c06f0029 beq patch1b_6 ,p_le_receive_rxon 
-0008 c0710044 beq patch1c_2 ,p_le_crc_fail_tx 
-0009 c074004e beq patch1d_0 ,p_le_transmit 
-000a 20203aba branch assert 
+0004 c0310014 beq patch0c_2 ,p_app_init 
+0005 c04a809c beq patch12_5 ,p_enable_adc 
+0006 c05c801a beq patch17_1 ,p_usb_init 
+0007 c06a8062 beq patch1a_5 ,p_le_enable_phy_by_pdata 
+0008 c06f0067 beq patch1b_6 ,p_le_receive_rxon 
+0009 c0710082 beq patch1c_2 ,p_le_crc_fail_tx 
+000a c074008c beq patch1d_0 ,p_le_transmit 
+000b 20203aba branch assert 
 
 pf_patch_ext:
-000b c17f8000 rtneq patch3f_7 
-000c 20203aba branch assert 
+000c c17f8000 rtneq patch3f_7 
+000d c01d802b beq patch27_3 ,p_g24_bind_data_parse_next 
+000e 20203aba branch assert 
 
 p_soft_reset:
-000d 2035b802 branch soft_reset + 1 ,wake 
-000e 6fe240cc fetch 4 ,mem_lpm_ctrl3 
-000f 67f2004c store 4 ,core_lpm_reg 
-0010 20403c49 call lpm_write_ctrl3 
-0011 20203802 branch soft_reset + 1 
+000f 2035b802 branch soft_reset + 1 ,wake 
+0010 6fe240cc fetch 4 ,mem_lpm_ctrl3 
+0011 67f2004c store 4 ,core_lpm_reg 
+0012 20403c49 call lpm_write_ctrl3 
+0013 20203802 branch soft_reset + 1 
 
 p_app_init:
-0012 6fe0c095 fetch 1 ,mem_device_option 
-0013 203a4d9b branch app_init ,blank 
+0014 6fe0c095 fetch 1 ,mem_device_option 
+0015 203a4d9b branch app_init ,blank 
 
 p_dongle_init:
-0014 20758000 rtn wake 
-0015 7040cc3a jam hvin_vin_greater_than_4v2 ,mem_lpm_ctrl3 
-0016 20403c41 call lpm_write_sel_vdd 
-0017 20205249 branch dongle_init 
+0016 20758000 rtn wake 
+0017 7040cc3a jam hvin_vin_greater_than_4v2 ,mem_lpm_ctrl3 
+0018 20403c41 call lpm_write_sel_vdd 
+0019 20205249 branch dongle_init 
 
 p_usb_init:
-0018 20406fd3 call enable_authrom 
-0019 204071a1 call usb_init_param 
-001a 70061003 jam 0x03 ,mem_devicedesc + 17 
-001b 708c0000 jam 0x00 ,core_usb_config 
-001c 20002710 nop 10000 
-001d 708c1800 jam 0x00 ,core_usb_trig 
-001e 6ff10050 fetch 2 ,core_clkoff 
-001f 793ffe0a set0 clock_off_usb ,pdata 
-0020 67f10050 store 2 ,core_clkoff 
-0021 708c1100 jam 0x0 ,core_usb_hmode 
-0022 708c003c jam 0x3c ,core_usb_config 
-0023 58000bb3 setarg mem_usb_rxbuf_new 
-0024 67f10c03 store 2 ,core_usb_rx_saddr 
-0025 67f10c07 store 2 ,core_usb_rxptr 
-0026 58000bf7 setarg mem_usb_rxbuf_new_end 
-0027 67f10c05 store 2 ,core_usb_rx_eaddr 
-0028 20207192 branch usb_init + 16 
+001a 20406fd3 call enable_authrom 
+001b 204071a1 call usb_init_param 
+001c 70061003 jam 0x03 ,mem_devicedesc + 17 
+001d 708c0000 jam 0x00 ,core_usb_config 
+001e 20002710 nop 10000 
+001f 708c1800 jam 0x00 ,core_usb_trig 
+0020 6ff10050 fetch 2 ,core_clkoff 
+0021 793ffe0a set0 clock_off_usb ,pdata 
+0022 67f10050 store 2 ,core_clkoff 
+0023 708c1100 jam 0x0 ,core_usb_hmode 
+0024 708c003c jam 0x3c ,core_usb_config 
+0025 58000bb3 setarg mem_usb_rxbuf_new 
+0026 67f10c03 store 2 ,core_usb_rx_saddr 
+0027 67f10c07 store 2 ,core_usb_rxptr 
+0028 58000bf7 setarg mem_usb_rxbuf_new_end 
+0029 67f10c05 store 2 ,core_usb_rx_eaddr 
+002a 20207192 branch usb_init + 16 
+
+p_g24_bind_data_parse_next:
+002b 6fe0c52d fetch 1 ,mem_24g_rxdata_temp + 2 
+002c c0550030 beq datatype_bind ,p_g24_bind_first_step 
+002d c02a803a beq datatype_config ,p_g24_bind_second_step 
+002e c011004a beq datatype_ok ,p_g24_bind_third_step 
+002f 202049c8 branch g24_bind_data_parse_next + 4 
+
+p_g24_bind_first_step:
+0030 6fe0c52e fetch 1 ,mem_24g_rxdata_temp + 3 
+0031 c0008034 beq datatype_device1 ,p_g24_bind_first_step_device1 
+0032 c0010037 beq datatype_device2 ,p_g24_bind_first_step_device2 
+0033 20600000 rtn 
+
+p_g24_bind_first_step_device1:
+0034 6fe0c5d7 fetch 1 ,mem_24g_device1_bind_disable 
+0035 247a0000 nrtn blank 
+0036 202049ce branch g24_bind_first_step_device1 
+
+p_g24_bind_first_step_device2:
+0037 6fe0c5d8 fetch 1 ,mem_24g_device2_bind_disable 
+0038 247a0000 nrtn blank 
+0039 202049d4 branch g24_bind_first_step_device2 
+
+p_g24_bind_second_step:
+003a 6fe0c4f4 fetch 1 ,mem_24g_pair_switch 
+003b 203a0040 branch p_g24_bind_second_step_skip ,blank 
+003c 6fe2452f fetch 4 ,mem_24g_rxdata_temp + 4 
+003d 684a4437 fetcht 4 ,mem_24g_lap 
+003e 98467c00 isub temp ,null 
+003f 24628000 nrtn zero 
+
+p_g24_bind_second_step_skip:
+0040 6fe0c52e fetch 1 ,mem_24g_rxdata_temp + 3 
+0041 c0008044 beq datatype_device1 ,p_g24_bind_second_step_device1 
+0042 c0010047 beq datatype_device2 ,p_g24_bind_second_step_device2 
+0043 20600000 rtn 
+
+p_g24_bind_second_step_device1:
+0044 6fe0c5d7 fetch 1 ,mem_24g_device1_bind_disable 
+0045 247a0000 nrtn blank 
+0046 202049e1 branch g24_bind_second_step_device1 
+
+p_g24_bind_second_step_device2:
+0047 6fe0c5d8 fetch 1 ,mem_24g_device2_bind_disable 
+0048 247a0000 nrtn blank 
+0049 202049ec branch g24_bind_second_step_device2 
+
+p_g24_bind_third_step:
+004a 6fe0c4f4 fetch 1 ,mem_24g_pair_switch 
+004b 203a0050 branch p_g24_bind_third_step_skip ,blank 
+004c 6fe2452f fetch 4 ,mem_24g_rxdata_temp + 4 
+004d 684a456f fetcht 4 ,mem_24g_transmitter_addr 
+004e 98467c00 isub temp ,null 
+004f 24628000 nrtn zero 
+
+p_g24_bind_third_step_skip:
+0050 6fe0c52e fetch 1 ,mem_24g_rxdata_temp + 3 
+0051 c0008054 beq datatype_device1 ,p_g24_bind_third_step_device1 
+0052 c001005b beq datatype_device2 ,p_g24_bind_third_step_device2 
+0053 20600000 rtn 
+
+p_g24_bind_third_step_device1:
+0054 6fe0c5d7 fetch 1 ,mem_24g_device1_bind_disable 
+0055 247a0000 nrtn blank 
+0056 6fe0c518 fetch 1 ,mem_24g_device1_bind_step 
+0057 c0010059 beq 2 ,p_g24_bind_dvc1_step_success 
+0058 20600000 rtn 
+
+p_g24_bind_dvc1_step_success:
+0059 7045d701 jam 1 ,mem_24g_device1_bind_disable 
+005a 20204a01 branch g24_bind_dvc1_step_success 
+
+p_g24_bind_third_step_device2:
+005b 6fe0c5d8 fetch 1 ,mem_24g_device2_bind_disable 
+005c 247a0000 nrtn blank 
+005d 6fe0c519 fetch 1 ,mem_24g_device2_bind_step 
+005e c0800060 bne 0 ,p_g24_bind_dvc2_step_success 
+005f 20600000 rtn 
+
+p_g24_bind_dvc2_step_success:
+0060 7045d801 jam 1 ,mem_24g_device2_bind_disable 
+0061 20204a0c branch g24_bind_dvc2_step_success 
+
+p_le_enable_phy_by_pdata:
+0062 18427e00 copy temp ,pdata 
+0063 c2808065 bbit1 bit_le_2m_phy ,p_le_enable_2m 
+0064 20203d19 branch le_enable_phy_by_pdata + 3 
+
+p_le_enable_2m:
+0065 708a6d89 jam 0x89 ,core_rx_bq_cfg0 
+0066 20203d1f branch le_enable_2m 
 
 p_le_receive_rxon:
-0029 20403d3c call le_prep 
-002a c597802f bmark0 mark_ble_lr ,p_le_receive_nolr 
-002b 783cfc00 pulse dewhiten_code_calc 
-002c 2000001e nop 30 
-002d 20403d3c call le_prep 
-002e 19699600 lshift3 timeup ,timeup 
+0067 20403d3c call le_prep 
+0068 c597806d bmark0 mark_ble_lr ,p_le_receive_nolr 
+0069 783cfc00 pulse dewhiten_code_calc 
+006a 2000001e nop 30 
+006b 20403d3c call le_prep 
+006c 19699600 lshift3 timeup ,timeup 
 
 p_le_receive_nolr:
-002f 7856fc00 disable match 
-0030 7826fc00 enable decode_fec0 
-0031 7830fc00 enable is_rx 
-0032 78507c00 disable is_tx 
-0033 19623600 copy timeup ,stop_watch 
-0034 37c18400 correlate null ,timeout 
-0035 20370038 branch p_le_receive_on_attempt ,attempt 
-0036 1b420400 copy clke ,temp 
-0037 604b000f storet 6 ,mem_sync_clke 
+006d 7856fc00 disable match 
+006e 7826fc00 enable decode_fec0 
+006f 7830fc00 enable is_rx 
+0070 78507c00 disable is_tx 
+0071 19623600 copy timeup ,stop_watch 
+0072 37c18400 correlate null ,timeout 
+0073 20370076 branch p_le_receive_on_attempt ,attempt 
+0074 1b420400 copy clke ,temp 
+0075 604b000f storet 6 ,mem_sync_clke 
 
 p_le_receive_on_attempt:
-0038 242c3e75 nbranch le_unsync_end ,sync 
-0039 78287c00 enable swfine 
-003a db604eab arg param_t_ifs_150us + param_20ms_init + param_sync_time_difference ,stop_watch 
-003b 6fe0c11d fetch 1 ,mem_system_clk 
-003c 9b6f8400 imul32 stop_watch ,temp 
-003d 9840b600 iadd temp ,stop_watch 
-003e 20203de9 branch le_receive_on_attempt + 6 
+0076 242c3e75 nbranch le_unsync_end ,sync 
+0077 78287c00 enable swfine 
+0078 db604eab arg param_t_ifs_150us + param_20ms_init + param_sync_time_difference ,stop_watch 
+0079 6fe0c11d fetch 1 ,mem_system_clk 
+007a 9b6f8400 imul32 stop_watch ,temp 
+007b 9840b600 iadd temp ,stop_watch 
+007c 20203de9 branch le_receive_on_attempt + 6 
 
 p_connection_nosniff:
-003f 70000600 jam 0 ,mem_current_context 
-0040 20203822 branch connection_nosniff 
+007d 70000600 jam 0 ,mem_current_context 
+007e 20203822 branch connection_nosniff 
 
 p_connection_incontext:
-0041 20403863 call context_search_insniff 
-0042 2422803f nbranch p_connection_nosniff ,zero 
-0043 2020381d branch connection_incontext + 3 
+007f 20403863 call context_search_insniff 
+0080 2422807d nbranch p_connection_nosniff ,zero 
+0081 2020381d branch connection_incontext + 3 
 
 p_le_crc_fail_tx:
-0044 20406f09 call ccm_ctrl_clr 
-0045 6fe08198 fetch 1 ,mem_le_rx_phy 
-0046 7d3e7e07 nsetflag ble_coded_info ,bit_le_coded_phy_s8 ,pdata 
-0047 67e08198 store 1 ,mem_le_rx_phy 
-0048 7846fc00 disable decode_fec0 
-0049 20403925 call set_sync_on 
-004a 708a3d12 jam 0x12 ,core_syn_top_ctrl 
-004b 68488008 fetcht 1 ,mem_last_freq 
-004c 1840a202 add temp ,2 ,rega 
-004d 2020398e branch rf_tx_write_freq 
+0082 20406f09 call ccm_ctrl_clr 
+0083 6fe08198 fetch 1 ,mem_le_rx_phy 
+0084 7d3e7e07 nsetflag ble_coded_info ,bit_le_coded_phy_s8 ,pdata 
+0085 67e08198 store 1 ,mem_le_rx_phy 
+0086 7846fc00 disable decode_fec0 
+0087 20403925 call set_sync_on 
+0088 708a3d12 jam 0x12 ,core_syn_top_ctrl 
+0089 68488008 fetcht 1 ,mem_last_freq 
+008a 1840a202 add temp ,2 ,rega 
+008b 2020398e branch rf_tx_write_freq 
 
 p_le_transmit:
-004e 20403d3c call le_prep 
-004f 20403d4b call le_tx_setfreq 
-0050 20406451 call rf_debug_tx_on_line 
-0051 79202a00 set1 txgfsk ,radio_ctrl 
-0052 782efc00 enable encode_fec0 
-0053 78307c00 enable is_tx 
-0054 7850fc00 disable is_rx 
-0055 20403dc2 call le_wait_tx 
-0056 785d7c00 disable lr_s2en 
-0057 c517beff bmark1 mark_ble_lr ,le_transmit_lr 
-0058 c516805a bmark1 mark_ble_2m ,p_le_transmit_2m 
-0059 20203ec8 branch le_transmit + 12 
+008c 20403d3c call le_prep 
+008d 20403d4b call le_tx_setfreq 
+008e 20406451 call rf_debug_tx_on_line 
+008f 79202a00 set1 txgfsk ,radio_ctrl 
+0090 782efc00 enable encode_fec0 
+0091 78307c00 enable is_tx 
+0092 7850fc00 disable is_rx 
+0093 20403dc2 call le_wait_tx 
+0094 785d7c00 disable lr_s2en 
+0095 c517beff bmark1 mark_ble_lr ,le_transmit_lr 
+0096 c5168098 bmark1 mark_ble_2m ,p_le_transmit_2m 
+0097 20203ec8 branch le_transmit + 12 
 
 p_le_transmit_2m:
-005a 6f20c11d fetchr loopcnt ,1 ,mem_system_clk 
+0098 6f20c11d fetchr loopcnt ,1 ,mem_system_clk 
 
 p_le_transmit_2m_dealy:
-005b 20000001 nop 1 
-005c c200005b loop p_le_transmit_2m_dealy 
-005d 20203f15 branch le_transmit_2m_dealy + 2 
+0099 20000001 nop 1 
+009a c2000099 loop p_le_transmit_2m_dealy 
+009b 20203f15 branch le_transmit_2m_dealy + 2 
 
 p_enable_adc:
-005e 6a508a12 fetchr regb ,1 ,core_rf_ldo_cfg6 
-005f 708a123d jam 0x3d ,core_rf_ldo_cfg6 
-0060 708a11aa jam 0xaa ,core_rf_ldo_cfg5 
-0061 708a0a0c jam 0x0c ,core_rf_ldo_en0 
-0062 6ff08a09 fetch 1 ,core_clkpll_cfg6 
-0063 79207e07 set1 7 ,pdata 
-0064 67f08a09 store 1 ,core_clkpll_cfg6 
-0065 708a0b04 jam 0x04 ,core_rf_ldo_en1 
-0066 2000003c nop 60 
-0067 708a1600 jam 0 ,core_syn_en 
-0068 708a1706 jam 6 ,core_rx_en0 
-0069 20406cb4 call read_adc_mode 
-006a 67f08a97 store 1 ,core_gpadc_ctrl 
-006b 20206ca7 branch enable_adc + 15 
+009c 6a508a12 fetchr regb ,1 ,core_rf_ldo_cfg6 
+009d 708a123d jam 0x3d ,core_rf_ldo_cfg6 
+009e 708a11aa jam 0xaa ,core_rf_ldo_cfg5 
+009f 708a0a0c jam 0x0c ,core_rf_ldo_en0 
+00a0 6ff08a09 fetch 1 ,core_clkpll_cfg6 
+00a1 79207e07 set1 7 ,pdata 
+00a2 67f08a09 store 1 ,core_clkpll_cfg6 
+00a3 708a0b04 jam 0x04 ,core_rf_ldo_en1 
+00a4 2000003c nop 60 
+00a5 708a1600 jam 0 ,core_syn_en 
+00a6 708a1706 jam 6 ,core_rx_en0 
+00a7 20406cb4 call read_adc_mode 
+00a8 67f08a97 store 1 ,core_gpadc_ctrl 
+00a9 20206ca7 branch enable_adc + 15 
               org 0x3800
 
 start:
@@ -6081,6 +6175,8 @@
 49c1 d8a0452b arg mem_24g_rxdata_temp ,contw 
 49c2 204074ef call memcpy8 
 49c3 471dc027 bpatchx patch27_3 ,mem_patch27 
+
+g24_bind_data_parse_next:
 49c4 6fe0c52d fetch 1 ,mem_24g_rxdata_temp + 2 
 49c5 c05549ca beq datatype_bind ,g24_bind_first_step 
 49c6 c02ac9d7 beq datatype_config ,g24_bind_second_step 
Index: program/g24_protocol_stack/24g_pair.prog
===================================================================
--- /branch/usb/usb_public/program/g24_protocol_stack/24g_pair.prog	(revision 190)
+++ /branch/usb/usb_public/program/g24_protocol_stack/24g_pair.prog	(working copy)
@@ -223,6 +223,7 @@
 	arg mem_24g_rxdata_temp,contw
 	call memcpy8
 	bpatchx patch27_3,mem_patch27
+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
===================================================================
--- /branch/usb/usb_public/program/patch.prog	(revision 192)
+++ /branch/usb/usb_public/program/patch.prog	(working copy)
@@ -7,6 +7,7 @@
 	beq patch0c_2,p_app_init
 	beq patch12_5,p_enable_adc
 	beq patch17_1,p_usb_init
+	beq patch1a_5,p_le_enable_phy_by_pdata
 	beq patch1b_6,p_le_receive_rxon
 	beq patch1c_2,p_le_crc_fail_tx
 	beq patch1d_0,p_le_transmit
@@ -14,6 +15,7 @@
 
 pf_patch_ext:
 	rtneq patch3f_7
+	beq patch27_3,p_g24_bind_data_parse_next
 	branch assert
 
 
@@ -64,7 +66,90 @@
 	branch usb_init+16
 
 
+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_device1_bind_disable
+	nrtn blank
+	branch g24_bind_first_step_device1
+p_g24_bind_first_step_device2:
+	fetch 1,mem_24g_device2_bind_disable
+	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_24g_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_device1_bind_disable
+	nrtn blank
+	branch g24_bind_second_step_device1
+p_g24_bind_second_step_device2:
+	fetch 1,mem_24g_device2_bind_disable
+	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_device1_bind_disable
+	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_device1_bind_disable	
+	branch g24_bind_dvc1_step_success
+
+p_g24_bind_third_step_device2:
+	fetch 1,mem_24g_device2_bind_disable
+	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_device2_bind_disable
+	branch g24_bind_dvc2_step_success
 
+	
+
+p_le_enable_phy_by_pdata:
+	copy temp,pdata
+	bbit1 BIT_LE_2M_PHY,p_le_enable_2M
+	branch le_enable_phy_by_pdata+3
+p_le_enable_2M:
+	jam 0x89,core_rx_bq_cfg0	//bit7 set1,improve 2M rx sensitivity
+	branch le_enable_2M
+	
 p_le_receive_rxon:
 	call le_prep
 	bmark0 mark_ble_lr,p_le_receive_nolr
