Index: format/app_dongle.format
===================================================================
--- /branch/keyboard/customer_FW/RY_project/RY_Dongle/format/app_dongle.format	(revision 1949)
+++ /branch/keyboard/customer_FW/RY_project/RY_Dongle/format/app_dongle.format	(working copy)
@@ -38,6 +38,20 @@
 70 mem_24g_rxpayload_new
 70 mem_24g_rxdata_temp_new
 1 mem_24g_rxdata_ack_flag
+
+1 mem_dg_keyboard_battery_level
+1 mem_dg_mouse_battery_level
+2 mem_dg_keyboard_heart_tick_timer
+2 mem_dg_mouse_heart_tick_timer
+1 mem_dg_keyboard_connected_status
+1 mem_dg_mouse_connected_status
+1 mem_dg_usb_driver_set_end
+1 mem_dg_data_type
+1 mem_dg_data_len
+1 mem_dg_test_mode
+1 mem_dg_test_ch
+
+64 mem_dg_usb_get_buff
 )
 
 
@@ -144,3 +158,14 @@
 0 DG_ENABLE_NEW_REVISION
 )
 
+(
+0xF6 CMD_SET
+0xF7 CMD_CHECK_STATUS
+0xFA CMD_GET_KB_ADDR
+0xFB CMD_GET_RECEIVER_ADDR
+0xFC CMD_GET_IN_DATA
+0xFE CMD_GET_TRANSLEN
+0x7A CMD_SET_TEST
+
+)
+
Index: output/eeprom.dat
===================================================================
--- /branch/keyboard/customer_FW/RY_project/RY_Dongle/output/eeprom.dat	(revision 1949)
+++ /branch/keyboard/customer_FW/RY_project/RY_Dongle/output/eeprom.dat	(working copy)
@@ -2,8 +2,8 @@
 02
 aa
 55
-22
-0b
+7a
+0c
 c2
 84
 00
@@ -2002,8 +2002,8 @@
 f4
 20
 20
-48
-68
+02
+ea
 58
 00
 00
@@ -2090,8 +2090,8 @@
 95
 58
 00
-47
-ea
+02
+c8
 67
 e1
 45
@@ -2852,233 +2852,366 @@
 20
 31
 b3
-2a
-59
-aa
-55
+20
 40
-00
-00
+34
+02
+20
 40
-05
-00
-32
+34
 07
-00
-00
-80
-63
-00
-00
-00
-00
-00
-00
-00
-00
-00
-00
-00
-00
-00
-00
+20
+40
+34
+2d
+20
+40
+48
+a3
+20
+40
+34
+69
+20
+40
+34
+88
+20
+40
+48
+67
+20
+40
 02
-00
+d2
+20
+40
+02
+de
+20
 20
-00
-00
-14
-00
-00
-00
-80
-41
-00
-00
-00
-00
-00
-00
 02
+c9
+d8
+40
+ff
+fe
+6f
+e1
+47
+f8
+98
+46
+7c
 00
 20
+61
 00
 00
+1f
+e0
+fe
+01
+67
+e1
+47
+f8
+d8
+40
 00
-c0
-2c
 00
-26
-0d
+da
+60
+05
+dc
+9a
+66
+7c
 00
-08
+79
+21
+04
 00
+60
+48
+c7
+fc
+20
+60
 00
 00
+d8
+40
+ff
+fe
+6f
+e1
+47
+fa
+98
+46
+7c
 00
+20
+61
 00
 00
+1f
+e0
+fe
+01
+67
+e1
+47
+fa
+d8
+40
 00
 00
+da
+60
+05
+dc
+9a
+66
+7c
 00
+79
+21
+04
 00
+60
+48
+c7
+fd
+20
+60
 00
 00
-aa
-55
+6f
+e0
+89
 01
+20
+5a
+48
+b5
+20
+40
+79
+06
+6f
+e0
+88
+f7
+20
+7a
 00
-cb
-43
-04
-aa
-55
-01
 00
-ec
-44
-ff
-aa
-55
-01
+70
+08
+f7
 00
-1c
+6f
+e1
+08
+f5
+d8
+40
 02
-5a
-aa
-55
-01
-00
-69
+ba
+98
 46
-01
-aa
-55
-01
+7c
 00
-94
-46
-03
-aa
-55
-18
+24
+62
+80
 00
-6a
-46
-01
-51
-31
-20
-10
-51
-31
-20
-30
+6f
+e0
+88
+75
+c1
+dd
 00
-0d
-32
-2e
-34
-47
-20
-52
-65
-63
-65
-69
+00
+6f
+e0
+88
 76
