Index: output/eeprom.dat
===================================================================
--- /1306ac/branch/dongle/usb_1M_YJX/output/eeprom.dat	(revision 983)
+++ /1306ac/branch/dongle/usb_1M_YJX/output/eeprom.dat	(working copy)
@@ -2,7 +2,7 @@
 02
 aa
 55
-16
+7e
 03
 c2
 84
@@ -35,15 +35,15 @@
 c0
 61
 00
-64
+7e
 c0
 61
 80
-3c
+54
 c0
 64
 00
-4c
+66
 20
 20
 3a
@@ -55,15 +55,15 @@
 c0
 23
 80
-a0
+ba
 c0
 24
 80
-a6
+c0
 c0
 26
 80
-83
+9d
 c0
 27
 80
@@ -71,7 +71,7 @@
 c0
 28
 00
-78
+92
 20
 20
 3a
@@ -244,6 +244,110 @@
 20
 39
 ef
+6f
+e0
+c4
+d4
+c0
+00
+80
+3f
+c0
+01
+00
+42
+6f
+e0
+c5
+dd
+c2
+80
+51
+9d
+20
+20
+00
+44
+6f
+e0
+c5
+dd
+c2
+80
+d1
+a1
+6f
+e0
+c5
+5c
+c0
+00
+80
+48
+c0
+01
+80
+50
+20
+60
+00
+00
+70
+45
+5c
+01
+6f
+e0
+c5
+61
+c1
+80
+80
+00
+6f
+e0
+c5
+5b
+24
+7a
+00
+00
+20
+40
+49
+fd
+24
+77
+80
+00
+20
+20
+49
+83
+6f
+e0
+c4
+44
+c0
+00
+80
+48
+c0
+7f
+80
+48
+20
+20
+51
+af
+58
+00
+00
+3c
+67
+e1
+45
+2d
 20
 40
 6e
@@ -315,7 +419,7 @@
 c0
 01
 80
-4f
+69
 20
 20
 71
@@ -343,7 +447,7 @@
 c0
 00
 00
-56
+70
 20
 20
 72
@@ -427,7 +531,7 @@
 20
 40
 80
-72
+8c
 6f
 f0
 8c
@@ -465,13 +569,13 @@
 87
 97
 c0
-3a
+47
 80
 34
 20
 20
 00
-5f
+79
 6f
 e0
 87
@@ -483,7 +587,7 @@
 20
 20
 00
-5f
+79
 6f
 e0
 c5
@@ -495,7 +599,7 @@
 20
 40
 00
-7c
+96
 20
 20
 4b
@@ -663,7 +767,7 @@
 c0
 7f
 80
-bb
+d5
 20
 60
 00
@@ -675,7 +779,7 @@
 c0
 00
 80
-ab
+c5
 c0
 01
 4a
@@ -683,7 +787,7 @@
 c0
 7f
 80
-b9
+d3
 20
 20
 4a
@@ -719,7 +823,7 @@
 c0
 00
 80
-b4
+ce
 20
 20
 4a
@@ -751,7 +855,7 @@
 20
 20
 00
-bb
+d5
 6f
 e0
 c5
@@ -759,11 +863,11 @@
 c0
 00
 80
-bf
+d9
 c0
 01
 00
-c2
+dc
 20
 60
 00
@@ -792,8 +896,8 @@
 20
 4c
 16
-0e
-2d
+52
+f0
 aa
 55
 40
@@ -1097,5 +1201,5 @@
 55
 88
 46
-49
-9d
+d4
+c8
Index: output/program.lis
===================================================================
--- /1306ac/branch/dongle/usb_1M_YJX/output/program.lis	(revision 922)
+++ /1306ac/branch/dongle/usb_1M_YJX/output/program.lis	(working copy)
@@ -7,18 +7,18 @@
 0004 c017802d beq patch05_7 ,p_dongle_default_init 
 0005 c018001e beq patch06_0 ,p_dongle_read_kb_bind_status 
 0006 c018801a beq patch06_1 ,p_dongle_write_kb_bind_status 
