Index: output/eeprom.dat
===================================================================
--- /branch/usb/dongle/output/eeprom.dat	(revision 214)
+++ /branch/usb/dongle/output/eeprom.dat	(working copy)
@@ -2,8 +2,8 @@
 02
 aa
 55
-ce
-0d
+12
+0e
 c2
 84
 00
@@ -99,7 +99,7 @@
 c0
 73
 83
-68
+66
 20
 20
 13
@@ -1726,8 +1726,8 @@
 b8
 d8
 40
-6e
-28
+69
+78
 c5
 13
 81
@@ -2367,11 +2367,11 @@
 c0
 00
 83
-5c
+5a
 c0
 01
 03
-62
+60
 20
 60
 00
@@ -2751,7 +2751,7 @@
 58
 00
 03
-41
+3f
 67
 e1
 48
@@ -3163,7 +3163,7 @@
 20
 40
 03
-24
+22
 20
 40
 35
@@ -3179,14 +3179,6 @@
 6f
 e0
 c8
-c3
-c1
-01
-00
-00
-6f
-e0
-c8
 c7
 20
 7a
@@ -3299,15 +3291,15 @@
 c0
 00
 83
-3b
+39
 c0
 01
 03
-3d
+3b
 c0
 7f
 83
-3f
+3d
 20
 20
 2c
@@ -3315,7 +3307,7 @@
 20
 40
 03
-5c
+5a
 20
 20
 2c
@@ -3323,7 +3315,7 @@
 20
 40
 03
-62
+60
 20
 20
 2c
@@ -3343,11 +3335,11 @@
 c0
 00
 83
-45
+43
 c0
 01
 83
-49
+47
 20
 60
 00
@@ -3359,7 +3351,7 @@
 20
 40
 03
-4d
+4b
 24
 77
 80
@@ -3375,11 +3367,11 @@
 c0
 00
 83
-45
+43
 c0
 7f
 83
-45
+43
 20
 20
 35
@@ -3407,11 +3399,11 @@
 c0
 00
 83
-55
+53
 c0
 01
 03
-59
+57
 20
 60
 00
@@ -3443,7 +3435,7 @@
 20
 20
 03
-57
+55
 6f
 e0
 c8
@@ -3523,7 +3515,7 @@
 20
 42
 83
-2a
+28
 6f
 e0
 c8
@@ -3532,12 +3524,88 @@
 5a
 03
 0f
+70
+48
+c9
+00
+6f
+e0
+c8
+c8
+79
+3f
+fe
+07
+79
+20
+7e
+00
+67
+e0
+c8
+c8
+70
+48
+c3
+00
+20
+40
+2c
+c4
 20
+40
+2c
+fc
 20
+40
 2d
-59
-1f
-91
+cb
+20
+22
+ad
+6d
+70
+48
+c3
+01
+6f
+e2
+48
+3b
+68
+4a
+48
+7f
+98
+46
+7c
+00
+20
+22
+ad
+70
+6f
+e2
+48
+3b
+68
+4a
+48
+7b
+98
+46
+7c
+00
+20
+22
+ad
+72
+20
+60
+00
+00
+cb
+f1
 aa
 55
 40
@@ -3635,10 +3703,10 @@
 00
 a8
 40
-a5
-26
-10
-30
+af
+bc
+1d
+2e
 07
 2b
 aa
@@ -3671,5 +3739,19 @@
 88
 66
 44
-a3
-5d
+aa
+55
+01
+00
+8a
+44
+ff
+aa
+55
+01
+00
+8f
+47
+ff
+04
+e7
Index: output/program.lis
===================================================================
--- /branch/usb/dongle/output/program.lis	(revision 214)
+++ /branch/usb/dongle/output/program.lis	(working copy)
@@ -25,7 +25,7 @@
 0014 c0710216 beq patch3c_2 ,p_g24_transmit 
 0015 c07282e8 beq patch3c_5 ,p_g24_mode_switch 
 0016 c0730230 beq patch3c_6 ,p_g24_bind_mode_auto 