-65
-72
-aa
-55
-01
+c0
+7b
+82
+fd
+c0
+7b
+03
+0a
+c0
+7e
+03
+0d
+c0
+7f
+03
+13
+c0
+3d
+03
+16
+20
+20
+48
+75
+6f
+e0
+c7
+f6
+67
+e0
+88
+b6
+6f
+e0
+c7
+f7
+67
+e0
+88
+b7
+6f
+e0
+c7
+fc
+67
+e0
+88
+b8
+6f
+e0
+c7
+fd
+67
+e0
+88
+b9
+6f
+e0
+c7
+fe
+67
+e0
+88
+ba
+6f
+e2
+45
+8f
+67
+e2
+08
+bd
+20
+20
+48
+80
+6f
+e0
+88
+77
+67
+e0
+c7
+ff
+20
+20
+48
+7a
+70
+08
+75
 00
-95
-46
-94
-aa
-55
-06
+d8
+c0
+48
+03
+d8
+a0
+08
+b5
+df
+20
 00
-f1
-44
-36
-27
-83
-74
-12
-23
-aa
-55
-02
+40
+20
+40
+7c
+cc
+20
+20
+48
+7a
+6f
+e0
+88
+77
+67
+e0
+c8
 00
-8b
-45
-78
-69
-aa
-55
+20
+20
+48
+7a
+70
+46
+16
 02
-00
-0f
+70
 46
-1e
+15
 00
-aa
-55
+6f
+e0
+88
+77
+67
+e0
+c8
 01
-00
-48
-41
-0c
-aa
-55
-06
-00
-c3
-40
-35
-3f
-64
-db
-7b
-3b
-aa
-55
+6f
+e0
+88
+78
+67
+e0
+c8
+02
+70
+08
+b6
 01
-00
-a7
-40
 20
+20
+48
+80
+2b
+05
 aa
 55
-03
-00
-c9
 40
 00
-08
-a5
-aa
-55
-01
 00
-99
 40
-18
-aa
-55
-01
+05
 00
-1c
-41
-3e
-aa
-55
-0c
+32
+07
 00
-16
 00
+80
+63
 00
 00
 00
@@ -3091,486 +3224,353 @@
 00
 00
 00
-aa
-55
-05
 00
-5e
-41
-08
-0e
-05
-03
 00
-aa
-55
-01
+02
 00
-68
-41
 20
-aa
-55
-02
 00
-9a
-40
 00
-0c
-aa
-55
-05
+14
 00
-43
+00
+00
+80
 41
-ff
-04
 00
 00
-08
-aa
-55
-01
 00
-07
-44
-01
-aa
-55
-01
 00
-09
-44
-0a
-aa
-55
-01
 00
-08
-44
 00
-aa
-55
-01
+02
+00
+20
 00
-11
-44
 00
-aa
-55
-04
 00
+c0
+2c
+00
+26
 0d
-44
 00
-07
-ff
-07
+08
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
 aa
 55
 01
 00
-38
-44
-a0
+cb
+43
+04
 aa
 55
-02
+01
 00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ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
+18
+00
+6a
+46
+01
+51
+31
+20
+10
+51
+31
+20
+30
+00
+0d
+32
+2e
+34
+47
+20
+52
+65
+63
+65
+69
+76
+65
+72
+aa
+55
+01
+00
+95
+46
+94
+aa
+55
+06
+00
+f1
+44
+36
+27
+83
+74
+12
+23
+aa
+55
+02
+00
+8b
+45
+78
+69
+aa
+55
+02
+00
+0f
+46
+1e
+00
+aa
+55
+01
+00
+fe
+47
+01
+aa
+55
+01
+00
+48
+41
+0c
+aa
+55
+06
+00
+c3
+40
+35
+3f
+64
+db
+7b
+3b
+aa
+55
+01
+00
+a7
+40
+20
+aa
+55
+03
+00
+c9
+40
+00
+08
+a5
+aa
+55
+01
+00
+99
+40
+18
+aa
+55
+01
+00
+1c
+41
+3e
+aa
+55
+0c
+00
+16
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+aa
+55
+05
+00
+5e
+41
+08
+0e
+05
+03
+00
+aa
+55
+01
+00
+68
+41
+20
+aa
+55
+02
+00
+9a
+40
+00
+0c
+aa
+55
+05
+00
+43
+41
 ff
+04
+00
+00
+08
+aa
+55
+01
+00
+07
+44
+01
+aa
+55
+01
+00
+09
+44
+0a
+aa
+55
+01
+00
+08
+44
+00
+aa
+55
+01
+00
+11
+44
+00
+aa
+55
+04
+00
+0d
+44
+00
+07
 ff
+07
+aa
+55
+01
+00
+38
+44
+a0
+aa
+55
+02
+00
+3b
+44
+bc
+02
+aa
+55
+02
+00
+39
+44
+90
+01
+aa
+55
+02
+00
+3d
+44
+03
+09
+aa
+55
+01
+00
+49
+41
 ff
+aa
+55
+02
+00
+9c
+40
+49
+41
+55
+aa
+aa
+55
+4f
+4f
+af
+7f
 ff
 ff
 ff
@@ -8188,5 +8188,5 @@
 ff
 ff
 ff
