Index: format/app_usb.format
===================================================================
--- /branch/mouse_project/LeXiang/24M_dongle/format/app_usb.format	(revision 4093)
+++ /branch/mouse_project/LeXiang/24M_dongle/format/app_usb.format	(working copy)
@@ -210,3 +210,7 @@
 0x70 DONGLE_FIRMWARE_VERSION_OFFECT
 )
 
+(
+26 TEST_GPIO
+27 TEST_GPIO2
+)
\ No newline at end of file
Index: output/eeprom.dat
===================================================================
--- /branch/mouse_project/LeXiang/24M_dongle/output/eeprom.dat	(revision 4093)
+++ /branch/mouse_project/LeXiang/24M_dongle/output/eeprom.dat	(working copy)
@@ -2,7 +2,7 @@
 02
 aa
 55
-b2
+b6
 13
 c2
 84
@@ -3127,7 +3127,7 @@
 20
 40
 04
-c9
+ca
 20
 20
 04
@@ -4683,7 +4683,7 @@
 24
 2c
 04
-c4
+c5
 78
 46
 fc
@@ -4881,10 +4881,14 @@
 fc
 00
 20
-20
+40
 26
 4d
 20
+60
+00
+00
+20
 40
 04
 32
@@ -4923,7 +4927,7 @@
 20
 40
 04
-c6
+c7
 79
 20
 2a
@@ -5003,7 +5007,7 @@
 c2
 00
 04
-df
+e0
 68
 00
 c8
@@ -5044,8 +5048,8 @@
 60
 00
 00
-2f
-94
+62
+c5
 aa
 55
 01
@@ -5489,8 +5493,8 @@
 00
 39
 48
-30
-75
+60
+54
 aa
 55
 01
@@ -5594,7 +5598,7 @@
 75
 41
 8f
-1d
+1f
 ca
 00
 0a
@@ -5635,13 +5639,10 @@
 aa
 aa
 55
-b9
+ca
 92
-37
-10
-ff
-ff
-ff
+e5
+eb
 ff
 ff
 ff
@@ -8188,5 +8189,4 @@
 ff
 ff
 ff
-d0
-08
+3a
Index: output/program.lis
===================================================================
--- /branch/mouse_project/LeXiang/24M_dongle/output/program.lis	(revision 4093)
+++ /branch/mouse_project/LeXiang/24M_dongle/output/program.lis	(working copy)
@@ -1060,7 +1060,7 @@
 p_g24tx_with_ack:
 030a 2040030e call p_g24_ackpayload_prep 
 030b 20400453 call p_g24_transmit_prep 
-030c 204004c9 call p_g24_transmit 
+030c 204004ca call p_g24_transmit 
 
 p_g24tx_no_ack:
 030d 202004c1 branch p_g24_end_of_packet 
@@ -1571,7 +1571,7 @@
 048e 68014839 fetch 2 ,mem_24g_rx_window 
 048f 98003600 iforce stop_watch 
 0490 37c18400 correlate null ,timeout 
-0491 242c04c4 nbranch p_g24_sync_timeout ,sync 
+0491 242c04c5 nbranch p_g24_sync_timeout ,sync 
 0492 7846fc00 disable decode_fec0 
 0493 7825fc00 enable decode_fec1 
 0494 7823fc00 enable enable_white 
@@ -1629,55 +1629,56 @@
 p_g24_end_of_packet:
 04c1 784dfc00 disable encode_fec1 
 04c2 7845fc00 disable decode_fec1 
-04c3 2020264d branch end_of_packet 
+04c3 2040264d call end_of_packet 
+04c4 20600000 rtn 
 
 p_g24_sync_timeout:
-04c4 20400432 call p_rssi_noise 
-04c5 202004c1 branch p_g24_end_of_packet 
+04c5 20400432 call p_rssi_noise 
+04c6 202004c1 branch p_g24_end_of_packet 
 
 p_g24_set_freq_tx:
-04c6 20402918 call set_sync_on 
-04c7 6808c840 fetcht 1 ,mem_24g_ch 
-04c8 20202933 branch set_freq_tx 
+04c7 20402918 call set_sync_on 
+04c8 6808c840 fetcht 1 ,mem_24g_ch 
+04c9 20202933 branch set_freq_tx 
 
 p_g24_transmit:
-04c9 204053c4 call le_enable 
-04ca 6802485e fetch 4 ,mem_24g_addr 
-04cb 98001200 iforce access 
-04cc 20400476 call p_g24_prep 
-04cd 204004c6 call p_g24_set_freq_tx 
-04ce 79202a00 set1 txgfsk ,radio_ctrl 
-04cf 782efc00 enable encode_fec0 
-04d0 78307c00 enable is_tx 
-04d1 7850fc00 disable is_rx 
-04d2 19317e00 rshift16 access ,pdata 
-04d3 1fecfe00 rshift8 pdata ,pdata 
-04d4 1ff1fe00 rshift4 pdata ,pdata 
-04d5 08008628 inject mod ,40 
-04d6 784efc00 disable encode_fec0 
-04d7 782dfc00 enable encode_fec1 
-04d8 7823fc00 enable enable_white 
-04d9 7824fc00 enable enable_crc 
-04da 6800c8e9 fetch 1 ,mem_24g_syncword_crc8 
-04db 08008608 inject mod ,8 
-04dc 6800c838 fetch 1 ,mem_24g_txlen 
-04dd 98007200 iforce loopcnt 
-04de d8c047f2 arg mem_24g_txpayload ,contr 
+04ca 204053c4 call le_enable 
+04cb 6802485e fetch 4 ,mem_24g_addr 
+04cc 98001200 iforce access 
+04cd 20400476 call p_g24_prep 
+04ce 204004c7 call p_g24_set_freq_tx 
+04cf 79202a00 set1 txgfsk ,radio_ctrl 
+04d0 782efc00 enable encode_fec0 
+04d1 78307c00 enable is_tx 
+04d2 7850fc00 disable is_rx 
+04d3 19317e00 rshift16 access ,pdata 
+04d4 1fecfe00 rshift8 pdata ,pdata 
+04d5 1ff1fe00 rshift4 pdata ,pdata 
+04d6 08008628 inject mod ,40 
+04d7 784efc00 disable encode_fec0 
+04d8 782dfc00 enable encode_fec1 
+04d9 7823fc00 enable enable_white 
+04da 7824fc00 enable enable_crc 
+04db 6800c8e9 fetch 1 ,mem_24g_syncword_crc8 
+04dc 08008608 inject mod ,8 
+04dd 6800c838 fetch 1 ,mem_24g_txlen 
+04de 98007200 iforce loopcnt 
+04df d8c047f2 arg mem_24g_txpayload ,contr 
 
 p_g24tr_loop:
-04df e8c08000 ifetch 1 ,contr 
-04e0 08008608 inject mod ,8 
-04e1 c20004df loop p_g24tr_loop 
-04e2 6800c8ee fetch 1 ,mem_rssi_hex 
-04e3 08008608 inject mod ,8 
-04e4 78247c00 enable enable_parity 
-04e5 08008618 inject mod ,24 
-04e6 78447c00 disable enable_parity 
-04e7 37d38200 until null ,tx_clear 
-04e8 20000064 nop 100 
-04e9 784efc00 disable encode_fec0 
-04ea 784dfc00 disable encode_fec1 
-04eb 20600000 rtn 
+04e0 e8c08000 ifetch 1 ,contr 
+04e1 08008608 inject mod ,8 
+04e2 c20004e0 loop p_g24tr_loop 
+04e3 6800c8ee fetch 1 ,mem_rssi_hex 
+04e4 08008608 inject mod ,8 
+04e5 78247c00 enable enable_parity 
+04e6 08008618 inject mod ,24 
+04e7 78447c00 disable enable_parity 
+04e8 37d38200 until null ,tx_clear 
+04e9 20000064 nop 100 
+04ea 784efc00 disable encode_fec0 
+04eb 784dfc00 disable encode_fec1 
+04ec 20600000 rtn 
               org 0x2000
 
 start:
Index: program/patch.prog
===================================================================
--- /branch/mouse_project/LeXiang/24M_dongle/program/patch.prog	(revision 4093)
+++ /branch/mouse_project/LeXiang/24M_dongle/program/patch.prog	(working copy)
@@ -1,4 +1,5 @@
 define DONGLE
+//define RF_DEBUG
 //define MOUSE
 
 ifdef PATCH
@@ -234,6 +235,10 @@
 	rtn
 
 p_dongle_init:
+ifdef RF_DEBUG
+	call test_gpio_init
+	call test_gpio2_init
+endif
 	fetch 1,mem_tx_power
 	store 1,mem_tx_power_temp
 	arg 0x80,loopcnt
@@ -834,6 +839,9 @@
 	branch p_g24_rx_interrupt_clear
 
 p_g24_receive_transmit_ack:
+ifdef RF_DEBUG
+	call test_gpio_low
+endif
 	call p_g24_rx_interrupt_clear
 	call p_g24_receive_packet
 	nrtn user3
@@ -1600,6 +1608,12 @@
 	branch memcpy
 
 p_g24_ch:
+ifdef RF_DEBUG
+	call test_gpio2_high
+	call test_gpio2_low	
+	call test_gpio2_high
+	call test_gpio2_low
+endif
 	fetcht 1,mem_24g_current_ch_number
 	call p_g24_ch_map_size
 	storet 1,mem_24g_current_ch_number
@@ -1644,6 +1658,9 @@
 	call sleep
 	call rf_rx_enable
 p_g24_receive_rxon:
+ifdef RF_DEBUG
+	call test_h_l_h
+endif
 	call p_g24_prep
 	disable user3
 	enable decode_fec0	
@@ -1654,6 +1671,10 @@
 	iforce stop_watch
 	correlate null,timeout
 	nbranch p_g24_sync_timeout,sync
+ifdef RF_DEBUG
+	call test_gpio_low
+	call test_gpio_high
+endif
 	disable decode_fec0
 	enable decode_fec1
 	enable enable_white
@@ -1706,6 +1727,10 @@
 	call save_rssi
 endif	
 	branch p_g24_end_of_packet,crc_failed
+ifdef RF_DEBUG
+	call test_gpio_low
+	call test_gpio_high
+endif
 	enable user3
 	fetch 1,mem_last_freq
 	add pdata,0,rega
@@ -1725,7 +1750,11 @@
 p_g24_end_of_packet:
 	disable encode_fec1
 	disable decode_fec1
-	branch end_of_packet
+	call end_of_packet
+ifdef RF_DEBUG
+	call test_gpio_low
+endif
+	rtn
 
 p_g24_sync_timeout:
 ifdef DONGLE
@@ -1748,6 +1777,9 @@
 	enable encode_fec0
 	enable is_tx
 	disable is_rx
+ifdef RF_DEBUG
+	call test_gpio_high
+endif
 	rshift16 access,pdata
 	rshift8 pdata,pdata
 	rshift4 pdata,pdata
@@ -1778,5 +1810,41 @@
 	disable encode_fec1
 	rtn
 
+ifdef RF_DEBUG
+test_gpio_init:
+	arg TEST_GPIO,temp
+	call gpio_config_output
+	call test_gpio2_low
+test_gpio_low:
+	arg TEST_GPIO,temp
+	call gpio_out_active
+	nop 10
+	rtn
+test_gpio_high:
+	arg TEST_GPIO,temp
+	call gpio_out_inactive
+	nop 10
+	rtn
+test_gpio2_init:
+	arg TEST_GPIO2,temp
+	call gpio_config_output
+test_gpio2_low:
+	arg TEST_GPIO2,temp
+	call gpio_out_active
+	nop 10
+	rtn
+test_gpio2_high:
+	arg TEST_GPIO2,temp
+	call gpio_out_inactive
+	nop 10
+	rtn
+test_h_l:
+	call test_gpio_high
+	branch test_gpio_low
+test_h_l_h:
+	call test_gpio_high
+	call test_gpio_low	
+	branch test_gpio_high
 endif
 
+endif
Index: sched/109x.dat
===================================================================
--- /branch/mouse_project/LeXiang/24M_dongle/sched/109x.dat	(revision 4093)
+++ /branch/mouse_project/LeXiang/24M_dongle/sched/109x.dat	(working copy)
@@ -1,5 +1,5 @@
 
-mem_lpm_config:8f 1d ca	#4khz
+mem_lpm_config:8f 1f ca	#4khz
 mem_lpm_xtalcnt:00 0a 0b ef 07
 mem_lpm_hibernate_switch:00
 
Index: sched/usb.dat
===================================================================
--- /branch/mouse_project/LeXiang/24M_dongle/sched/usb.dat	(revision 4093)
+++ /branch/mouse_project/LeXiang/24M_dongle/sched/usb.dat	(working copy)
@@ -198,7 +198,7 @@
 mem_24g_mode:02#rx
 mem_24g_pair_mode:00
 mem_24g_no_ack:00#no ack
-mem_24g_rx_window:30 75#rx
+mem_24g_rx_window:60 54#rx
 mem_24g_hop_interval:1e
 mem_24g_ackpayload_enable:00#ack payload enable
 mem_24g_ch_map1:00 13 2c 42
