Index: output/eeprom.dat
===================================================================
--- /branch/usb/usb_public_125K/output/eeprom.dat	(revision 330)
+++ /branch/usb/usb_public_125K/output/eeprom.dat	(working copy)
@@ -2,36 +2,40 @@
 02
 aa
 55
-f6
-03
+6a
+04
 c2
 84
 00
-08
+09
 c0
 00
 00
-11
+12
 c0
 0a
 80
-58
+75
 c0
 0b
 80
-5e
+7b
 c0
 1b
 00
-29
+2a
 c0
 5c
 80
-3e
+3f
+c0
+60
+80
+54
 c0
 6a
 80
-53
+70
 20
 20
 3a
@@ -43,31 +47,31 @@
 c0
 14
 00
-61
+7e
 c0
 1d
 00
-84
+a1
 c0
 1d
 80
-98
+b5
 c0
 1e
-80
-e5
+81
+02
 c0
 20
 80
-6a
+87
 c0
 22
 00
-da
+f7
 c0
 40
 00
-1e
+1f
 20
 20
 3a
@@ -103,7 +107,7 @@
 20
 40
 00
-1a
+1b
 20
 20
 38
@@ -139,7 +143,7 @@
 20
 40
 00
-26
+27
 6f
 e0
 c5
@@ -171,7 +175,7 @@
 20
 40
 00
-3c
+3d
 6f
 e0
 87
@@ -231,7 +235,7 @@
 c0
 50
 80
-3a
+3b
 20
 20
 52
@@ -263,7 +267,7 @@
 20
 40
 00
-50
+51
 70
 06
 10
@@ -336,6 +340,118 @@
 60
 00
 00
+6f
+e0
+87
+61
+20
+7a
+00
+00
+6f
+f0
+8c
+24
+1f
+e1
+7e
+0f
+24
+3a
+74
+96
+6f
+e0
+87
+62
+20
+3a
+74
+6c
+6f
+e0
+87
+54
+c0
+01
+f4
+a6
+c0
+81
+74
+6c
+6f
+e0
+87
+56
+24
+3a
+74
+6c
+20
+40
+00
+62
+20
+20
+74
+5f
+6f
+f0
+8c
+24
+c3
+80
+80
+00
+6f
+e0
+87
+61
+c4
+00
+80
+00
+6f
+e0
+87
+61
+79
+3f
+fe
+01
+67
+e0
+87
+61
+6f
+e0
+87
+5f
+20
+7a
+00
+00
+c0
+08
+00
+6d
+20
+20
+3a
+ba
+58
+00
+00
+00
+67
+e2
+07
+7b
+20
+20
+74
+8e
 18
 42
 7e
@@ -343,7 +459,7 @@
 c2
 80
 80
-56
+73
 20
 20
 3d
@@ -551,7 +667,7 @@
 20
 40
 00
-90
+ad
 20
 40
 4a
@@ -619,19 +735,19 @@
 c0
 55
 00
-9e
+bb
 c0
 2a
 80
-a8
+c5
 c0
 11
 00
-b8
+d5
 c0
 7f
 80
-d0
+ed
 20
 60
 00
@@ -643,11 +759,11 @@
 c0
 00
 80
-a2
+bf
 c0
 01
 00
-a5
+c2
 20
 60
 00
@@ -683,7 +799,7 @@
 20
 3a
 00
-ae
+cb
 6f
 e2
 45
@@ -707,11 +823,11 @@
 c0
 00
 80
-b2
+cf
 c0
 01
 00
-b5
+d2
 20
 60
 00
@@ -747,7 +863,7 @@
 20
 3a
 00
-be
+db
 6f
 e2
 45
@@ -771,11 +887,11 @@
 c0
 00
 80
-c2
+df
 c0
 01
 00
-c9
+e6
 20
 60
 00
@@ -795,7 +911,7 @@
 c0
 01
 00
-c7
+e4
 20
 60
 00
@@ -823,7 +939,7 @@
 c0
 80
 00
-ce
+eb
 20
 60
 00
@@ -843,11 +959,11 @@
 c0
 00
 80
-d4
+f1
 c0
 01
 00
-d7
+f4
 20
 60
 00
@@ -887,7 +1003,7 @@
 20
 40
 00
-de
+fb
 20
 20
 4b
@@ -926,16 +1042,16 @@
 2d
 c0
 00
-80
-ea
+81
+07
 c0
 01
 4a
 69
 c0
 7f
-80
-fb
+81
+18
 20
 20
 4a
@@ -970,8 +1086,8 @@
 4d
 c0
 00
-80
-f3
+81
+10
 20
 20
 4a
@@ -1015,9 +1131,9 @@
 20
 20
 00
-d0
-2e
-8a
+ed
+9f
+10
 aa
 55
 40
@@ -1048,7 +1164,7 @@
 00
 00
 02
-00
+02
 00
 20
 00
@@ -1303,7 +1419,7 @@
 aa
 aa
 55
-36
+38
 3f
-cc
-05
+c3
+e9
Index: output/program.lis
===================================================================
--- /branch/usb/usb_public_125K/output/program.lis	(revision 330)
+++ /branch/usb/usb_public_125K/output/program.lis	(working copy)
@@ -1,340 +1,375 @@
               include "bt_format "
               org 0x0000