-e6
-2f
+40
+cd
Index: output/flash.dat
===================================================================
--- /branch/keyboard/customer_FW/RY_project/RY_Dongle/output/flash.dat	(revision 1949)
+++ /branch/keyboard/customer_FW/RY_project/RY_Dongle/output/flash.dat	(working copy)
@@ -2,8 +2,8 @@
 02
 aa
 55
-22
-0b
+7a
+0c
 c2
 84
 00
@@ -2002,8 +2002,8 @@
 f4
 20
 20
-48
-68
+02
+ea
 58
 00
 00
@@ -2090,8 +2090,8 @@
 95
 58
 00
-47
-ea
+02
+c8
 67
 e1
 45
@@ -2852,233 +2852,366 @@
 20
 31
 b3
-2a
-59
-aa
-55
+20
 40
-00
-00
+34
+02
+20
 40
-05
-00
-32
+34
 07
-00
-00
-80
-63
-00
-00
-00
-00
-00
-00
-00
-00
-00
-00
-00
-00
-00
-00
+20
+40
+34
+2d
+20
+40
+48
+a3
+20
+40
+34
+69
+20
+40
+34
+88
+20
+40
+48
+67
+20
+40
 02
-00
+d2
+20
+40
+02
+de
+20
 20
-00
-00
-14
-00
-00
-00
-80
-41
-00
-00
-00
-00
-00
-00
 02
+c9
+d8
+40
+ff
+fe
+6f
+e1
+47
+f8
+98
+46
+7c
 00
 20
+61
 00
 00
+1f
+e0
+fe
+01
+67
+e1
+47
+f8
+d8
+40
 00
-c0
-2c
 00
-26
-0d
+da
+60
+05
+dc
+9a
+66
+7c
 00
-08
+79
+21
+04
 00
+60
+48
+c7
+fc
+20
+60
 00
 00
+d8
+40
+ff
+fe
+6f
+e1
+47
+fa
+98
+46
+7c
 00
+20
+61
 00
 00
+1f
+e0
+fe
+01
+67
+e1
+47
+fa
+d8
+40
 00
 00
+da
+60
+05
+dc
+9a
+66
+7c
 00
+79
+21
+04
 00
+60
+48
+c7
+fd
+20
+60
 00
 00
-aa
-55
+6f
+e0
+89
 01
+20
+5a
+48
+b5
+20
+40
+79
+06
+6f
+e0
+88
+f7
+20
+7a
 00
-cb
-43
-04
-aa
-55
-01
 00
-ec
-44
-ff
-aa
-55
-01
+70
+08
+f7
 00
-1c
+6f
+e1
+08
+f5
+d8
+40
 02
-5a
-aa
-55
-01
-00
-69
+ba
+98
 46
-01
-aa
-55
-01
+7c
 00
-94
-46
-03
-aa
-55
-18
+24
+62
+80
 00
-6a
-46
-01
-51
-31
-20
-10
-51
-31
-20
-30
+6f
+e0
+88
+75
+c1
+dd
 00
-0d
-32
-2e
-34
-47
-20
-52
-65
-63
-65
-69
+00
+6f
+e0
+88
 76
-65
-72
-aa
-55
-01
+c0
+7b
+82
+fd
+c0
+7b
+03
+0a
+c0
+7e
+03
+0d
+c0
+7f
+03
+13
+c0
+3d
+03
+16
+20
+20
+48
+75
+6f
+e0
+c7
+f6
+67
+e0
+88
+b6
+6f
+e0
+c7
+f7
+67
+e0
+88
+b7
+6f
+e0
+c7
+fc
+67
+e0
+88
+b8
+6f
+e0
+c7
+fd
+67
+e0
+88
+b9
+6f
+e0
+c7
+fe
+67
+e0
+88
+ba
+6f
+e2
+45
+8f
+67
+e2
+08
+bd
+20
+20
+48
+80
+6f
+e0
+88
+77
+67
+e0
+c7
+ff
+20
+20
+48
+7a
+70
+08
+75
 00
-95
-46
-94
-aa
-55
-06
+d8
+c0
+48
+03
+d8
+a0
+08
+b5
+df
+20
 00
-f1
-44
-36
-27
-83
-74
-12
-23
-aa
-55
-02
+40
+20
+40
+7c
+cc
+20
+20
+48
+7a
+6f
+e0
+88
+77
+67
+e0
+c8
 00
-8b
-45
-78
-69
-aa
-55
+20
+20
+48
+7a
+70
+46
+16
 02
-00
-0f
+70
 46
-1e
+15
 00
-aa
-55
+6f
+e0
+88
+77
+67
+e0
+c8
 01
-00
-48
-41
-0c
-aa
-55
-06
-00
-c3
-40
-35
-3f
-64
-db
-7b
-3b
-aa
-55
+6f
+e0
+88
+78
+67
+e0
+c8
+02
+70
+08
+b6
 01
-00
-a7
-40
 20
+20
+48
+80
+2b
+05
 aa
 55
-03
-00
-c9
 40
 00