-0017 c0738368 beq patch3c_7 ,p_g24_search_mode_auto 
+0017 c0738366 beq patch3c_7 ,p_g24_search_mode_auto 
 0018 20201321 branch loop 
 
 p_app_init:
@@ -532,7 +532,7 @@
 01ad 20201eb8 branch le_enable 
 
 p_g24_rx_window_init:
-01ae d8406e28 arg 0x6e28 ,temp 
+01ae d8406978 arg 0x6978 ,temp 
 01af c51381b4 bmark1 mark_24g_rxmode ,p_g24_rx_window_store 
 01b0 d84012c0 arg 0x12c0 ,temp 
 01b1 6fe0c863 fetch 1 ,mem_24g_rx_phy 
@@ -738,8 +738,8 @@
 
 p_g24_bind_device_status:
 024d 6fe0c89e fetch 1 ,mem_24g_rxdata_temp + 3 
-024e c000835c beq datatype_device1 ,p_g24_binding_dvc1_living 
-024f c0010362 beq datatype_device2 ,p_g24_binding_dvc2_living 
+024e c000835a beq datatype_device1 ,p_g24_binding_dvc1_living 
+024f c0010360 beq datatype_device2 ,p_g24_binding_dvc2_living 
 0250 20600000 rtn 
 
 p_g24_bind_third_step_skip:
@@ -860,7 +860,7 @@
 02ab 67e14897 store 2 ,mem_cb_24g_data_device1 
 02ac 580035a8 setarg dongle_g24_kb 
 02ad 67e14899 store 2 ,mem_cb_24g_data_device2 
-02ae 58000341 setarg p_dongle_ackpayload_prep 
+02ae 5800033f setarg p_dongle_ackpayload_prep 
 02af 67e14895 store 2 ,mem_cb_24g_ackpayload 
 02b0 580002ca setarg p_dongle_usb_config 
 02b1 67e10b45 store 2 ,mem_cb_usb_config 
@@ -999,134 +999,151 @@
 p_dongle_work_mode_auto:
 0313 6fe0c8c9 fetch 1 ,mem_24g_work_mode 
 0314 c1800000 rtnne dongle_work 
-0315 20400324 call p_g24_work_mode_start 
+0315 20400322 call p_g24_work_mode_start 
 0316 20403518 call dongle_g24_blank_data_process 
 0317 6fe0c8c5 fetch 1 ,mem_24g_pair_mode 
 0318 247a0000 nrtn blank 
 
 p_g24_nodata_process:
-0319 6fe0c8c3 fetch 1 ,mem_24g_ackpayload_enable 
-031a c1010000 rtneq 2 
-031b 6fe0c8c7 fetch 1 ,mem_24g_nodata_timer_enable 
-031c 207a0000 rtn blank 
-031d d8e00008 arg timer_nodata ,queue 
-031e 20407d82 call timer_check 
-031f 247a0000 nrtn blank 
-0320 7048c700 jam 0 ,mem_24g_nodata_timer_enable 
-0321 7048d500 jam 0 ,mem_24g_bind_mode_continue 
-0322 204002ea call p_g24_mode_switch_init_2 
-0323 20202dd8 branch g24_search_mode_enable 
+0319 6fe0c8c7 fetch 1 ,mem_24g_nodata_timer_enable 
+031a 207a0000 rtn blank 
+031b d8e00008 arg timer_nodata ,queue 
+031c 20407d82 call timer_check 
+031d 247a0000 nrtn blank 
+031e 7048c700 jam 0 ,mem_24g_nodata_timer_enable 
+031f 7048d500 jam 0 ,mem_24g_bind_mode_continue 
+0320 204002ea call p_g24_mode_switch_init_2 
+0321 20202dd8 branch g24_search_mode_enable 
 
 p_g24_work_mode_start:
-0324 6fe0c8c9 fetch 1 ,mem_24g_work_mode 
-0325 c1800000 rtnne dongle_work 
-0326 20402d1c call g24_work_init 
-0327 20402ddb call g24_ch_process 
+0322 6fe0c8c9 fetch 1 ,mem_24g_work_mode 
+0323 c1800000 rtnne dongle_work 
+0324 20402d1c call g24_work_init 
+0325 20402ddb call g24_ch_process 
 
 p_g24_receive_packet_start:
-0328 20402cef call g24_receive_transmit_ack 
-0329 2437acc4 nbranch g24_rx_interrupt_clear ,user3 
+0326 20402cef call g24_receive_transmit_ack 
+0327 2437acc4 nbranch g24_rx_interrupt_clear ,user3 
 
 p_g24_receive_packet_parse:
-032a 20402ce1 call g24_receive_packet_parse_pid_crc 
-032b 24342cc4 nbranch g24_rx_interrupt_clear ,user 
-032c 6fe0c829 fetch 1 ,mem_24g_rxdata_length 
-032d 203a2cc4 branch g24_rx_interrupt_clear ,blank 
-032e 1fe0fe02 increase 2 ,pdata 
-032f 98007200 iforce loopcnt 
-0330 d8c047a3 arg mem_24g_rxbuf ,contr 
-0331 d8a0489b arg mem_24g_rxdata_temp ,contw 
-0332 20407d6d call memcpy 
-0333 7048c600 jam 0 ,mem_24g_mode_switch 
-0334 6fe0c8c5 fetch 1 ,mem_24g_pair_mode 
-0335 205a2cfc call g24_enable_nodata_timer ,blank 
-0336 6fe0c89d fetch 1 ,mem_24g_rxdata_temp + 2 
-0337 c000833b beq datatype_device1 ,p_g24_data_device1 
-0338 c001033d beq datatype_device2 ,p_g24_data_device2 
-0339 c07f833f beq datatype_attemp ,p_g24_data_attemp 
-033a 20202cc4 branch g24_rx_interrupt_clear 
+0328 20402ce1 call g24_receive_packet_parse_pid_crc 
+0329 24342cc4 nbranch g24_rx_interrupt_clear ,user 
+032a 6fe0c829 fetch 1 ,mem_24g_rxdata_length 
+032b 203a2cc4 branch g24_rx_interrupt_clear ,blank 
+032c 1fe0fe02 increase 2 ,pdata 
+032d 98007200 iforce loopcnt 
+032e d8c047a3 arg mem_24g_rxbuf ,contr 
+032f d8a0489b arg mem_24g_rxdata_temp ,contw 
+0330 20407d6d call memcpy 
+0331 7048c600 jam 0 ,mem_24g_mode_switch 
+0332 6fe0c8c5 fetch 1 ,mem_24g_pair_mode 
+0333 205a2cfc call g24_enable_nodata_timer ,blank 
+0334 6fe0c89d fetch 1 ,mem_24g_rxdata_temp + 2 
+0335 c0008339 beq datatype_device1 ,p_g24_data_device1 
+0336 c001033b beq datatype_device2 ,p_g24_data_device2 
+0337 c07f833d beq datatype_attemp ,p_g24_data_attemp 
+0338 20202cc4 branch g24_rx_interrupt_clear 
 
 p_g24_data_device1:
-033b 2040035c call p_g24_binding_dvc1_living 
-033c 20202cc7 branch g24_data_device1 
+0339 2040035a call p_g24_binding_dvc1_living 
+033a 20202cc7 branch g24_data_device1 
 
 p_g24_data_device2:
-033d 20400362 call p_g24_binding_dvc2_living 
-033e 20202cd5 branch g24_data_device2 
+033b 20400360 call p_g24_binding_dvc2_living 
+033c 20202cd5 branch g24_data_device2 
 
 p_g24_data_attemp:
-033f 2040024d call p_g24_bind_device_status 
-0340 20202e52 branch g24_data_attemp 
+033d 2040024d call p_g24_bind_device_status 
+033e 20202e52 branch g24_data_attemp 
 
 p_dongle_ackpayload_prep:
-0341 6fe0c8c3 fetch 1 ,mem_24g_ackpayload_enable 
-0342 c0008345 beq bind_ackpayload ,p_g24_bind_ackpayload_prep 
-0343 c0018349 beq kb_led_ackpayload ,p_dongle_g24_kb_led_ackpayload_prep 
-0344 20600000 rtn 
+033f 6fe0c8c3 fetch 1 ,mem_24g_ackpayload_enable 
+0340 c0008343 beq bind_ackpayload ,p_g24_bind_ackpayload_prep 
+0341 c0018347 beq kb_led_ackpayload ,p_dongle_g24_kb_led_ackpayload_prep 
+0342 20600000 rtn 
 
 p_g24_bind_ackpayload_prep:
-0345 7048c301 jam 1 ,mem_24g_ackpayload_enable 
-0346 2040034d call p_g24_binding_device_check 
-0347 24778000 nrtn user3 
-0348 20202c3c branch g24_bind_ackpayload_prep 
+0343 7048c301 jam 1 ,mem_24g_ackpayload_enable 
+0344 2040034b call p_g24_binding_device_check 
+0345 24778000 nrtn user3 
+0346 20202c3c branch g24_bind_ackpayload_prep 
 
 p_dongle_g24_kb_led_ackpayload_prep:
-0349 6fe0c7a5 fetch 1 ,mem_24g_rxbuf + 2 
-034a c0008345 beq datatype_device1 ,p_g24_bind_ackpayload_prep 
-034b c07f8345 beq datatype_attemp ,p_g24_bind_ackpayload_prep 
-034c 20203592 branch dongle_g24_kb_led_ackpayload_prep + 3 
+0347 6fe0c7a5 fetch 1 ,mem_24g_rxbuf + 2 
+0348 c0008343 beq datatype_device1 ,p_g24_bind_ackpayload_prep 
+0349 c07f8343 beq datatype_attemp ,p_g24_bind_ackpayload_prep 
+034a 20203592 branch dongle_g24_kb_led_ackpayload_prep + 3 
 
 p_g24_binding_device_check:
-034d 6fe0c8c9 fetch 1 ,mem_24g_work_mode 
-034e c1808000 rtnne dongle_bind 
-034f 6fe0c8c5 fetch 1 ,mem_24g_pair_mode 
-0350 247a0000 nrtn blank 
-0351 6fe0c7a6 fetch 1 ,mem_24g_rxbuf + 3 
-0352 c0008355 beq datatype_device1 ,p_g24_binding_dvc1_status 
-0353 c0010359 beq datatype_device2 ,p_g24_binding_dvc2_status 
-0354 20600000 rtn 
+034b 6fe0c8c9 fetch 1 ,mem_24g_work_mode 
+034c c1808000 rtnne dongle_bind 
+034d 6fe0c8c5 fetch 1 ,mem_24g_pair_mode 
+034e 247a0000 nrtn blank 
+034f 6fe0c7a6 fetch 1 ,mem_24g_rxbuf + 3 
+0350 c0008353 beq datatype_device1 ,p_g24_binding_dvc1_status 
+0351 c0010357 beq datatype_device2 ,p_g24_binding_dvc2_status 
+0352 20600000 rtn 
 
 p_g24_binding_dvc1_status:
-0355 6fe0c927 fetch 1 ,mem_24g_bind_device_living 
-0356 c4000000 rtnbit0 0 
+0353 6fe0c927 fetch 1 ,mem_24g_bind_device_living 
+0354 c4000000 rtnbit0 0 
 
 disable_user3:
-0357 7857fc00 disable user3 
-0358 20600000 rtn 
+0355 7857fc00 disable user3 
+0356 20600000 rtn 
 
 p_g24_binding_dvc2_status:
-0359 6fe0c927 fetch 1 ,mem_24g_bind_device_living 
-035a c4008000 rtnbit0 1 
-035b 20200357 branch disable_user3 
+0357 6fe0c927 fetch 1 ,mem_24g_bind_device_living 
+0358 c4008000 rtnbit0 1 
+0359 20200355 branch disable_user3 
 
 p_g24_binding_dvc1_living:
-035c 6fe0c8c5 fetch 1 ,mem_24g_pair_mode 
-035d 247a0000 nrtn blank 
-035e 6fe0c927 fetch 1 ,mem_24g_bind_device_living 
-035f 1fe1fe01 or_into 0x01 ,pdata 
-0360 67e0c927 store 1 ,mem_24g_bind_device_living 
-0361 20600000 rtn 
+035a 6fe0c8c5 fetch 1 ,mem_24g_pair_mode 
+035b 247a0000 nrtn blank 
+035c 6fe0c927 fetch 1 ,mem_24g_bind_device_living 
+035d 1fe1fe01 or_into 0x01 ,pdata 
+035e 67e0c927 store 1 ,mem_24g_bind_device_living 
+035f 20600000 rtn 
 
 p_g24_binding_dvc2_living:
-0362 6fe0c8c5 fetch 1 ,mem_24g_pair_mode 
-0363 247a0000 nrtn blank 
-0364 6fe0c927 fetch 1 ,mem_24g_bind_device_living 
-0365 1fe1fe02 or_into 0x02 ,pdata 
-0366 67e0c927 store 1 ,mem_24g_bind_device_living 
-0367 20600000 rtn 
+0360 6fe0c8c5 fetch 1 ,mem_24g_pair_mode 
+0361 247a0000 nrtn blank 
+0362 6fe0c927 fetch 1 ,mem_24g_bind_device_living 
+0363 1fe1fe02 or_into 0x02 ,pdata 
+0364 67e0c927 store 1 ,mem_24g_bind_device_living 
+0365 20600000 rtn 
 
 p_g24_search_mode_auto:
-0368 6fe0c8c9 fetch 1 ,mem_24g_work_mode 
-0369 c1838000 rtnne dongle_search 
-036a 20402d40 call g24_search_mode_init 
-036b 20402d74 call g24_auto_addr_ch_search 
-036c 20402cef call g24_receive_transmit_ack 
-036d 2437acc4 nbranch g24_rx_interrupt_clear ,user3 
-036e 20402dcb call g24_receiver_addr_check 
-036f 2042832a call p_g24_receive_packet_parse ,zero 
-0370 6fe0c8bd fetch 1 ,mem_24g_abort_packet 
-0371 205a030f call p_g24_mode_switch_stop_2 ,blank 
-0372 20202d59 branch g24_search_mode_auto + 9 
+0366 6fe0c8c9 fetch 1 ,mem_24g_work_mode 
+0367 c1838000 rtnne dongle_search 
+0368 20402d40 call g24_search_mode_init 
+0369 20402d74 call g24_auto_addr_ch_search 
+036a 20402cef call g24_receive_transmit_ack 
+036b 2437acc4 nbranch g24_rx_interrupt_clear ,user3 
+036c 20402dcb call g24_receiver_addr_check 
+036d 20428328 call p_g24_receive_packet_parse ,zero 
+036e 6fe0c8bd fetch 1 ,mem_24g_abort_packet 
+036f 205a030f call p_g24_mode_switch_stop_2 ,blank 
+0370 7048c900 jam dongle_work ,mem_24g_work_mode 
+0371 6fe0c8c8 fetch 1 ,mem_24g_mode_init 
+0372 793ffe07 set0 dongle_search ,pdata 
+0373 79207e00 set1 dongle_work ,pdata 
+0374 67e0c8c8 store 1 ,mem_24g_mode_init 
+0375 7048c300 jam 0 ,mem_24g_ackpayload_enable 
+0376 20402cc4 call g24_rx_interrupt_clear 
+0377 20402cfc call g24_enable_nodata_timer 
+0378 20402dcb call g24_receiver_addr_check 
+0379 2022ad6d branch g24_self_ch_num_reinit ,zero 
+037a 7048c301 jam 1 ,mem_24g_ackpayload_enable 
+037b 6fe2483b fetch 4 ,mem_24g_addr 
+037c 684a487f fetcht 4 ,mem_24g_device2_addr 
+037d 98467c00 isub temp ,null 
+037e 2022ad70 branch g24_device2_ch_num_reinit ,zero 
+037f 6fe2483b fetch 4 ,mem_24g_addr 
+0380 684a487b fetcht 4 ,mem_24g_device1_addr 
+0381 98467c00 isub temp ,null 
+0382 2022ad72 branch g24_device1_ch_num_reinit ,zero 
+0383 20600000 rtn 
               org 0x800
 
 start:
Index: program/patch.prog
===================================================================
--- /branch/usb/dongle/program/patch.prog	(revision 214)
+++ /branch/usb/dongle/program/patch.prog	(working copy)
@@ -563,7 +563,7 @@
 
 ////////////////////////////24G//////////////////////////////////
 p_g24_rx_window_init:
-	arg 0x6e28,temp
+	arg 0x6978,temp
 	bmark1 mark_24g_rxmode,p_g24_rx_window_store
 	arg 0x12c0,temp
 	fetch 1,mem_24g_rx_phy
@@ -1058,8 +1058,6 @@
 	fetch 1,mem_24g_pair_mode
 	nrtn blank
 p_g24_nodata_process:
-	fetch 1,mem_24g_ackpayload_enable
-	rtneq 2
 	fetch 1,mem_24g_nodata_timer_enable
 	rtn blank
 	arg TIMER_NODATA,queue
@@ -1179,6 +1177,29 @@
 	
 	fetch 1,mem_24g_abort_packet
 	call p_g24_mode_switch_stop_2,blank	//works on auto pair only
+	
+	jam DONGLE_WORK,mem_24g_work_mode
+	fetch 1,mem_24g_mode_init
+	set0 DONGLE_SEARCH,pdata
+	set1 DONGLE_WORK,pdata
+	store 1,mem_24g_mode_init
+	jam 0,mem_24g_ackpayload_enable
+
+	call g24_rx_interrupt_clear
+	call g24_enable_nodata_timer
+	call g24_receiver_addr_check
+	branch g24_self_ch_num_reinit,zero
+	
+	jam 1,mem_24g_ackpayload_enable
+
+	fetch 4,mem_24g_addr
+	fetcht 4,mem_24g_device2_addr
+	isub temp,null
+	branch g24_device2_ch_num_reinit,zero
+	fetch 4,mem_24g_addr
+	fetcht 4,mem_24g_device1_addr
+	isub temp,null
+	branch g24_device1_ch_num_reinit,zero
+	rtn
 
-	branch g24_search_mode_auto+9
 
Index: sched/dongle.dat
===================================================================
--- /branch/usb/dongle/sched/dongle.dat	(revision 214)
+++ /branch/usb/dongle/sched/dongle.dat	(working copy)
@@ -19,7 +19,7 @@
 #20 30#PID
 
 #rf config
-mem_lap:a5 26 10 30 07 2b	#low 4B used for 24g rxaddr
+mem_lap:af bc 1d 2e 07 2b	#low 4B used for 24g rxaddr
 mem_tx_power:05
 #mem_24g_tx_phy:01#0x01:1M/0x02:2M/0x04:S2/0x84:S8
 #mem_24g_rx_phy:01#0x01:1M/0x02:2M/0x04:S2/0x84:S8
@@ -45,6 +45,8 @@
 
 mem_gain_table:88 66 44
 
+mem_spi_ncs_gpio:ff
+mem_ui_button_gpio:ff
 
 #mem_rf_debug_rx_gpio:88
 #mem_rf_debug_tx_gpio:88