-0000 c2840008 bbit1 8 ,pf_patch_ext 
-0001 c0000011 beq patch00_0 ,p_soft_reset 
-0002 c00a8058 beq patch02_5 ,p_set_freq_tx 
-0003 c00b805e beq patch02_7 ,p_set_tx_power_8db 
-0004 c01b0029 beq patch06_6 ,p_dongle_usb_dispatch 
-0005 c05c803e beq patch17_1 ,p_usb_init 
-0006 c06a8053 beq patch1a_5 ,p_le_enable_phy_by_pdata 
-0007 20203aba branch assert 
+0000 c2840009 bbit1 8 ,pf_patch_ext 
+0001 c0000012 beq patch00_0 ,p_soft_reset 
+0002 c00a8075 beq patch02_5 ,p_set_freq_tx 
+0003 c00b807b beq patch02_7 ,p_set_tx_power_8db 
+0004 c01b002a beq patch06_6 ,p_dongle_usb_dispatch 
+0005 c05c803f beq patch17_1 ,p_usb_init 
+0006 c0608054 beq patch18_1 ,p_usb_tx 
+0007 c06a8070 beq patch1a_5 ,p_le_enable_phy_by_pdata 
+0008 20203aba branch assert 
 
 pf_patch_ext:
-0008 c17f8000 rtneq patch3f_7 
-0009 c0140061 beq patch25_0 ,p_g24_receive_skip_end 
-000a c01d0084 beq patch27_2 ,p_g24_bind_data_process 
-000b c01d8098 beq patch27_3 ,p_g24_bind_data_parse_next 
-000c c01e80e5 beq patch27_5 ,p_g24_receive_packet_start_next 
-000d c020806a beq patch28_1 ,p_g24_mode_switch_bind_search 
-000e c02200da beq patch28_4 ,p_g24_search_mode_auto 
-000f c040001e beq patch30_0 ,p_dongle_default_init 
-0010 20203aba branch assert 
+0009 c17f8000 rtneq patch3f_7 
+000a c014007e beq patch25_0 ,p_g24_receive_skip_end 
+000b c01d00a1 beq patch27_2 ,p_g24_bind_data_process 
+000c c01d80b5 beq patch27_3 ,p_g24_bind_data_parse_next 
+000d c01e8102 beq patch27_5 ,p_g24_receive_packet_start_next 
+000e c0208087 beq patch28_1 ,p_g24_mode_switch_bind_search 
+000f c02200f7 beq patch28_4 ,p_g24_search_mode_auto 
+0010 c040001f beq patch30_0 ,p_dongle_default_init 
+0011 20203aba branch assert 
 
 p_soft_reset:
-0011 20800000 clear_stack 
-0012 6fe240cc fetch 4 ,mem_lpm_ctrl3 
-0013 67f2004c store 4 ,core_lpm_reg 
-0014 20403c49 call lpm_write_ctrl3 
-0015 20404da6 call app_param_init 
-0016 20403a0e call initialize_radio 
-0017 20406a00 call iic_init_360khz 
-0018 2040001a call p_init_param 
-0019 20203807 branch soft_reset + 6 
+0012 20800000 clear_stack 
+0013 6fe240cc fetch 4 ,mem_lpm_ctrl3 
+0014 67f2004c store 4 ,core_lpm_reg 
+0015 20403c49 call lpm_write_ctrl3 
+0016 20404da6 call app_param_init 
+0017 20403a0e call initialize_radio 
+0018 20406a00 call iic_init_360khz 
+0019 2040001b call p_init_param 
+001a 20203807 branch soft_reset + 6 
 
 p_init_param:
-001a 58000000 setarg 0 
-001b 67e40000 store 8 ,mem_le_adv_transmit 
-001c e7e30005 istore 6 ,contw 
-001d 20203ac5 branch init_param + 2 
+001b 58000000 setarg 0 
+001c 67e40000 store 8 ,mem_le_adv_transmit 
+001d e7e30005 istore 6 ,contw 
+001e 20203ac5 branch init_param + 2 
 
 p_dongle_default_init:
-001e 20405255 call dongle_default_init + 1 
-001f 70451694 jam tx_power_f20db ,mem_24g_pair_tx_power 
-0020 70451000 jam off ,mem_24g_disable_fec1 
-0021 20400026 call p_g24_enable_coded_s8 
-0022 6fe0c5ab fetch 1 ,mem_dg_sys_config 
-0023 c4000000 rtnbit0 dg_enable_new_revision 
-0024 70451001 jam on ,mem_24g_disable_fec1 
-0025 2020492e branch g24_enable_2m 
+001f 20405255 call dongle_default_init + 1 
+0020 70451694 jam tx_power_f20db ,mem_24g_pair_tx_power 
+0021 70451000 jam off ,mem_24g_disable_fec1 
+0022 20400027 call p_g24_enable_coded_s8 
+0023 6fe0c5ab fetch 1 ,mem_dg_sys_config 
+0024 c4000000 rtnbit0 dg_enable_new_revision 
+0025 70451001 jam on ,mem_24g_disable_fec1 
+0026 2020492e branch g24_enable_2m 
 
 p_g24_enable_coded_s8:
-0026 7044fd84 jam 0x84 ,mem_24g_rx_phy 
-0027 7044fe84 jam 0x84 ,mem_24g_tx_phy 
-0028 20600000 rtn 
+0027 7044fd84 jam 0x84 ,mem_24g_rx_phy 
+0028 7044fe84 jam 0x84 ,mem_24g_tx_phy 
+0029 20600000 rtn 
 
 p_dongle_usb_dispatch:
-0029 2040003c call p_wdt_kick 
-002a 6fe08755 fetch 1 ,mem_usb_remote_wakeup 
-002b 205a533b call dongle_clear_pc_sleep_flag ,blank 
-002c 20407176 call usb_isr 
-002d 6fe0874b fetch 1 ,mem_usb0_get_set_report 
-002e 207a0000 rtn blank 
-002f 70074b00 jam 0 ,mem_usb0_get_set_report 
-0030 6fe10749 fetch 2 ,mem_usb_setup_bvalue_temp 
-0031 d84002ba arg pc_set_report ,temp 
-0032 98467c00 isub temp ,null 
-0033 24628000 nrtn zero 
-0034 6fe086c9 fetch 1 ,mem_usb0_set_report_data 
-0035 c1dd0000 rtnne pc_report_id 
-0036 6fe086ca fetch 1 ,mem_usb0_set_report_data + 1 
-0037 c0505302 beq command_mode ,dongle_dispose_cmd_mode 
-0038 c050803a beq command_bind ,p_dongle_dispose_cmd_bind 
-0039 202052fd branch dongle_usb_dispatch_check_cmd + 3 
+002a 2040003d call p_wdt_kick 
+002b 6fe08755 fetch 1 ,mem_usb_remote_wakeup 
+002c 205a533b call dongle_clear_pc_sleep_flag ,blank 
+002d 20407176 call usb_isr 
+002e 6fe0874b fetch 1 ,mem_usb0_get_set_report 
+002f 207a0000 rtn blank 
+0030 70074b00 jam 0 ,mem_usb0_get_set_report 
+0031 6fe10749 fetch 2 ,mem_usb_setup_bvalue_temp 
+0032 d84002ba arg pc_set_report ,temp 
+0033 98467c00 isub temp ,null 
+0034 24628000 nrtn zero 
+0035 6fe086c9 fetch 1 ,mem_usb0_set_report_data 
+0036 c1dd0000 rtnne pc_report_id 
+0037 6fe086ca fetch 1 ,mem_usb0_set_report_data + 1 
+0038 c0505302 beq command_mode ,dongle_dispose_cmd_mode 
+0039 c050803b beq command_bind ,p_dongle_dispose_cmd_bind 
+003a 202052fd branch dongle_usb_dispatch_check_cmd + 3 
 
 p_dongle_dispose_cmd_bind:
-003a 7045d800 jam 0 ,mem_24g_device2_bind_disable 
-003b 20205308 branch dongle_dispose_cmd_bind 
+003b 7045d800 jam 0 ,mem_24g_device2_bind_disable 
+003c 20205308 branch dongle_dispose_cmd_bind 
 
 p_wdt_kick:
-003c 58000010 setarg 16 
-003d 20206de1 branch wdt_init_config 
+003d 58000010 setarg 16 
+003e 20206de1 branch wdt_init_config 
 
 p_usb_init:
-003e 20406fd3 call enable_authrom 
-003f 204071a1 call usb_init_param 
-0040 20400050 call p_usb_manufacturer_update 
-0041 70061003 jam 0x03 ,mem_devicedesc + 17 
-0042 708c0000 jam 0x00 ,core_usb_config 
-0043 20002710 nop 10000 
-0044 708c1800 jam 0x00 ,core_usb_trig 
-0045 6ff10050 fetch 2 ,core_clkoff 
-0046 793ffe0a set0 clock_off_usb ,pdata 
-0047 67f10050 store 2 ,core_clkoff 
-0048 708c1100 jam 0x0 ,core_usb_hmode 
-0049 708c003c jam 0x3c ,core_usb_config 
-004a 58000bb3 setarg mem_usb_rxbuf_new 
-004b 67f10c03 store 2 ,core_usb_rx_saddr 
-004c 67f10c07 store 2 ,core_usb_rxptr 
-004d 58000bf7 setarg mem_usb_rxbuf_new_end 
-004e 67f10c05 store 2 ,core_usb_rx_eaddr 
-004f 20207192 branch usb_init + 16 
+003f 20406fd3 call enable_authrom 
+0040 204071a1 call usb_init_param 
+0041 20400051 call p_usb_manufacturer_update 
+0042 70061003 jam 0x03 ,mem_devicedesc + 17 
+0043 708c0000 jam 0x00 ,core_usb_config 
+0044 20002710 nop 10000 
+0045 708c1800 jam 0x00 ,core_usb_trig 
+0046 6ff10050 fetch 2 ,core_clkoff 
+0047 793ffe0a set0 clock_off_usb ,pdata 
+0048 67f10050 store 2 ,core_clkoff 
+0049 708c1100 jam 0x0 ,core_usb_hmode 
+004a 708c003c jam 0x3c ,core_usb_config 
+004b 58000bb3 setarg mem_usb_rxbuf_new 
+004c 67f10c03 store 2 ,core_usb_rx_saddr 
+004d 67f10c07 store 2 ,core_usb_rxptr 
+004e 58000bf7 setarg mem_usb_rxbuf_new_end 
+004f 67f10c05 store 2 ,core_usb_rx_eaddr 
+0050 20207192 branch usb_init + 16 
 
 p_usb_manufacturer_update:
-0050 6fe345e5 fetch 6 ,mem_usb_manufacturer_info 
-0051 67e30653 store 6 ,mem_string1 
-0052 20600000 rtn 
+0051 6fe345e5 fetch 6 ,mem_usb_manufacturer_info 
+0052 67e30653 store 6 ,mem_string1 
+0053 20600000 rtn 
+
+p_usb_tx:
+0054 6fe08761 fetch 1 ,mem_usb_tx_enable 
+0055 207a0000 rtn blank 
+0056 6ff08c24 fetch 1 ,core_usb_txbusy 
+0057 1fe17e0f and_into 0x0f ,pdata 
+0058 243a7496 nbranch usb_inwake_state_tx_dispose ,blank 
+0059 6fe08762 fetch 1 ,mem_usb_device_enumeration_endflag 
+005a 203a746c branch usb_tx_fifo_release ,blank 
+005b 6fe08754 fetch 1 ,mem_usb_state 
+005c c001f4a6 beq usb_sleep ,usb_windows_wakeup 
+005d c081746c bne usb_connected ,usb_tx_fifo_release 
+005e 6fe08756 fetch 1 ,mem_usb_clear_remote_wakeup 
+005f 243a746c nbranch usb_tx_fifo_release ,blank 
+0060 20400062 call p_usb_tx_data_ep1 
+0061 2020745f branch usb_tx_data_ep2 
+
+p_usb_tx_data_ep1:
+0062 6ff08c24 fetch 1 ,core_usb_txbusy 
+0063 c3808000 rtnbit1 1 
+0064 6fe08761 fetch 1 ,mem_usb_tx_enable 
+0065 c4008000 rtnbit0 1 
+0066 6fe08761 fetch 1 ,mem_usb_tx_enable 
+0067 793ffe01 set0 1 ,pdata 
+0068 67e08761 store 1 ,mem_usb_tx_enable 
+0069 6fe0875f fetch 1 ,mem_usb_ep1_data 
+006a 207a0000 rtn blank 
+006b c008006d beq usb_ep1_kb ,p_usb_tx_kb_normal_data 
+006c 20203aba branch assert 
+
+p_usb_tx_kb_normal_data:
+006d 58000000 setarg 0 
+006e 67e2077b store 4 ,mem_usb_kb_data + 4 
+006f 2020748e branch usb_tx_kb_normal_data 
 
 p_le_enable_phy_by_pdata:
-0053 18427e00 copy temp ,pdata 
-0054 c2808056 bbit1 bit_le_2m_phy ,p_le_enable_2m 
-0055 20203d19 branch le_enable_phy_by_pdata + 3 
+0070 18427e00 copy temp ,pdata 
+0071 c2808073 bbit1 bit_le_2m_phy ,p_le_enable_2m 
+0072 20203d19 branch le_enable_phy_by_pdata + 3 
 
 p_le_enable_2m:
-0056 708a6d89 jam 0x89 ,core_rx_bq_cfg0 
-0057 20203d1f branch le_enable_2m 
+0073 708a6d89 jam 0x89 ,core_rx_bq_cfg0 
+0074 20203d1f branch le_enable_2m 
 
 p_set_freq_tx:
-0058 708a3d12 jam 0x12 ,core_syn_top_ctrl 
-0059 60488008 storet 1 ,mem_last_freq 
-005a 1840a202 add temp ,2 ,rega 
-005b 2040398e call rf_tx_write_freq 
-005c 200003c0 nop 0x3c0 
-005d 202039cf branch txon 
+0075 708a3d12 jam 0x12 ,core_syn_top_ctrl 
+0076 60488008 storet 1 ,mem_last_freq 
+0077 1840a202 add temp ,2 ,rega 
+0078 2040398e call rf_tx_write_freq 
+0079 200003c0 nop 0x3c0 
+007a 202039cf branch txon 
 
 p_set_tx_power_8db:
-005e 708a39ab jam 0xab ,core_tx_pwr_ctrl0 
-005f 708a3a0f jam 0x0f ,core_tx_pwr_ctrl1 
-0060 202039f3 branch set_rf_ldo_cfg89_2 
+007b 708a39ab jam 0xab ,core_tx_pwr_ctrl0 
+007c 708a3a0f jam 0x0f ,core_tx_pwr_ctrl1 
+007d 202039f3 branch set_rf_ldo_cfg89_2 
 
 p_g24_receive_skip_end:
-0061 6fe0c5ab fetch 1 ,mem_dg_sys_config 
-0062 c300481c bbit0 dg_enable_new_revision ,g24_receive_skip_end 
-0063 2000012c nop 300 
-0064 6fe0c43e fetch 1 ,mem_24g_rxbuf + 1 
-0065 79207e00 set1 bit_ack_24g ,pdata 
-0066 67e0c43e store 1 ,mem_24g_rxbuf + 1 
-0067 20404a3b call g24_ackpayload_prep 
-0068 2040488f call g24_transmit_prep 
-0069 2020483f branch g24_transmit 
+007e 6fe0c5ab fetch 1 ,mem_dg_sys_config 
+007f c300481c bbit0 dg_enable_new_revision ,g24_receive_skip_end 
+0080 2000012c nop 300 
+0081 6fe0c43e fetch 1 ,mem_24g_rxbuf + 1 
+0082 79207e00 set1 bit_ack_24g ,pdata 
+0083 67e0c43e store 1 ,mem_24g_rxbuf + 1 
+0084 20404a3b call g24_ackpayload_prep 
+0085 2040488f call g24_transmit_prep 
+0086 2020483f branch g24_transmit 
 
 p_g24_mode_switch_bind_search:
-006a 6fe0c559 fetch 1 ,mem_24g_work_mode 
-006b c1000000 rtneq dongle_work 
-006c 6fe0c56d fetch 1 ,mem_24g_b_s_mode_switch_disable 
-006d 247a0000 nrtn blank 
-006e 6fe0c56b fetch 1 ,mem_24g_mode_b_s_switch_exit 
-006f 247a0000 nrtn blank 
-0070 6fe0c567 fetch 1 ,mem_24g_mode_b_s_switch 
-0071 207a0000 rtn blank 
-0072 6fe0c56e fetch 1 ,mem_24g_bind_device_living 
-0073 2fe00603 compare 3 ,pdata ,3 
-0074 2020cadc branch g24_mode_b_s_switch_exit ,true 
-0075 204048ef call g24_timer_check 
-0076 24740000 nrtn user 
-0077 6fe14569 fetch 2 ,mem_24g_mode_b_s_switch_cnt 
-0078 1fe0fe01 increase 1 ,pdata 
-0079 67e14569 store 2 ,mem_24g_mode_b_s_switch_cnt 
-007a d84007d0 arg 0x7d0 ,temp 
-007b 98467c00 isub temp ,null 
-007c 20214adc branch g24_mode_b_s_switch_exit ,positive 
-007d 6fe0c56c fetch 1 ,mem_24g_b_s_time_slice 
-007e 1fe0fe01 increase 1 ,pdata 
-007f 1fe17e01 and_into 1 ,pdata 
-0080 67e0c56c store 1 ,mem_24g_b_s_time_slice 
-0081 c0004ba3 beq 0 ,g24_search_mode_enable 
-0082 c000c99f beq 1 ,g24_bind_mode_enable 
-0083 20600000 rtn 
+0087 6fe0c559 fetch 1 ,mem_24g_work_mode 
+0088 c1000000 rtneq dongle_work 
+0089 6fe0c56d fetch 1 ,mem_24g_b_s_mode_switch_disable 
+008a 247a0000 nrtn blank 
+008b 6fe0c56b fetch 1 ,mem_24g_mode_b_s_switch_exit 
+008c 247a0000 nrtn blank 
+008d 6fe0c567 fetch 1 ,mem_24g_mode_b_s_switch 
+008e 207a0000 rtn blank 
+008f 6fe0c56e fetch 1 ,mem_24g_bind_device_living 
+0090 2fe00603 compare 3 ,pdata ,3 
+0091 2020cadc branch g24_mode_b_s_switch_exit ,true 
+0092 204048ef call g24_timer_check 
+0093 24740000 nrtn user 
+0094 6fe14569 fetch 2 ,mem_24g_mode_b_s_switch_cnt 
+0095 1fe0fe01 increase 1 ,pdata 
+0096 67e14569 store 2 ,mem_24g_mode_b_s_switch_cnt 
+0097 d84007d0 arg 0x7d0 ,temp 
+0098 98467c00 isub temp ,null 
+0099 20214adc branch g24_mode_b_s_switch_exit ,positive 
+009a 6fe0c56c fetch 1 ,mem_24g_b_s_time_slice 
+009b 1fe0fe01 increase 1 ,pdata 
+009c 1fe17e01 and_into 1 ,pdata 
+009d 67e0c56c store 1 ,mem_24g_b_s_time_slice 
+009e c0004ba3 beq 0 ,g24_search_mode_enable 
+009f c000c99f beq 1 ,g24_bind_mode_enable 
+00a0 20600000 rtn 
 
 p_g24_bind_data_process:
-0084 20404a54 call g24_rx_interrupt_clear 
-0085 204047ce call g24_receive_packet 
-0086 2437ca54 nbranch g24_rx_interrupt_clear ,user3 
-0087 204049bf call g24_bind_data_parse 
-0088 20400090 call p_g24_bind_transmit_ack 
-0089 20404a2e call g24_bind_device_status_check 
-008a 204053c3 call dongle_kb_bind_soft_reset 
-008b 6fe0c4f4 fetch 1 ,mem_24g_pair_switch 
-008c 207a0000 rtn blank 
-008d 6fe2456f fetch 4 ,mem_24g_transmitter_addr 
-008e 207a0000 rtn blank 
-008f 202048e0 branch g24_update_addr_and_synccrc8 
+00a1 20404a54 call g24_rx_interrupt_clear 
+00a2 204047ce call g24_receive_packet 
+00a3 2437ca54 nbranch g24_rx_interrupt_clear ,user3 
+00a4 204049bf call g24_bind_data_parse 
+00a5 204000ad call p_g24_bind_transmit_ack 
+00a6 20404a2e call g24_bind_device_status_check 
+00a7 204053c3 call dongle_kb_bind_soft_reset 
+00a8 6fe0c4f4 fetch 1 ,mem_24g_pair_switch 
+00a9 207a0000 rtn blank 
+00aa 6fe2456f fetch 4 ,mem_24g_transmitter_addr 
+00ab 207a0000 rtn blank 
+00ac 202048e0 branch g24_update_addr_and_synccrc8 
 
 p_g24_bind_transmit_ack:
-0090 6fe0c43d fetch 1 ,mem_24g_rxbuf 
-0091 67e0c4cf store 1 ,mem_24g_data_type 
-0092 204048be call g24_read_len_pid_crc 
-0093 20404a3b call g24_ackpayload_prep 
-0094 2437c837 nbranch g24_end_of_packet ,user3 
-0095 2040488f call g24_transmit_prep 
-0096 2040483f call g24_transmit 
-0097 20204837 branch g24_end_of_packet 
+00ad 6fe0c43d fetch 1 ,mem_24g_rxbuf 
+00ae 67e0c4cf store 1 ,mem_24g_data_type 
+00af 204048be call g24_read_len_pid_crc 
+00b0 20404a3b call g24_ackpayload_prep 
+00b1 2437c837 nbranch g24_end_of_packet ,user3 
+00b2 2040488f call g24_transmit_prep 
+00b3 2040483f call g24_transmit 
+00b4 20204837 branch g24_end_of_packet 
 
 p_g24_bind_data_parse_next:
-0098 6fe0c52d fetch 1 ,mem_24g_rxdata_temp + 2 
-0099 c055009e beq datatype_bind ,p_g24_bind_first_step 
-009a c02a80a8 beq datatype_config ,p_g24_bind_second_step 
-009b c01100b8 beq datatype_ok ,p_g24_bind_third_step 
-009c c07f80d0 beq datatype_attemp ,p_g24_data_attemp 
-009d 20600000 rtn 
+00b5 6fe0c52d fetch 1 ,mem_24g_rxdata_temp + 2 
+00b6 c05500bb beq datatype_bind ,p_g24_bind_first_step 
+00b7 c02a80c5 beq datatype_config ,p_g24_bind_second_step 
+00b8 c01100d5 beq datatype_ok ,p_g24_bind_third_step 
+00b9 c07f80ed beq datatype_attemp ,p_g24_data_attemp 
+00ba 20600000 rtn 
 
 p_g24_bind_first_step:
-009e 6fe0c52e fetch 1 ,mem_24g_rxdata_temp + 3 
-009f c00080a2 beq datatype_device1 ,p_g24_bind_first_step_device1 
-00a0 c00100a5 beq datatype_device2 ,p_g24_bind_first_step_device2 
-00a1 20600000 rtn 
+00bb 6fe0c52e fetch 1 ,mem_24g_rxdata_temp + 3 
+00bc c00080bf beq datatype_device1 ,p_g24_bind_first_step_device1 
+00bd c00100c2 beq datatype_device2 ,p_g24_bind_first_step_device2 
+00be 20600000 rtn 
 
 p_g24_bind_first_step_device1:
-00a2 6fe0c5d7 fetch 1 ,mem_24g_device1_bind_disable 
-00a3 247a0000 nrtn blank 
-00a4 202049ce branch g24_bind_first_step_device1 
+00bf 6fe0c5d7 fetch 1 ,mem_24g_device1_bind_disable 
+00c0 247a0000 nrtn blank 
+00c1 202049ce branch g24_bind_first_step_device1 
 
 p_g24_bind_first_step_device2:
-00a5 6fe0c5d8 fetch 1 ,mem_24g_device2_bind_disable 
-00a6 247a0000 nrtn blank 
-00a7 202049d4 branch g24_bind_first_step_device2 
+00c2 6fe0c5d8 fetch 1 ,mem_24g_device2_bind_disable 
+00c3 247a0000 nrtn blank 
+00c4 202049d4 branch g24_bind_first_step_device2 
 
 p_g24_bind_second_step:
-00a8 6fe0c4f4 fetch 1 ,mem_24g_pair_switch 
-00a9 203a00ae branch p_g24_bind_second_step_skip ,blank 
-00aa 6fe2452f fetch 4 ,mem_24g_rxdata_temp + 4 
-00ab 684a4437 fetcht 4 ,mem_24g_lap 
-00ac 98467c00 isub temp ,null 
-00ad 24628000 nrtn zero 
+00c5 6fe0c4f4 fetch 1 ,mem_24g_pair_switch 
+00c6 203a00cb branch p_g24_bind_second_step_skip ,blank 
+00c7 6fe2452f fetch 4 ,mem_24g_rxdata_temp + 4 
+00c8 684a4437 fetcht 4 ,mem_24g_lap 
+00c9 98467c00 isub temp ,null 
+00ca 24628000 nrtn zero 
 
 p_g24_bind_second_step_skip:
-00ae 6fe0c52e fetch 1 ,mem_24g_rxdata_temp + 3 
-00af c00080b2 beq datatype_device1 ,p_g24_bind_second_step_device1 
-00b0 c00100b5 beq datatype_device2 ,p_g24_bind_second_step_device2 
-00b1 20600000 rtn 
+00cb 6fe0c52e fetch 1 ,mem_24g_rxdata_temp + 3 
+00cc c00080cf beq datatype_device1 ,p_g24_bind_second_step_device1 
+00cd c00100d2 beq datatype_device2 ,p_g24_bind_second_step_device2 
+00ce 20600000 rtn 
 
 p_g24_bind_second_step_device1:
-00b2 6fe0c5d7 fetch 1 ,mem_24g_device1_bind_disable 
-00b3 247a0000 nrtn blank 
-00b4 202049e1 branch g24_bind_second_step_device1 
+00cf 6fe0c5d7 fetch 1 ,mem_24g_device1_bind_disable 
+00d0 247a0000 nrtn blank 
+00d1 202049e1 branch g24_bind_second_step_device1 
 
 p_g24_bind_second_step_device2:
-00b5 6fe0c5d8 fetch 1 ,mem_24g_device2_bind_disable 
-00b6 247a0000 nrtn blank 
-00b7 202049ec branch g24_bind_second_step_device2 
+00d2 6fe0c5d8 fetch 1 ,mem_24g_device2_bind_disable 
+00d3 247a0000 nrtn blank 
+00d4 202049ec branch g24_bind_second_step_device2 
 
 p_g24_bind_third_step:
-00b8 6fe0c4f4 fetch 1 ,mem_24g_pair_switch 
-00b9 203a00be branch p_g24_bind_third_step_skip ,blank 
-00ba 6fe2452f fetch 4 ,mem_24g_rxdata_temp + 4 
-00bb 684a456f fetcht 4 ,mem_24g_transmitter_addr 
-00bc 98467c00 isub temp ,null 
-00bd 24628000 nrtn zero 
+00d5 6fe0c4f4 fetch 1 ,mem_24g_pair_switch 
+00d6 203a00db branch p_g24_bind_third_step_skip ,blank 
+00d7 6fe2452f fetch 4 ,mem_24g_rxdata_temp + 4 
+00d8 684a456f fetcht 4 ,mem_24g_transmitter_addr 
+00d9 98467c00 isub temp ,null 
+00da 24628000 nrtn zero 
 
 p_g24_bind_third_step_skip:
-00be 6fe0c52e fetch 1 ,mem_24g_rxdata_temp + 3 
-00bf c00080c2 beq datatype_device1 ,p_g24_bind_third_step_device1 
-00c0 c00100c9 beq datatype_device2 ,p_g24_bind_third_step_device2 
-00c1 20600000 rtn 
+00db 6fe0c52e fetch 1 ,mem_24g_rxdata_temp + 3 
+00dc c00080df beq datatype_device1 ,p_g24_bind_third_step_device1 
+00dd c00100e6 beq datatype_device2 ,p_g24_bind_third_step_device2 
+00de 20600000 rtn 
 
 p_g24_bind_third_step_device1:
-00c2 6fe0c5d7 fetch 1 ,mem_24g_device1_bind_disable 
-00c3 247a0000 nrtn blank 
-00c4 6fe0c518 fetch 1 ,mem_24g_device1_bind_step 
-00c5 c00100c7 beq 2 ,p_g24_bind_dvc1_step_success 
-00c6 20600000 rtn 
+00df 6fe0c5d7 fetch 1 ,mem_24g_device1_bind_disable 
+00e0 247a0000 nrtn blank 
+00e1 6fe0c518 fetch 1 ,mem_24g_device1_bind_step 
+00e2 c00100e4 beq 2 ,p_g24_bind_dvc1_step_success 
+00e3 20600000 rtn 
 
 p_g24_bind_dvc1_step_success:
-00c7 7045d701 jam 1 ,mem_24g_device1_bind_disable 
-00c8 20204a02 branch g24_bind_dvc1_step_success + 1 
+00e4 7045d701 jam 1 ,mem_24g_device1_bind_disable 
+00e5 20204a02 branch g24_bind_dvc1_step_success + 1 
 
 p_g24_bind_third_step_device2:
-00c9 6fe0c5d8 fetch 1 ,mem_24g_device2_bind_disable 
-00ca 247a0000 nrtn blank 
-00cb 6fe0c519 fetch 1 ,mem_24g_device2_bind_step 
-00cc c08000ce bne 0 ,p_g24_bind_dvc2_step_success 
-00cd 20600000 rtn 
+00e6 6fe0c5d8 fetch 1 ,mem_24g_device2_bind_disable 
+00e7 247a0000 nrtn blank 
+00e8 6fe0c519 fetch 1 ,mem_24g_device2_bind_step 
+00e9 c08000eb bne 0 ,p_g24_bind_dvc2_step_success 
+00ea 20600000 rtn 
 
 p_g24_bind_dvc2_step_success:
-00ce 7045d801 jam 1 ,mem_24g_device2_bind_disable 
-00cf 20204a0d branch g24_bind_dvc2_step_success + 1 
+00eb 7045d801 jam 1 ,mem_24g_device2_bind_disable 
+00ec 20204a0d branch g24_bind_dvc2_step_success + 1 
 
 p_g24_data_attemp:
-00d0 6fe0c52e fetch 1 ,mem_24g_rxdata_temp + 3 
-00d1 c00080d4 beq datatype_device1 ,p_g24_data_attemp_device1 
-00d2 c00100d7 beq datatype_device2 ,p_g24_data_attemp_device2 
-00d3 20600000 rtn 
+00ed 6fe0c52e fetch 1 ,mem_24g_rxdata_temp + 3 
+00ee c00080f1 beq datatype_device1 ,p_g24_data_attemp_device1 
+00ef c00100f4 beq datatype_device2 ,p_g24_data_attemp_device2 
+00f0 20600000 rtn 
 
 p_g24_data_attemp_device1:
-00d4 6fe0c5d7 fetch 1 ,mem_24g_device1_bind_disable 
-00d5 247a0000 nrtn blank 
-00d6 20204c24 branch g24_data_attemp_device1 
+00f1 6fe0c5d7 fetch 1 ,mem_24g_device1_bind_disable 
+00f2 247a0000 nrtn blank 
+00f3 20204c24 branch g24_data_attemp_device1 
 
 p_g24_data_attemp_device2:
-00d7 6fe0c5d8 fetch 1 ,mem_24g_device2_bind_disable 
-00d8 247a0000 nrtn blank 
-00d9 20204c28 branch g24_data_attemp_device2 
+00f4 6fe0c5d8 fetch 1 ,mem_24g_device2_bind_disable 
+00f5 247a0000 nrtn blank 
+00f6 20204c28 branch g24_data_attemp_device2 
 
 p_g24_search_mode_auto:
-00da 6fe0c559 fetch 1 ,mem_24g_work_mode 
-00db c1838000 rtnne dongle_search 
-00dc 204000de call p_g24_search_mode_init 
-00dd 20204b1b branch g24_search_mode_auto + 4 
+00f7 6fe0c559 fetch 1 ,mem_24g_work_mode 
+00f8 c1838000 rtnne dongle_search 
+00f9 204000fb call p_g24_search_mode_init 
+00fa 20204b1b branch g24_search_mode_auto + 4 
 
 p_g24_search_mode_init:
-00de 6fe0c558 fetch 1 ,mem_24g_mode_init 
-00df c3838000 rtnbit1 dongle_search 
-00e0 79207e07 set1 dongle_search ,pdata 
-00e1 67e0c558 store 1 ,mem_24g_mode_init 
-00e2 6fe0c566 fetch 1 ,mem_tx_power_temp 
-00e3 67e0c116 store 1 ,mem_tx_power 
-00e4 20204b0b branch g24_search_mode_init + 4 
+00fb 6fe0c558 fetch 1 ,mem_24g_mode_init 
+00fc c3838000 rtnbit1 dongle_search 
+00fd 79207e07 set1 dongle_search ,pdata 
+00fe 67e0c558 store 1 ,mem_24g_mode_init 
+00ff 6fe0c566 fetch 1 ,mem_tx_power_temp 
+0100 67e0c116 store 1 ,mem_tx_power 
+0101 20204b0b branch g24_search_mode_init + 4 
 
 p_g24_receive_packet_start_next:
-00e5 6fe0c52d fetch 1 ,mem_24g_rxdata_temp + 2 
-00e6 c00080ea beq datatype_device1 ,p_g24_data_device1 
-00e7 c0014a69 beq datatype_device2 ,g24_data_device2 
-00e8 c07f80fb beq datatype_attemp ,p_g24_data_receive_attemp 
-00e9 20204a54 branch g24_rx_interrupt_clear 
+0102 6fe0c52d fetch 1 ,mem_24g_rxdata_temp + 2 
+0103 c0008107 beq datatype_device1 ,p_g24_data_device1 
+0104 c0014a69 beq datatype_device2 ,g24_data_device2 
+0105 c07f8118 beq datatype_attemp ,p_g24_data_receive_attemp 
+0106 20204a54 branch g24_rx_interrupt_clear 
 
 p_g24_data_device1:
-00ea 20404a22 call g24_binding_dvc1_living 
-00eb 20404bbd call g24_ch_timer_reinit 
-00ec 6fe0c54d fetch 1 ,mem_24g_abort_packet 
-00ed 6848c52b fetcht 1 ,mem_24g_rxdata_temp 
-00ee 284ffe03 isolate1 bit_abort ,temp 
-00ef 7920fe00 setflag true ,0 ,pdata 
-00f0 67e0c54d store 1 ,mem_24g_abort_packet 
-00f1 c00080f3 beq 1 ,p_g24_data_attemp_device1_abort 
-00f2 20204a62 branch g24_data_device1 + 8 
+0107 20404a22 call g24_binding_dvc1_living 
+0108 20404bbd call g24_ch_timer_reinit 
+0109 6fe0c54d fetch 1 ,mem_24g_abort_packet 
+010a 6848c52b fetcht 1 ,mem_24g_rxdata_temp 
+010b 284ffe03 isolate1 bit_abort ,temp 
+010c 7920fe00 setflag true ,0 ,pdata 
+010d 67e0c54d store 1 ,mem_24g_abort_packet 
+010e c0008110 beq 1 ,p_g24_data_attemp_device1_abort 
+010f 20204a62 branch g24_data_device1 + 8 
 
 p_g24_data_attemp_device1_abort:
-00f3 6fe0c095 fetch 1 ,mem_device_option 
-00f4 1fe67c0e sub pdata ,dvc_op_car ,null 
-00f5 2042cf01 call car_stop_blink ,zero 
-00f6 6fe0c5d7 fetch 1 ,mem_24g_device1_bind_disable 
-00f7 247a0000 nrtn blank 
-00f8 7045d701 jam 1 ,mem_24g_device1_bind_disable 
-00f9 6fe24535 fetch 4 ,mem_24g_rxdata_temp + 10 
-00fa 20204c26 branch g24_store_device1_addr 
+0110 6fe0c095 fetch 1 ,mem_device_option 
+0111 1fe67c0e sub pdata ,dvc_op_car ,null 
+0112 2042cf01 call car_stop_blink ,zero 
+0113 6fe0c5d7 fetch 1 ,mem_24g_device1_bind_disable 
+0114 247a0000 nrtn blank 
+0115 7045d701 jam 1 ,mem_24g_device1_bind_disable 
+0116 6fe24535 fetch 4 ,mem_24g_rxdata_temp + 10 
+0117 20204c26 branch g24_store_device1_addr 
 
 p_g24_data_receive_attemp:
-00fb 20404a30 call g24_bind_device_status 
-00fc 202000d0 branch p_g24_data_attemp 
+0118 20404a30 call g24_bind_device_status 
+0119 202000ed branch p_g24_data_attemp 
               org 0x3800
 
 start:
Index: program/patch.prog
===================================================================
--- /branch/usb/usb_public_125K/program/patch.prog	(revision 330)
+++ /branch/usb/usb_public_125K/program/patch.prog	(working copy)
@@ -7,6 +7,7 @@
 	beq patch02_7,p_set_tx_power_8db
 	beq patch06_6,p_dongle_usb_dispatch
 	beq patch17_1,p_usb_init
+	beq patch18_1,p_usb_tx
 	beq patch1a_5,p_le_enable_phy_by_pdata
 	branch assert
 
@@ -112,6 +113,39 @@
 	store 6,mem_string1
 	rtn
 
+p_usb_tx:
+	fetch 1,mem_usb_tx_enable
+	rtn blank
+	fetch 1,core_usb_txbusy
+	and_into 0x0f,pdata
+	nbranch usb_inwake_state_tx_dispose,blank
+	fetch 1,mem_usb_device_enumeration_endflag
+	branch usb_tx_fifo_release,blank
+	fetch 1,mem_usb_state
+	beq USB_SLEEP,usb_windows_wakeup
+	bne USB_CONNECTED,usb_tx_fifo_release
+	fetch 1,mem_usb_clear_remote_wakeup
+	nbranch usb_tx_fifo_release,blank
+	call p_usb_tx_data_ep1
+	branch usb_tx_data_ep2
+
+p_usb_tx_data_ep1:
+	fetch 1,core_usb_txbusy
+	rtnbit1 1
+	fetch 1,mem_usb_tx_enable
+	rtnbit0 1
+	fetch 1,mem_usb_tx_enable
+	set0 1,pdata
+	store 1,mem_usb_tx_enable
+	fetch 1,mem_usb_ep1_data
+	rtn blank
+	beq USB_EP1_KB,p_usb_tx_kb_normal_data
+	branch assert
+
+p_usb_tx_kb_normal_data:
+	setarg 0
+	store 4,mem_usb_kb_data+4
+	branch usb_tx_kb_normal_data
 
 p_le_enable_phy_by_pdata:
 	copy temp,pdata