-08
-a5
-aa
-55
-01
 00
-99
 40
-18
-aa
-55
-01
+05
 00
-1c
-41
-3e
-aa
-55
-0c
+32
+07
 00
-16
 00
+80
+63
 00
 00
 00
@@ -3091,486 +3224,353 @@
 00
 00
 00
-aa
-55
-05
 00
-5e
-41
-08
-0e
-05
-03
 00
-aa
-55
-01
+02
 00
-68
-41
 20
-aa
-55
-02
 00
-9a
-40
 00
-0c
-aa
-55
-05
+14
 00
-43
+00
+00
+80
 41
-ff
-04
 00
 00
-08
-aa
-55
-01
 00
-07
-44
-01
-aa
-55
-01
 00
-09
-44
-0a
-aa
-55
-01
 00
-08
-44
 00
-aa
-55
-01
+02
+00
+20
 00
-11
-44
 00
-aa
-55
-04
 00
+c0
+2c
+00
+26
 0d
-44
 00
-07
-ff
-07
+08
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
 aa
 55
 01
 00
-38
-44
-a0
+cb
+43
+04
 aa
 55
-02
+01
 00
-3b
+ec
 44
-bc
-02
+ff
 aa
 55
-02
-00
-39
-44
-90
 01
-aa
-55
-02
 00
-3d
-44
-03
-09
+1c
+02
+5a
 aa
 55
 01
 00
-49
-41
-ff
+69
+46
+01
 aa
 55
-02
+01
 00
-9c
-40
-49
-41
-55
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ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
-ff
+18
+00
+6a
+46
+01
+51
+31
+20
+10
+51
+31
+20
+30
+00
+0d
+32
+2e
+34
+47
+20
+52
+65
+63
+65
+69
+76
+65
+72
+aa
+55
+01
+00
+95
+46
+94
+aa
+55
+06
+00
+f1
+44
+36
+27
+83
+74
+12
+23
+aa
+55
+02
+00
+8b
+45
+78
+69
+aa
+55
+02
+00
+0f
+46
+1e
+00
+aa
+55
+01
+00
+fe
+47
+01
+aa
+55
+01
+00
+48
+41
+0c
+aa
+55
+06
+00
+c3
+40
+35
+3f
+64
+db
+7b
+3b
+aa
+55
+01
+00
+a7
+40
+20
+aa
+55
+03
+00
+c9
+40
+00
+08
+a5
+aa
+55
+01
+00
+99
+40
+18
+aa
+55
+01
+00
+1c
+41
+3e
+aa
+55
+0c
+00
+16
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+aa
+55
+05
+00
+5e
+41
+08
+0e
+05
+03
+00
+aa
+55
+01
+00
+68
+41
+20
+aa
+55
+02
+00
+9a
+40
+00
+0c
+aa
+55
+05
+00
+43
+41
 ff
+04
+00
+00
+08
+aa
+55
+01
+00
+07
+44
+01
+aa
+55
+01
+00
+09
+44
+0a
+aa
+55
+01
+00
+08
+44
+00
+aa
+55
+01
+00
+11
+44
+00
+aa
+55
+04
+00
+0d
+44
+00
+07
 ff
+07
+aa
+55
+01
+00
+38
+44
+a0
+aa
+55
+02
+00
+3b
+44
+bc
+02
+aa
+55
+02
+00
+39
+44
+90
+01
+aa
+55
+02
+00
+3d
+44
+03
+09
+aa
+55
+01
+00
+49
+41
 ff
+aa
+55
+02
+00
+9c
+40
+49
+41
+55
+aa
+aa
+55
+4f
+4f
+af
+7f
 ff
 ff
 ff
@@ -8188,5 +8188,5 @@
 ff
 ff
 ff
-e6
-2f
+40
+cd
Index: output/memmap.format
===================================================================
--- /branch/keyboard/customer_FW/RY_project/RY_Dongle/output/memmap.format	(revision 1949)
+++ /branch/keyboard/customer_FW/RY_project/RY_Dongle/output/memmap.format	(working copy)
@@ -1489,6 +1489,18 @@
 0x4769 mem_24g_rxpayload_new
 0x47af mem_24g_rxdata_temp_new
 0x47f5 mem_24g_rxdata_ack_flag
+0x47f6 mem_dg_keyboard_battery_level
+0x47f7 mem_dg_mouse_battery_level
+0x47f8 mem_dg_keyboard_heart_tick_timer
+0x47fa mem_dg_mouse_heart_tick_timer
+0x47fc mem_dg_keyboard_connected_status
+0x47fd mem_dg_mouse_connected_status
+0x47fe mem_dg_usb_driver_set_end
+0x47ff mem_dg_data_type
+0x4800 mem_dg_data_len
+0x4801 mem_dg_test_mode
+0x4802 mem_dg_test_ch
+0x4803 mem_dg_usb_get_buff
 0x45d3 mem_rssi_hex_received
 0x45d4 mem_24g_pair_sm
 0x45d5 mem_24g_pair_no_ack