-0007 c0610064 beq patch18_2 ,p_usb_isr 
-0008 c061803c beq patch18_3 ,p_usb_init 
-0009 c064004c beq patch19_0 ,p_usb_out_standard_req 
+0007 c061007e beq patch18_2 ,p_usb_isr 
+0008 c0618054 beq patch18_3 ,p_usb_init 
+0009 c0640066 beq patch19_0 ,p_usb_out_standard_req 
 000a 20203a8a branch assert 
 
 pf_patch_ext:
 000b c17f8000 rtneq patch3f_7 
-000c c02380a0 beq patch28_7 ,p_g24_bind_data_parse_next 
-000d c02480a6 beq patch29_1 ,p_g24_receive_packet_start_next 
-000e c0268083 beq patch29_5 ,p_g24_mode_switch_bind_search 
+000c c02380ba beq patch28_7 ,p_g24_bind_data_parse_next 
+000d c02480c0 beq patch29_1 ,p_g24_receive_packet_start_next 
+000e c026809d beq patch29_5 ,p_g24_mode_switch_bind_search 
 000f c0278022 beq patch29_7 ,p_g24_bind_mode_auto 
-0010 c0280078 beq patch2a_0 ,p_g24_search_mode_auto 
+0010 c0280092 beq patch2a_0 ,p_g24_search_mode_auto 
 0011 20203a8a branch assert 
 
 p_initialize_radio_cont:
@@ -83,180 +83,218 @@
 003a 708a3a00 jam 0x00 ,core_tx_pwr_ctrl1 
 003b 202039ef branch set_rf_ldo_cfg89 
 
+p_dongle_ackpayload_prep:
+003c 6fe0c4d4 fetch 1 ,mem_24g_data_type 
+003d c000803f beq datatype_device1 ,p_dongle_ackpayload_prep_mouse 
+003e c0010042 beq datatype_device2 ,p_dongle_ackpayload_prep_keyboard 
+
+p_dongle_ackpayload_prep_mouse:
+003f 6fe0c5dd fetch 1 ,mem_dg_pc_sleep_flag 
+0040 c280519d bbit1 0 ,dongle_pc_sleep_ackpayload_prep_mouse 
+0041 20200044 branch p_dongle_ackpayload_prep_end 
+
+p_dongle_ackpayload_prep_keyboard:
+0042 6fe0c5dd fetch 1 ,mem_dg_pc_sleep_flag 
+0043 c280d1a1 bbit1 1 ,dongle_pc_sleep_ackpayload_prep_keyboard 
+
+p_dongle_ackpayload_prep_end:
+0044 6fe0c55c fetch 1 ,mem_24g_ackpayload_enable 
+0045 c0008048 beq bind_ackpayload ,p_dongle_g24_bind_ackpayload_prep 
+0046 c0018050 beq kb_led_ackpayload ,p_dongle_g24_kb_led_ackpayload_prep 
+0047 20600000 rtn 
+
+p_dongle_g24_bind_ackpayload_prep:
+0048 70455c01 jam 1 ,mem_24g_ackpayload_enable 
+0049 6fe0c561 fetch 1 ,mem_24g_work_mode 
+004a c1808000 rtnne dongle_bind 
+004b 6fe0c55b fetch 1 ,mem_24g_pair_mode 
+004c 247a0000 nrtn blank 
+004d 204049fd call g24_binding_device_check + 4 
+004e 24778000 nrtn user3 
+004f 20204983 branch g24_bind_ackpayload_prep 
+
+p_dongle_g24_kb_led_ackpayload_prep:
+0050 6fe0c444 fetch 1 ,mem_24g_rxbuf + 2 
+0051 c0008048 beq datatype_device1 ,p_dongle_g24_bind_ackpayload_prep 
+0052 c07f8048 beq datatype_attemp ,p_dongle_g24_bind_ackpayload_prep 
+0053 202051af branch dongle_g24_kb_led_ackpayload_prep + 3 
+
 p_usb_init:
-003c 20406eb3 call enable_authrom 
-003d 20407056 call usb_init_param 
-003e 708c0000 jam 0x00 ,core_usb_config 
-003f 20002710 nop 10000 
-0040 708c1800 jam 0x00 ,core_usb_trig 
-0041 6ff10050 fetch 2 ,core_clkoff 
-0042 793ffe0a set0 clock_off_usb ,pdata 
-0043 67f10050 store 2 ,core_clkoff 
-0044 708c1100 jam 0x00 ,core_usb_hmode 
-0045 708c003c jam 0x3c ,core_usb_config 
-0046 58000d00 setarg mem_usb_rxbuf_new 
-0047 67f10c03 store 2 ,core_usb_rx_saddr 
-0048 67f10c07 store 2 ,core_usb_rxptr 
-0049 58000d44 setarg mem_usb_rxbuf_new_end 
-004a 67f10c05 store 2 ,core_usb_rx_eaddr 
-004b 2020704f branch usb_init + 16 
+0054 5800003c setarg p_dongle_ackpayload_prep 
+0055 67e1452d store 2 ,mem_cb_24g_ackpayload 
+0056 20406eb3 call enable_authrom 
+0057 20407056 call usb_init_param 
+0058 708c0000 jam 0x00 ,core_usb_config 
+0059 20002710 nop 10000 
+005a 708c1800 jam 0x00 ,core_usb_trig 
+005b 6ff10050 fetch 2 ,core_clkoff 
+005c 793ffe0a set0 clock_off_usb ,pdata 
+005d 67f10050 store 2 ,core_clkoff 
+005e 708c1100 jam 0x00 ,core_usb_hmode 
+005f 708c003c jam 0x3c ,core_usb_config 
+0060 58000d00 setarg mem_usb_rxbuf_new 
+0061 67f10c03 store 2 ,core_usb_rx_saddr 
+0062 67f10c07 store 2 ,core_usb_rxptr 
+0063 58000d44 setarg mem_usb_rxbuf_new_end 
+0064 67f10c05 store 2 ,core_usb_rx_eaddr 
+0065 2020704f branch usb_init + 16 
 
 p_usb_out_standard_req:
-004c 6fe0870c fetch 1 ,mem_usb_setup_brequest 
-004d c001804f beq set_feature ,p_usb0_request_set_feature 
-004e 20207102 branch usb_out_standard_req + 1 
+0066 6fe0870c fetch 1 ,mem_usb_setup_brequest 
+0067 c0018069 beq set_feature ,p_usb0_request_set_feature 
+0068 20207102 branch usb_out_standard_req + 1 
 
 p_usb0_request_set_feature:
-004f 6fe08711 fetch 1 ,mem_usb_setup_blength 
-0050 c0807111 bne 0 ,usb0_force_stall 
-0051 6fe08712 fetch 1 ,mem_usb_setup_blengthh 
-0052 c0807111 bne 0 ,usb0_force_stall 
-0053 6fe0870b fetch 1 ,mem_usb_setup_bmrequesttype 
-0054 c0000056 beq out_device ,p_usb0_request_set_feature_out_device 
-0055 2020721e branch usb0_request_set_feature + 6 
+0069 6fe08711 fetch 1 ,mem_usb_setup_blength 
+006a c0807111 bne 0 ,usb0_force_stall 
+006b 6fe08712 fetch 1 ,mem_usb_setup_blengthh 
+006c c0807111 bne 0 ,usb0_force_stall 
+006d 6fe0870b fetch 1 ,mem_usb_setup_bmrequesttype 
+006e c0000070 beq out_device ,p_usb0_request_set_feature_out_device 
+006f 2020721e branch usb0_request_set_feature + 6 
 
 p_usb0_request_set_feature_out_device:
-0056 6fe0870d fetch 1 ,mem_usb_setup_bvalue 
-0057 c080f111 bne device_remote_wakeup ,usb0_force_stall 
-0058 20405191 call dongle_set_pc_sleep_flag 
-0059 6ff08c00 fetch 1 ,core_usb_config 
-005a 79207e07 set1 7 ,pdata 
-005b 67f08c00 store 1 ,core_usb_config 
-005c 70079f01 jam 1 ,mem_usb_remote_wakeup 
-005d 70079700 jam 0 ,mem_usb_tx_win_enable 
-005e 20207116 branch usb0_reply_zerolen 
+0070 6fe0870d fetch 1 ,mem_usb_setup_bvalue 
+0071 c080f111 bne device_remote_wakeup ,usb0_force_stall 
+0072 20405191 call dongle_set_pc_sleep_flag 
+0073 6ff08c00 fetch 1 ,core_usb_config 
+0074 79207e07 set1 7 ,pdata 
+0075 67f08c00 store 1 ,core_usb_config 
+0076 70079f01 jam 1 ,mem_usb_remote_wakeup 
+0077 70079700 jam 0 ,mem_usb_tx_win_enable 
+0078 20207116 branch usb0_reply_zerolen 
 
 p_usb_wakeup_timer_reinit:
-005f 70079e03 jam usb_sleep ,mem_usb_state 
-0060 2040742d call timer_reinit 
-0061 58001388 setarg timer_wakeup_delay 
-0062 d8e0000f arg usb_timer_wakeup ,queue 
-0063 20207420 branch timer_init 
+0079 70079e03 jam usb_sleep ,mem_usb_state 
+007a 2040742d call timer_reinit 
+007b 58001388 setarg timer_wakeup_delay 
+007c d8e0000f arg usb_timer_wakeup ,queue 
+007d 20207420 branch timer_init 
 
 p_usb_isr:
-0064 6ff08c23 fetch 1 ,core_usb_status 
-0065 2feffe03 isolate1 usb_status_reset ,pdata 
-0066 2040f03f call usb_init ,true 
-0067 6ff08c23 fetch 1 ,core_usb_status 
-0068 2feffe01 isolate1 usb_status_suspend ,pdata 
-0069 20408072 call p_usb_set_suspend ,true 
-006a 6ff08c23 fetch 1 ,core_usb_status 
-006b 67f08c23 store 1 ,core_usb_status 
-006c 67e0855e store 1 ,mem_usb_status 
-006d 2040709a call usb_nak_state_judge 
-006e 204070c1 call usb_rx 
-006f 204072d2 call usb0_tx 
-0070 2040731a call usb_tx 
-0071 20207092 branch usb_nak_state 
+007e 6ff08c23 fetch 1 ,core_usb_status 
+007f 2feffe03 isolate1 usb_status_reset ,pdata 
+0080 2040f03f call usb_init ,true 
+0081 6ff08c23 fetch 1 ,core_usb_status 
+0082 2feffe01 isolate1 usb_status_suspend ,pdata 
+0083 2040808c call p_usb_set_suspend ,true 
+0084 6ff08c23 fetch 1 ,core_usb_status 
+0085 67f08c23 store 1 ,core_usb_status 
+0086 67e0855e store 1 ,mem_usb_status 
+0087 2040709a call usb_nak_state_judge 
+0088 204070c1 call usb_rx 
+0089 204072d2 call usb0_tx 
+008a 2040731a call usb_tx 
+008b 20207092 branch usb_nak_state 
 
 p_usb_set_suspend:
-0072 6fe08797 fetch 1 ,mem_usb_tx_win_enable 
-0073 c03a8034 beq p_usb_set_suspend_win ,blank 
-0074 2020005f branch p_usb_wakeup_timer_reinit 
+008c 6fe08797 fetch 1 ,mem_usb_tx_win_enable 
+008d c0478034 beq p_usb_set_suspend_win ,blank 
+008e 20200079 branch p_usb_wakeup_timer_reinit 
 
 p_usb_set_suspend_win:
-0075 6fe0879f fetch 1 ,mem_usb_remote_wakeup 
-0076 207a0000 rtn blank 
-0077 2020005f branch p_usb_wakeup_timer_reinit 
+008f 6fe0879f fetch 1 ,mem_usb_remote_wakeup 
+0090 207a0000 rtn blank 
+0091 20200079 branch p_usb_wakeup_timer_reinit 
 
 p_g24_search_mode_auto:
-0078 6fe0c561 fetch 1 ,mem_24g_work_mode 
-0079 c1838000 rtnne dongle_search 
-007a 2040007c call p_g24_search_mode_init 
-007b 20204b00 branch g24_search_mode_auto + 4 
+0092 6fe0c561 fetch 1 ,mem_24g_work_mode 
+0093 c1838000 rtnne dongle_search 
+0094 20400096 call p_g24_search_mode_init 
+0095 20204b00 branch g24_search_mode_auto + 4 
 
 p_g24_search_mode_init:
-007c 6fe0c560 fetch 1 ,mem_24g_mode_init 
-007d c3838000 rtnbit1 dongle_search 
-007e 79207e07 set1 dongle_search ,pdata 
-007f 67e0c560 store 1 ,mem_24g_mode_init 
-0080 6fe0c56e fetch 1 ,mem_tx_power_temp 
-0081 67e0c116 store 1 ,mem_tx_power 
-0082 20204af0 branch g24_search_mode_init + 4 
+0096 6fe0c560 fetch 1 ,mem_24g_mode_init 
+0097 c3838000 rtnbit1 dongle_search 
+0098 79207e07 set1 dongle_search ,pdata 
+0099 67e0c560 store 1 ,mem_24g_mode_init 
+009a 6fe0c56e fetch 1 ,mem_tx_power_temp 
+009b 67e0c116 store 1 ,mem_tx_power 
+009c 20204af0 branch g24_search_mode_init + 4 
 
 p_g24_mode_switch_bind_search:
-0083 6fe0c561 fetch 1 ,mem_24g_work_mode 
-0084 c1000000 rtneq dongle_work 
-0085 6fe0c575 fetch 1 ,mem_24g_b_s_mode_switch_disable 
-0086 247a0000 nrtn blank 
-0087 6fe0c573 fetch 1 ,mem_24g_mode_b_s_switch_exit 
-0088 247a0000 nrtn blank 
-0089 6fe0c56f fetch 1 ,mem_24g_mode_b_s_switch 
-008a 207a0000 rtn blank 
-008b 6fe0c51e fetch 1 ,mem_24g_device1_bind_step 
-008c c1800000 rtnne 0 
-008d 6fe0c51f fetch 1 ,mem_24g_device2_bind_step 
-008e c1800000 rtnne 0 
-008f 6fe0c576 fetch 1 ,mem_24g_bind_device_living 
-0090 2fe00603 compare 3 ,pdata ,3 
-0091 2020cac1 branch g24_mode_b_s_switch_exit ,true 
-0092 204048be call g24_timer_check 
-0093 24740000 nrtn user 
-0094 6fe14571 fetch 2 ,mem_24g_mode_b_s_switch_cnt 
-0095 1fe0fe01 increase 1 ,pdata 
-0096 67e14571 store 2 ,mem_24g_mode_b_s_switch_cnt 
-0097 d84007d0 arg 0x7d0 ,temp 
-0098 98467c00 isub temp ,null 
-0099 20214ac1 branch g24_mode_b_s_switch_exit ,positive 
-009a 6fe0c574 fetch 1 ,mem_24g_b_s_time_slice 
-009b 1fe0fe01 increase 1 ,pdata 
-009c 1fe17e01 and_into 1 ,pdata 
-009d 67e0c574 store 1 ,mem_24g_b_s_time_slice 
-009e c0004b88 beq 0 ,g24_search_mode_enable 
-009f 20204abc branch g24_mode_switch_bind_search_next + 1 
+009d 6fe0c561 fetch 1 ,mem_24g_work_mode 
+009e c1000000 rtneq dongle_work 
+009f 6fe0c575 fetch 1 ,mem_24g_b_s_mode_switch_disable 
+00a0 247a0000 nrtn blank 
+00a1 6fe0c573 fetch 1 ,mem_24g_mode_b_s_switch_exit 
+00a2 247a0000 nrtn blank 
+00a3 6fe0c56f fetch 1 ,mem_24g_mode_b_s_switch 
+00a4 207a0000 rtn blank 
+00a5 6fe0c51e fetch 1 ,mem_24g_device1_bind_step 
+00a6 c1800000 rtnne 0 
+00a7 6fe0c51f fetch 1 ,mem_24g_device2_bind_step 
+00a8 c1800000 rtnne 0 
+00a9 6fe0c576 fetch 1 ,mem_24g_bind_device_living 
+00aa 2fe00603 compare 3 ,pdata ,3 
+00ab 2020cac1 branch g24_mode_b_s_switch_exit ,true 
+00ac 204048be call g24_timer_check 
+00ad 24740000 nrtn user 
+00ae 6fe14571 fetch 2 ,mem_24g_mode_b_s_switch_cnt 
+00af 1fe0fe01 increase 1 ,pdata 
+00b0 67e14571 store 2 ,mem_24g_mode_b_s_switch_cnt 
+00b1 d84007d0 arg 0x7d0 ,temp 
+00b2 98467c00 isub temp ,null 
+00b3 20214ac1 branch g24_mode_b_s_switch_exit ,positive 
+00b4 6fe0c574 fetch 1 ,mem_24g_b_s_time_slice 
+00b5 1fe0fe01 increase 1 ,pdata 
+00b6 1fe17e01 and_into 1 ,pdata 
+00b7 67e0c574 store 1 ,mem_24g_b_s_time_slice 
+00b8 c0004b88 beq 0 ,g24_search_mode_enable 
+00b9 20204abc branch g24_mode_switch_bind_search_next + 1 
 
 p_g24_bind_data_parse_next:
-00a0 6fe0c535 fetch 1 ,mem_24g_rxdata_temp + 2 
-00a1 c05549a2 beq datatype_bind ,g24_bind_first_step 
-00a2 c02ac9b3 beq datatype_config ,g24_bind_second_step 
-00a3 c01149d4 beq datatype_ok ,g24_bind_third_step 
-00a4 c07f80bb beq datatype_attemp ,p_g24_data_attemp 
-00a5 20600000 rtn 
+00ba 6fe0c535 fetch 1 ,mem_24g_rxdata_temp + 2 
+00bb c05549a2 beq datatype_bind ,g24_bind_first_step 
+00bc c02ac9b3 beq datatype_config ,g24_bind_second_step 
+00bd c01149d4 beq datatype_ok ,g24_bind_third_step 
+00be c07f80d5 beq datatype_attemp ,p_g24_data_attemp 
+00bf 20600000 rtn 
 
 p_g24_receive_packet_start_next:
-00a6 6fe0c535 fetch 1 ,mem_24g_rxdata_temp + 2 
-00a7 c00080ab beq datatype_device1 ,p_g24_data_device1 
-00a8 c0014a4e beq datatype_device2 ,g24_data_device2 
-00a9 c07f80b9 beq datatype_attemp ,p_g24_data_receive_attemp 
-00aa 20204a39 branch g24_rx_interrupt_clear 
+00c0 6fe0c535 fetch 1 ,mem_24g_rxdata_temp + 2 
+00c1 c00080c5 beq datatype_device1 ,p_g24_data_device1 
+00c2 c0014a4e beq datatype_device2 ,g24_data_device2 
+00c3 c07f80d3 beq datatype_attemp ,p_g24_data_receive_attemp 
+00c4 20204a39 branch g24_rx_interrupt_clear 
 
 p_g24_data_device1:
-00ab 20404a08 call g24_binding_dvc1_living 
-00ac 20404ba2 call g24_ch_timer_reinit 
-00ad 6fe0c555 fetch 1 ,mem_24g_abort_packet 
-00ae 6848c533 fetcht 1 ,mem_24g_rxdata_temp 
-00af 284ffe03 isolate1 bit_abort ,temp 
-00b0 7920fe00 setflag true ,0 ,pdata 
-00b1 67e0c555 store 1 ,mem_24g_abort_packet 
-00b2 c00080b4 beq 1 ,p_g24_data_attemp_device1_abort 
-00b3 20204a47 branch g24_data_device1 + 8 
+00c5 20404a08 call g24_binding_dvc1_living 
+00c6 20404ba2 call g24_ch_timer_reinit 
+00c7 6fe0c555 fetch 1 ,mem_24g_abort_packet 
+00c8 6848c533 fetcht 1 ,mem_24g_rxdata_temp 
+00c9 284ffe03 isolate1 bit_abort ,temp 
+00ca 7920fe00 setflag true ,0 ,pdata 
+00cb 67e0c555 store 1 ,mem_24g_abort_packet 
+00cc c00080ce beq 1 ,p_g24_data_attemp_device1_abort 
+00cd 20204a47 branch g24_data_device1 + 8 
 
 p_g24_data_attemp_device1_abort:
-00b4 6fe0c529 fetch 1 ,mem_24g_device1_bind_disable 
-00b5 247a0000 nrtn blank 
-00b6 70452901 jam 1 ,mem_24g_device1_bind_disable 
-00b7 6fe2453d fetch 4 ,mem_24g_rxdata_temp + 10 
-00b8 20204c14 branch g24_store_device1_addr 
+00ce 6fe0c529 fetch 1 ,mem_24g_device1_bind_disable 
+00cf 247a0000 nrtn blank 
+00d0 70452901 jam 1 ,mem_24g_device1_bind_disable 
+00d1 6fe2453d fetch 4 ,mem_24g_rxdata_temp + 10 
+00d2 20204c14 branch g24_store_device1_addr 
 
 p_g24_data_receive_attemp:
-00b9 20404a16 call g24_bind_device_status 
-00ba 202000bb branch p_g24_data_attemp 
+00d3 20404a16 call g24_bind_device_status 
+00d4 202000d5 branch p_g24_data_attemp 
 
 p_g24_data_attemp:
-00bb 6fe0c536 fetch 1 ,mem_24g_rxdata_temp + 3 
-00bc c00080bf beq datatype_device1 ,p_g24_data_attemp_device1 
-00bd c00100c2 beq datatype_device2 ,p_g24_data_attemp_device2 
-00be 20600000 rtn 
+00d5 6fe0c536 fetch 1 ,mem_24g_rxdata_temp + 3 
+00d6 c00080d9 beq datatype_device1 ,p_g24_data_attemp_device1 
+00d7 c00100dc beq datatype_device2 ,p_g24_data_attemp_device2 
+00d8 20600000 rtn 
 
 p_g24_data_attemp_device1:
-00bf 6fe0c529 fetch 1 ,mem_24g_device1_bind_disable 
-00c0 247a0000 nrtn blank 
-00c1 20204c12 branch g24_data_attemp_device1 
+00d9 6fe0c529 fetch 1 ,mem_24g_device1_bind_disable 
+00da 247a0000 nrtn blank 
+00db 20204c12 branch g24_data_attemp_device1 
 
 p_g24_data_attemp_device2:
-00c2 6fe0c52a fetch 1 ,mem_24g_device2_bind_disable 
-00c3 247a0000 nrtn blank 
-00c4 20204c16 branch g24_data_attemp_device2 
+00dc 6fe0c52a fetch 1 ,mem_24g_device2_bind_disable 
+00dd 247a0000 nrtn blank 
+00de 20204c16 branch g24_data_attemp_device2 
               org 0x3800
 
 start:
Index: program/patch.prog
===================================================================
--- /1306ac/branch/dongle/usb_1M_YJX/program/patch.prog	(revision 922)
+++ /1306ac/branch/dongle/usb_1M_YJX/program/patch.prog	(working copy)
@@ -89,8 +89,41 @@
 	jam ON,mem_24g_disable_fec1
 	branch g24_enable_2M
 */	
+p_dongle_ackpayload_prep:
+	fetch 1,mem_24g_data_type
+	beq DATATYPE_DEVICE1,p_dongle_ackpayload_prep_mouse
+	beq DATATYPE_DEVICE2,p_dongle_ackpayload_prep_keyboard
+p_dongle_ackpayload_prep_mouse:
+	fetch 1,mem_dg_pc_sleep_flag
+	bbit1 0,dongle_pc_sleep_ackpayload_prep_mouse
+	branch p_dongle_ackpayload_prep_end
+p_dongle_ackpayload_prep_keyboard:
+	fetch 1,mem_dg_pc_sleep_flag
+	bbit1 1,dongle_pc_sleep_ackpayload_prep_keyboard
+p_dongle_ackpayload_prep_end:
+	fetch 1,mem_24g_ackpayload_enable
+	beq BIND_ACKPAYLOAD,p_dongle_g24_bind_ackpayload_prep
+	beq KB_LED_ACKPAYLOAD,p_dongle_g24_kb_led_ackpayload_prep
+	rtn
+p_dongle_g24_bind_ackpayload_prep:
+	jam 1,mem_24g_ackpayload_enable
+	fetch 1,mem_24g_work_mode
+	rtnne DONGLE_BIND
+	fetch 1,mem_24g_pair_mode	
+	nrtn blank	
+	call g24_binding_device_check+4	//works on auto pair only
+	nrtn user3
+	branch g24_bind_ackpayload_prep
+p_dongle_g24_kb_led_ackpayload_prep:
+	fetch 1,mem_24g_rxbuf+2
+	beq DATATYPE_DEVICE1,p_dongle_g24_bind_ackpayload_prep
+	beq DATATYPE_ATTEMP,p_dongle_g24_bind_ackpayload_prep
+	branch dongle_g24_kb_led_ackpayload_prep+3
 
+	
 p_usb_init:
+	setarg p_dongle_ackpayload_prep
+	store 2,mem_cb_24g_ackpayload
 	call enable_authrom
 	call usb_init_param
 	jam 0x00,core_usb_config