Index: output/otp.dat
===================================================================
--- /branch/keyboard/customer_FW/RY_project/RY_Dongle/output/otp.dat	(revision 1949)
+++ /branch/keyboard/customer_FW/RY_project/RY_Dongle/output/otp.dat	(working copy)
@@ -11,8 +11,8 @@
 00
 aa
 55
-22
-0b
+7a
+0c
 c2
 84
 00
@@ -2011,8 +2011,8 @@
 f4
 20
 20
-48
-68
+02
+ea
 58
 00
 00
@@ -2099,8 +2099,8 @@
 95
 58
 00
-47
-ea
+02
+c8
 67
 e1
 45
@@ -2861,8 +2861,352 @@
 20
 31
 b3
-2a
-59
+20
+40
+34
+02
+20
+40
+34
+07
+20
+40
+34
+2d
+20
+40
+48
+a3
+20
+40
+34
+69
+20
+40
+34
+88
+20
+40
+48
+67
+20
+40
+02
+d2
+20
+40
+02
+de
+20
+20
+02
+c9
+d8
+40
+ff
+fe
+6f
+e1
+47
+f8
+98
+46
+7c
+00
+20
+61
+00
+00
+1f
+e0
+fe
+01
+67
+e1
+47
+f8
+d8
+40
+00
+00
+da
+60
+05
+dc
+9a
+66
+7c
+00
+79
+21
+04
+00
+60
+48
+c7
+fc
+20
+60
+00
+00
+d8
+40
+ff
+fe
+6f
+e1
+47
+fa
+98
+46
+7c
+00
+20
+61
+00
+00
+1f
+e0
+fe
+01
+67
+e1
+47
+fa
+d8
+40
+00
+00
+da
+60
+05
+dc
+9a
+66
+7c
+00
+79
+21
+04
+00
+60
+48
+c7
+fd
+20
+60
+00
+00
+6f
+e0
+89
+01
+20
+5a
+48
+b5
+20
+40
+79
+06
+6f
+e0
+88
+f7
+20
+7a
+00
+00
+70
+08
+f7
+00
+6f
+e1
+08
+f5
+d8
+40
+02
+ba
+98
+46
+7c
+00
+24
+62
+80
+00
+6f
+e0
+88
+75
+c1
+dd
+00
+00
+6f
+e0
+88
+76
+c0
+7b
+82
+fd
+c0
+7b
+03
+0a
+c0
+7e
+03
+0d
+c0
+7f
+03
+13
+c0
+3d
+03
+16
+20
+20
+48
+75
+6f
+e0
+c7
+f6
+67
+e0
+88
+b6
+6f
+e0
+c7
+f7
+67
+e0
+88
+b7
+6f
+e0
+c7
+fc
+67
+e0
+88
+b8
+6f
+e0
+c7
+fd
+67
+e0
+88
+b9
+6f
+e0
+c7
+fe
+67
+e0
+88
+ba
+6f
+e2
+45
+8f
+67
+e2
+08
+bd
+20
+20
+48
+80
+6f
+e0
+88
+77
+67
+e0
+c7
+ff
+20
+20
+48
+7a
+70
+08
+75
+00
+d8
+c0
+48
+03
+d8
+a0
+08
+b5
+df
+20
+00
+40
+20
+40
+7c
+cc
+20
+20
+48
+7a
+6f
+e0
+88
+77
+67
+e0
+c8
+00
+20
+20
+48
+7a
+70
+46
+16
+02
+70
+46
+15
+00
+6f
+e0
+88
+77
+67
+e0
+c8
+01
+6f
+e0
+88
+78
+67
+e0
+c8
+02
+70
+08
+b6
+01
+20
+20
+48
+80
+2b
+05
 aa
 55
 40
@@ -3037,6 +3381,13 @@
 55
 01
 00
+fe
+47
+01
+aa
+55
+01
+00
 48
 41
 0c
@@ -3225,8 +3576,8 @@
 aa
 aa
 55
-09
-4d
-12
-9f
-20
+4f
+4f
+af
+7f
+f0
Index: output/program.lis
===================================================================
--- /branch/keyboard/customer_FW/RY_project/RY_Dongle/output/program.lis	(revision 1949)
+++ /branch/keyboard/customer_FW/RY_project/RY_Dongle/output/program.lis	(working copy)
@@ -625,7 +625,7 @@
 
 p_dongle_usb_dispatch:
 01f2 204001f4 call p_wdt_kick 
-01f3 20204868 branch dongle_usb_dispatch + 1 
+01f3 202002ea branch p_dongle_usb_dispatch_analysis 
 
 p_wdt_kick:
 01f4 58000010 setarg 16 
@@ -655,7 +655,7 @@
 0208 20203195 branch g24_transmit 
 
 p_app_init:
-0209 580047ea setarg dongle_dispatch 
+0209 580002c8 setarg p_dongle_dispatch 
 020a 67e145e0 store 2 ,mem_cb_24g_receive_process 
 020b 580048d4 setarg dongle_g24_mouse 
 020c 67e145e4 store 2 ,mem_cb_24g_data_device1 
@@ -902,6 +902,114 @@
 02c5 98007200 iforce loopcnt 
 02c6 d8c04723 arg mem_24g_txpayload_new ,contr 
 02c7 202031b3 branch g24tr_loop 
+
+p_dongle_dispatch:
+
+p_dongle_auto_bind:
+02c8 20403402 call g24_mode_switch_init 
+
+p_dongle_auto_bind_loop:
+02c9 20403407 call g24_mode_switch_bind_work 
+02ca 2040342d call g24_mode_switch_bind_search 
+02cb 204048a3 call dongle_work_mode_auto 
+02cc 20403469 call g24_bind_mode_auto 
+02cd 20403488 call g24_search_mode_auto 
+02ce 20404867 call dongle_usb_dispatch 
+02cf 204002d2 call p_dongle_keyboard_heart_tick_timer 
+02d0 204002de call p_dongle_mouse_heart_tick_timer 
+02d1 202002c9 branch p_dongle_auto_bind_loop 
+
+p_dongle_keyboard_heart_tick_timer:
+02d2 d840fffe arg 0xfffe ,temp 
+02d3 6fe147f8 fetch 2 ,mem_dg_keyboard_heart_tick_timer 
+02d4 98467c00 isub temp ,null 
+02d5 20610000 rtn positive 
+02d6 1fe0fe01 increase 1 ,pdata 
+02d7 67e147f8 store 2 ,mem_dg_keyboard_heart_tick_timer 
+02d8 d8400000 arg 0 ,temp 
+02d9 da6005dc arg 1500 ,regc 
+02da 9a667c00 isub regc ,null 
+02db 79210400 setflag positive ,0 ,temp 
+02dc 6048c7fc storet 1 ,mem_dg_keyboard_connected_status 
+02dd 20600000 rtn 
+
+p_dongle_mouse_heart_tick_timer:
+02de d840fffe arg 0xfffe ,temp 
+02df 6fe147fa fetch 2 ,mem_dg_mouse_heart_tick_timer 
+02e0 98467c00 isub temp ,null 
+02e1 20610000 rtn positive 
+02e2 1fe0fe01 increase 1 ,pdata 
+02e3 67e147fa store 2 ,mem_dg_mouse_heart_tick_timer 
+02e4 d8400000 arg 0 ,temp 
+02e5 da6005dc arg 1500 ,regc 
+02e6 9a667c00 isub regc ,null 
+02e7 79210400 setflag positive ,0 ,temp 
+02e8 6048c7fd storet 1 ,mem_dg_mouse_connected_status 
+02e9 20600000 rtn 
+
+p_dongle_usb_dispatch_analysis:
+02ea 6fe08901 fetch 1 ,mem_usb_remote_wakeup 
+02eb 205a48b5 call dongle_clear_pc_sleep_flag ,blank 
+02ec 20407906 call usb_isr 
+02ed 6fe088f7 fetch 1 ,mem_usb0_get_set_report 
+02ee 207a0000 rtn blank 
+02ef 7008f700 jam 0 ,mem_usb0_get_set_report 
+02f0 6fe108f5 fetch 2 ,mem_usb_setup_bvalue_temp 
+02f1 d84002ba arg pc_set_report ,temp 
+02f2 98467c00 isub temp ,null 
+02f3 24628000 nrtn zero 
+02f4 6fe08875 fetch 1 ,mem_usb0_set_report_data 
+02f5 c1dd0000 rtnne pc_report_id 
+02f6 6fe08876 fetch 1 ,mem_usb0_set_report_data + 1 
+02f7 c07b82fd beq cmd_check_status ,p_dongle_dispose_cmd_check_status 
+02f8 c07b030a beq cmd_set ,p_dongle_dispose_cmd_set 
+02f9 c07e030d beq cmd_get_in_data ,p_dongle_dispose_cmd_get_in_data 
+02fa c07f0313 beq cmd_get_translen ,p_dongle_dispose_cmd_get_translen 
+02fb c03d0316 beq cmd_set_test ,p_dongle_dispose_cmd_set_test 
+02fc 20204875 branch dongle_usb_dispatch_next 
+
+p_dongle_dispose_cmd_check_status:
+02fd 6fe0c7f6 fetch 1 ,mem_dg_keyboard_battery_level 
+02fe 67e088b6 store 1 ,mem_usb0_get_report_data + 1 
+02ff 6fe0c7f7 fetch 1 ,mem_dg_mouse_battery_level 
+0300 67e088b7 store 1 ,mem_usb0_get_report_data + 2 
+0301 6fe0c7fc fetch 1 ,mem_dg_keyboard_connected_status 
+0302 67e088b8 store 1 ,mem_usb0_get_report_data + 3 
+0303 6fe0c7fd fetch 1 ,mem_dg_mouse_connected_status 
+0304 67e088b9 store 1 ,mem_usb0_get_report_data + 4 
+0305 6fe0c7fe fetch 1 ,mem_dg_usb_driver_set_end 
+0306 67e088ba store 1 ,mem_usb0_get_report_data + 5 
+0307 6fe2458f fetch 4 ,mem_24g_addr 
+0308 67e208bd store 4 ,mem_usb0_get_report_data + 8 
+0309 20204880 branch dongle_usb0_data_ready_report_set1 
+
+p_dongle_dispose_cmd_set:
+030a 6fe08877 fetch 1 ,mem_usb0_set_report_data + 2 
+030b 67e0c7ff store 1 ,mem_dg_data_type 
+030c 2020487a branch dongle_usb0_data_ready_report_set0 
+
+p_dongle_dispose_cmd_get_in_data:
+030d 70087500 jam 0 ,mem_usb0_set_report_data 
+030e d8c04803 arg mem_dg_usb_get_buff ,contr 
+030f d8a008b5 arg mem_usb0_get_report_data ,contw 
+0310 df200040 arg 64 ,loopcnt 
+0311 20407ccc call memcpy_fast 
+0312 2020487a branch dongle_usb0_data_ready_report_set0 
+
+p_dongle_dispose_cmd_get_translen:
+0313 6fe08877 fetch 1 ,mem_usb0_set_report_data + 2 
+0314 67e0c800 store 1 ,mem_dg_data_len 
+0315 2020487a branch dongle_usb0_data_ready_report_set0 
+
+p_dongle_dispose_cmd_set_test:
+0316 70461602 jam dongle_test ,mem_24g_work_mode 
+0317 70461500 jam clear_init ,mem_24g_mode_init 
+0318 6fe08877 fetch 1 ,mem_usb0_set_report_data + 2 
+0319 67e0c801 store 1 ,mem_dg_test_mode 
+031a 6fe08878 fetch 1 ,mem_usb0_set_report_data + 3 
+031b 67e0c802 store 1 ,mem_dg_test_ch 
+031c 7008b601 jam 0x01 ,mem_usb0_get_report_data + 1 
+031d 20204880 branch dongle_usb0_data_ready_report_set1 
               org 0x2000
 
 start:
@@ -14624,6 +14732,8 @@
 4872 6fe08875 fetch 1 ,mem_usb0_set_report_data 
 4873 c1dd0000 rtnne pc_report_id 
 4874 6fe08876 fetch 1 ,mem_usb0_set_report_data + 1 
+
+dongle_usb_dispatch_next:
 4875 c050487c beq command_mode ,dongle_dispose_cmd_mode 
 4876 c050c882 beq command_bind ,dongle_dispose_cmd_bind 
 4877 c053488e beq command_current_project ,dongle_dispose_cmd_current_project 
Index: program/app_dongle.prog
===================================================================
--- /branch/keyboard/customer_FW/RY_project/RY_Dongle/program/app_dongle.prog	(revision 1949)
+++ /branch/keyboard/customer_FW/RY_project/RY_Dongle/program/app_dongle.prog	(working copy)
@@ -247,6 +247,7 @@
 	fetch 1,mem_usb0_set_report_data
 	rtnne PC_REPORT_ID
 	fetch 1,mem_usb0_set_report_data+1
+dongle_usb_dispatch_next:
 	beq COMMAND_MODE,dongle_dispose_cmd_mode
 	beq COMMAND_BIND,dongle_dispose_cmd_bind
 	beq COMMAND_CURRENT_PROJECT,dongle_dispose_cmd_current_project
Index: program/patch.prog
===================================================================
--- /branch/keyboard/customer_FW/RY_project/RY_Dongle/program/patch.prog	(revision 1949)
+++ /branch/keyboard/customer_FW/RY_project/RY_Dongle/program/patch.prog	(working copy)
@@ -639,7 +639,7 @@
 
 p_dongle_usb_dispatch:
 	call p_wdt_kick
-	branch dongle_usb_dispatch+1
+	branch p_dongle_usb_dispatch_analysis
 
 p_wdt_kick:
 	setarg 16	//about 125ms
@@ -675,7 +675,7 @@
 
 
 p_app_init:
-	setarg dongle_dispatch
+	setarg p_dongle_dispatch
 	store 2,mem_cb_24g_receive_process
 	setarg dongle_g24_mouse
 	store 2,mem_cb_24g_data_device1
@@ -933,7 +933,124 @@
 	branch g24tr_loop
 
 
+p_dongle_dispatch:
+p_dongle_auto_bind:
+	call g24_mode_switch_init
+p_dongle_auto_bind_loop:
+	call g24_mode_switch_bind_work
+	call g24_mode_switch_bind_search
+	call dongle_work_mode_auto
+	call g24_bind_mode_auto
+	call g24_search_mode_auto
+	call dongle_usb_dispatch
+	call p_dongle_keyboard_heart_tick_timer
+	call p_dongle_mouse_heart_tick_timer
+	branch p_dongle_auto_bind_loop
+
+p_dongle_keyboard_heart_tick_timer: //loop once:12.99ms
+	arg 0xfffe,temp
+	fetch 2,mem_dg_keyboard_heart_tick_timer
+	isub temp,null
+	rtn positive
+	increase 1,pdata
+	store 2,mem_dg_keyboard_heart_tick_timer
+
+	arg 0,temp
+	arg 1500,regc
+	isub regc,null
+	setflag positive,0,temp
+	storet 1,mem_dg_keyboard_connected_status
+	rtn
+
+p_dongle_mouse_heart_tick_timer:
+	arg 0xfffe,temp
+	fetch 2,mem_dg_mouse_heart_tick_timer
+	isub temp,null
+	rtn positive
+	increase 1,pdata
+	store 2,mem_dg_mouse_heart_tick_timer
+
+	arg 0,temp
+	arg 1500,regc
+	isub regc,null
+	setflag positive,0,temp
+	storet 1,mem_dg_mouse_connected_status
+	
+	rtn
+	
+
+
+//usb data analysis
+p_dongle_usb_dispatch_analysis:
+	fetch 1,mem_usb_remote_wakeup
+	call dongle_clear_pc_sleep_flag,blank
+	call usb_isr
+	fetch 1,mem_usb0_get_set_report
+	rtn blank
+	jam 0,mem_usb0_get_set_report
+	fetch 2,mem_usb_setup_bValue_temp
+	arg PC_SET_REPORT,temp
+	isub temp,null
+	nrtn zero
+	//get usb host command
+	fetch 1,mem_usb0_set_report_data
+	rtnne PC_REPORT_ID
+	fetch 1,mem_usb0_set_report_data+1
+	beq CMD_CHECK_STATUS,p_dongle_dispose_cmd_check_status
+	beq CMD_SET,p_dongle_dispose_cmd_set
+	beq CMD_GET_IN_DATA,p_dongle_dispose_cmd_get_in_data
+	beq CMD_GET_TRANSLEN,p_dongle_dispose_cmd_get_translen
+	beq CMD_SET_TEST,p_dongle_dispose_cmd_set_test
+	branch dongle_usb_dispatch_next
+
+p_dongle_dispose_cmd_check_status:
+	fetch 1,mem_dg_keyboard_battery_level
+	store 1,mem_usb0_get_report_data+1
+
+	fetch 1,mem_dg_mouse_battery_level
+	store 1,mem_usb0_get_report_data+2
+
+	fetch 1,mem_dg_keyboard_connected_status
+	store 1,mem_usb0_get_report_data+3
+
+	fetch 1,mem_dg_mouse_connected_status
+	store 1,mem_usb0_get_report_data+4
+
+	fetch 1,mem_dg_usb_driver_set_end
+	store 1,mem_usb0_get_report_data+5
+
+	fetch 4,mem_24g_addr
+	store 4,mem_usb0_get_report_data+8
+	branch dongle_usb0_data_ready_report_set1
+	
+p_dongle_dispose_cmd_set:
+	fetch 1,mem_usb0_set_report_data+2		//0x0a--keyboard, 0x05--mouse
+	store 1,mem_dg_data_type
+	branch dongle_usb0_data_ready_report_set0
+
+p_dongle_dispose_cmd_get_in_data:
+	jam 0,mem_usb0_set_report_data
+	arg mem_dg_usb_get_buff,contr
+	arg mem_usb0_get_report_data,contw
+	arg 64,loopcnt
+	call memcpy_fast
+	branch dongle_usb0_data_ready_report_set0
+
+p_dongle_dispose_cmd_get_translen:
+	fetch 1,mem_usb0_set_report_data+2
+	store 1,mem_dg_data_len
+	branch dongle_usb0_data_ready_report_set0
+
+p_dongle_dispose_cmd_set_test:
+	jam DONGLE_TEST,mem_24g_work_mode
+	jam CLEAR_INIT,mem_24g_mode_init	
+	fetch 1,mem_usb0_set_report_data+2
+	store 1,mem_dg_test_mode
+	fetch 1,mem_usb0_set_report_data+3
+	store 1,mem_dg_test_ch
 	
+	jam 0x01,mem_usb0_get_report_data+1
+	branch dongle_usb0_data_ready_report_set1
 
 	
 ifdef UART_LOG
Index: sched/dongle.dat
===================================================================
--- /branch/keyboard/customer_FW/RY_project/RY_Dongle/sched/dongle.dat	(revision 1949)
+++ /branch/keyboard/customer_FW/RY_project/RY_Dongle/sched/dongle.dat	(working copy)
@@ -75,3 +75,8 @@
 #mem_device_uart_tx_buffer:00 4f
 #mem_device_uart_tx_buffer_end:ff 4f
 
+
+mem_dg_usb_driver_set_end:01  #01--finished, 00--sending
+
+
+
