Index: format/app_mouse.format
===================================================================
--- /1306ac/branch/mouse/branch/XZR_Project/Only_24G_LM_DPI_CM9079/format/app_mouse.format	(revision 460)
+++ /1306ac/branch/mouse/branch/XZR_Project/Only_24G_LM_DPI_CM9079/format/app_mouse.format	(working copy)
@@ -405,6 +405,13 @@
 1 mem_commbination_dpi_timer
 1 mem_mouse_commbination_key_dpi
 
+//OM16
+0 mem_om16_dpi
+1 mem_om16_dpi_0
+1 mem_om16_dpi_1
+1 mem_om16_dpi_2
+1 mem_om16_dpi_3
+
 )
 
 
@@ -574,7 +581,7 @@
 0x50 P6520A_ID2
 0x58 PKA8G2_ID1
 0x59 PKA8G2_ID2
-
+0x52 OM16_ID2
 
 //Sensor type
 0X00 P3205
@@ -589,7 +596,7 @@
 0X09 KA8_UL
 0X0a KA8_HD
 0X0b KA8G2
-
+0X0c OM16
 
 //SENSOR REG
 0x00 PAN_REG_PID_L
Index: output/eeprom.dat
===================================================================
--- /1306ac/branch/mouse/branch/XZR_Project/Only_24G_LM_DPI_CM9079/output/eeprom.dat	(revision 460)
+++ /1306ac/branch/mouse/branch/XZR_Project/Only_24G_LM_DPI_CM9079/output/eeprom.dat	(working copy)
@@ -2,52 +2,72 @@
 02
 aa
 55
-76
-03
+36
+04
 c2
 84
 00
-0c
+11
 c0
 1e
 80
-51
+56
 c0
 23
 00
-63
+68
+c0
+21
+00
+96
+c0
+22
+00
+82
+c0
+23
+80
+73
+c0
+24
+00
+76
+c0
+24
+80
+91
 c0
 26
 00
-6e
+9e
 c0
 27
 00
-93
+c3
 c0
 29
 00
-b5
+e5
 c0
 2d
 00
-46
+4b
 c0
 2f
 00
-31
+36
 c0
 2f
 80
-35
+3a
 c0
 38
 00
-0f
+14
 c0
 71
 80
-4c
+51
 20
 20
 3a
@@ -55,7 +75,7 @@
 c0
 30
 80
-5a
+5f
 c1
 7f
 80
@@ -75,7 +95,7 @@
 20
 40
 00
-1a
+1f
 20
 40
 57
@@ -94,8 +114,8 @@
 bd
 20
 40
-56
-2e
+00
+84
 20
 40
 5c
@@ -103,7 +123,7 @@
 20
 40
 00
-39
+3e
 20
 20
 52
@@ -123,7 +143,7 @@
 20
 40
 00
-cb
+fb
 d8
 40
 00
@@ -155,7 +175,7 @@
 20
 22
 80
-2b
+30
 20
 40
 5b
@@ -179,7 +199,7 @@
 20
 40
 00
-2e
+33
 70
 45
 e5
@@ -243,7 +263,7 @@
 58
 00
 00
-3e
+43
 67
 e1
 45
@@ -303,7 +323,7 @@
 24
 5a
 00
-44
+49
 20
 20
 5e
@@ -315,7 +335,7 @@
 c2
 80
 80
-4f
+54
 20
 20
 3c
@@ -339,7 +359,7 @@
 c0
 00
 80
-55
+5a
 70
 80
 70
@@ -444,6 +464,178 @@
 20
 57
 3f
+20
+40
+54
+90
+20
+75
+80
+00
+20
+40
+58
+38
+20
+40
+57
+af
+c0
+18
+00
+7d
+c0
+18
+d8
+17
+c0
+2c
+58
+20
+20
+40
+57
+ac
+20
+00
+1a
+f4
+20
+20
+00
+76
+6f
+e0
+c6
+6f
+c0
+29
+00
+80
+20
+20
+57
+b7
+70
+45
+d4
+0c
+20
+60
+00
+00
+20
+40
+56
+2f
+20
+40
+5e
+bd
+6f
+e0
+c5
+d4
+c0
+06
+00
+87
+20
+20
+56
+39
+6f
+e0
+c6
+3f
+c0
+00
+00
+8d
+c0
+00
+80
+8b
+c0
+01
+00
+8f
+68
+48
+c9
+17
+20
+20
+56
+47
+68
+48
+c9
+16
+20
+20
+56
+47
+68
+48
+c9
+18
+20
+20
+56
+47
+20
+40
+54
+90
+20
+40
+58
+2b
+20
+40
+58
+33
+20
+40
+57
+e6
+20
+20
+00
+84
+78
+54
+7c
+00
+58
+00
+00
+00
+67
+e3
+45
+79
+20
+40
+58
+47
+58
+00
+00
+89
+20
+40
+67
+4d
+20
+40
+00
+84
+20
+20
+54
+a3
 1a
 62
 7e
@@ -451,15 +643,15 @@
 c0
 1c
 80
-73
+a3
 c0
 1e
 00
-75
+a5
 c0
 1d
 00
-82
+b2
 20
 20
 59
@@ -543,11 +735,11 @@
 c0
 02
 00
-89
+b9
 c0
 01
 80
-8e
+be
 20
 20
 5d
@@ -615,7 +807,7 @@
 20
 40
 00
-a3
+d3
 20
 40
 5e
@@ -651,7 +843,7 @@
 20
 40
 00
-b1
+e1
 20
 20
 5a
@@ -691,7 +883,7 @@
 20
 22
 80
-ae
+de
 70
 49
 14
@@ -746,8 +938,8 @@
 00
 20
 40
-00
-d7
+01
+07
 6f
 e2
 49
@@ -755,7 +947,7 @@
 20
 3a
 00
-c3
+f3
 67
 e2
 49
@@ -783,7 +975,7 @@
 20
 20
 00
-b9
+e9
 6f
 e2
 49
@@ -826,16 +1018,16 @@
 00
 20
 40
-00
-d7
+01
+07
 6f
 e2
 49
 0d
 20
 3a
-00
-da
+01
+0a
 67
 e2
 49
@@ -854,8 +1046,8 @@
 00
 24
 21
-00
-da
+01
+0a
 1a
 42
 7e
@@ -863,7 +1055,7 @@
 20
 20
 00
-cd
+fd
 d8
 40
 00
@@ -888,8 +1080,8 @@
 60
 00
 00
-10
-59
+84
+04
 aa
 55
 06
@@ -916,8 +1108,8 @@
 07
 40
 20
-40
-50
+d4
+53
 04
 c4
 00
@@ -1431,7 +1623,7 @@
 00
 aa
 55
-05
+09
 00
 11
 49
@@ -1440,11 +1632,15 @@
 00
 00
 05
+07
+05
+04
+06
 55
 aa
 aa
 55
-15
+c6
 a7
-36
-93
+9e
+ae
Index: output/memmap.format
===================================================================
--- /1306ac/branch/mouse/branch/XZR_Project/Only_24G_LM_DPI_CM9079/output/memmap.format	(revision 460)
+++ /1306ac/branch/mouse/branch/XZR_Project/Only_24G_LM_DPI_CM9079/output/memmap.format	(working copy)
@@ -1689,6 +1689,11 @@
 0x4913 mem_mouse_commbination_dpi_check_enable
 0x4914 mem_commbination_dpi_timer
 0x4915 mem_mouse_commbination_key_dpi
+0x4916 mem_om16_dpi
+0x4916 mem_om16_dpi_0
+0x4917 mem_om16_dpi_1
+0x4918 mem_om16_dpi_2
+0x4919 mem_om16_dpi_3
 0x443c mem_shutter_bluetooth_type
 0x443d mem_shutter_config_eeprom_offset_addr
 0x443f mem_shutter_config_eeprom_start_flag
Index: output/program.lis
===================================================================
--- /1306ac/branch/mouse/branch/XZR_Project/Only_24G_LM_DPI_CM9079/output/program.lis	(revision 460)
+++ /1306ac/branch/mouse/branch/XZR_Project/Only_24G_LM_DPI_CM9079/output/program.lis	(working copy)
@@ -1,306 +1,380 @@
               include "bt_format "
               org 0x0000
-0000 c284000c bbit1 8 ,pf_patch_ext 
-0001 c01e8051 beq patch07_5 ,p_mouse_setgpio_hibernate 
-0002 c0230063 beq patch08_6 ,p_mouse_3io6key_check 
-0003 c026006e beq patch09_4 ,p_mouse_priority_bb_event 
-0004 c0270093 beq patch09_6 ,p_mouse_bb_event_timer 
-0005 c02900b5 beq patch0a_2 ,p_mouse_store_device_info 
-0006 c02d0046 beq patch0b_2 ,p_mouse_24g_package_data 
-0007 c02f0031 beq patch0b_6 ,p_mouse_ui_led_off_static 
-0008 c02f8035 beq patch0b_7 ,p_mouse_ui_led_on_static 
-0009 c038000f beq patch0e_0 ,p_app_init 
-000a c071804c beq patch1c_3 ,p_le_enable_phy_by_pdata 
-000b 20203a8a branch assert 
+0000 c2840011 bbit1 8 ,pf_patch_ext 
+0001 c01e8056 beq patch07_5 ,p_mouse_setgpio_hibernate 
+0002 c0230068 beq patch08_6 ,p_mouse_3io6key_check 
+0003 c0210096 beq patch08_2 ,p_mouse_motion 
+0004 c0220082 beq patch08_4 ,p_mouse_setting_dpi 
+0005 c0238073 beq patch08_7 ,p_mouse_init_sunt 
+0006 c0240076 beq patch09_0 ,p_mouse_init_sensor 
+0007 c0248091 beq patch09_1 ,p_mouse_sensor_poweron 
+0008 c026009e beq patch09_4 ,p_mouse_priority_bb_event 
+0009 c02700c3 beq patch09_6 ,p_mouse_bb_event_timer 
+000a c02900e5 beq patch0a_2 ,p_mouse_store_device_info 
+000b c02d004b beq patch0b_2 ,p_mouse_24g_package_data 
+000c c02f0036 beq patch0b_6 ,p_mouse_ui_led_off_static 
+000d c02f803a beq patch0b_7 ,p_mouse_ui_led_on_static 
+000e c0380014 beq patch0e_0 ,p_app_init 
+000f c0718051 beq patch1c_3 ,p_le_enable_phy_by_pdata 
+0010 20203a8a branch assert 
 
 pf_patch_ext:
-000c c030805a beq patch2c_1 ,p_g24_lpm_wait 
-000d c17f8000 rtneq patch3f_7 
-000e 20203a8a branch assert 
+0011 c030805f beq patch2c_1 ,p_g24_lpm_wait 
+0012 c17f8000 rtneq patch3f_7 
+0013 20203a8a branch assert 
 
 p_app_init:
 
 p_mouse_init:
-000f 70808073 jam 0x73 ,core_spid_ctrl 
-0010 20406eb3 call enable_authrom 
-0011 2040001a call p_mouse_setting_config 
-0012 204057a0 call mouse_init_sunt 
-0013 20758000 rtn wake 
-0014 70491300 jam 0 ,mem_mouse_commbination_dpi_check_enable 
-0015 204059bd call mouse_le_name_load 
-0016 2040562e call mouse_dpi_config 
-0017 20405cc5 call mouse_drawing_optima_init 
-0018 20400039 call p_mouse_cb_fuction 
-0019 20205234 branch mouse_init + 8 
+0014 70808073 jam 0x73 ,core_spid_ctrl 
+0015 20406eb3 call enable_authrom 
+0016 2040001f call p_mouse_setting_config 
+0017 204057a0 call mouse_init_sunt 
+0018 20758000 rtn wake 
+0019 70491300 jam 0 ,mem_mouse_commbination_dpi_check_enable 
+001a 204059bd call mouse_le_name_load 
+001b 20400084 call p_mouse_setting_sensor_type 
+001c 20405cc5 call mouse_drawing_optima_init 
+001d 2040003e call p_mouse_cb_fuction 
+001e 20205234 branch mouse_init + 8 
 
 p_mouse_setting_config:
-001a 20758000 rtn wake 
-001b 2040525e call mouse_setting_config 
-001c c40b8000 rtnbit0 mouse_enable_otp 
+001f 20758000 rtn wake 
+0020 2040525e call mouse_setting_config 
+0021 c40b8000 rtnbit0 mouse_enable_otp 
 
 p_mouse_load_otp_info_check:
-001d 204000cb call p_mouse_read_otp_24g_addr 
+0022 204000fb call p_mouse_read_otp_24g_addr 
 
 p_mouse_otp_load_app_initflag:
-001e d8400002 arg 2 ,temp 
-001f dfe007ee arg otp_offset_app_initlag ,pdata 
-0020 da20463d arg mem_store_flag ,rega 
-0021 204068c5 call otpd_read_data_with_pwr_operation 
-0022 6fe1463d fetch 2 ,mem_store_flag 
-0023 d840aa55 arg eeprom_init_flag ,temp 
-0024 98467c00 isub temp ,null 
-0025 2022802b branch p_mouse_load_device_info ,zero 
-0026 20405b76 call mouse_app_initflag_check + 4 
+0023 d8400002 arg 2 ,temp 
+0024 dfe007ee arg otp_offset_app_initlag ,pdata 
+0025 da20463d arg mem_store_flag ,rega 
+0026 204068c5 call otpd_read_data_with_pwr_operation 
+0027 6fe1463d fetch 2 ,mem_store_flag 
+0028 d840aa55 arg eeprom_init_flag ,temp 
+0029 98467c00 isub temp ,null 
+002a 20228030 branch p_mouse_load_device_info ,zero 
+002b 20405b76 call mouse_app_initflag_check + 4 
 
 p_mouse_otp_store_app_initflag:
-0027 df200002 arg 2 ,loopcnt 
-0028 da20463d arg mem_store_flag ,rega 
-0029 dfe007ee arg otp_offset_app_initlag ,pdata 
-002a 20206883 branch otp_write 
+002c df200002 arg 2 ,loopcnt 
+002d da20463d arg mem_store_flag ,rega 
+002e dfe007ee arg otp_offset_app_initlag ,pdata 
+002f 20206883 branch otp_write 
 
 p_mouse_load_device_info:
-002b 2040002e call p_mouse_load_default_dpi 
-002c 7045e500 jam mode_24g_device ,mem_device_flag 
-002d 20205b81 branch mouse_load_device_info + 1 
+0030 20400033 call p_mouse_load_default_dpi 
+0031 7045e500 jam mode_24g_device ,mem_device_flag 
+0032 20205b81 branch mouse_load_device_info + 1 
 
 p_mouse_load_default_dpi:
-002e 6fe0c5c0 fetch 1 ,mem_config_sensor_dpi 
-002f 67e0c63f store 1 ,mem_mouse_dpi 
-0030 20600000 rtn 
+0033 6fe0c5c0 fetch 1 ,mem_config_sensor_dpi 
+0034 67e0c63f store 1 ,mem_mouse_dpi 
+0035 20600000 rtn 
 
 p_mouse_ui_led_off_static:
-0031 18427e00 copy temp ,pdata 
-0032 207a0000 rtn blank 
-0033 c17f8000 rtneq gpio_disable 
-0034 20205f23 branch mouse_ui_led_off_static + 1 
+0036 18427e00 copy temp ,pdata 
+0037 207a0000 rtn blank 
+0038 c17f8000 rtneq gpio_disable 
+0039 20205f23 branch mouse_ui_led_off_static + 1 
 
 p_mouse_ui_led_on_static:
-0035 18427e00 copy temp ,pdata 
-0036 207a0000 rtn blank 
-0037 c17f8000 rtneq gpio_disable 
-0038 20205f30 branch mouse_ui_led_on_static + 1 
+003a 18427e00 copy temp ,pdata 
+003b 207a0000 rtn blank 
+003c c17f8000 rtneq gpio_disable 
+003d 20205f30 branch mouse_ui_led_on_static + 1 
 
 p_mouse_cb_fuction:
-0039 58005fad setarg mouse_24g_short_sleep 
-003a 67e14543 store 2 ,mem_cb_24g_transmit_short_sleep 
-003b 5800003e setarg p_mouse_24g_long_sleep 
-003c 67e14545 store 2 ,mem_cb_24g_transmit_long_sleep 
-003d 2020523d branch mouse_cb_fuction + 4 
+003e 58005fad setarg mouse_24g_short_sleep 
+003f 67e14543 store 2 ,mem_cb_24g_transmit_short_sleep 
+0040 58000043 setarg p_mouse_24g_long_sleep 
+0041 67e14545 store 2 ,mem_cb_24g_transmit_long_sleep 
+0042 2020523d branch mouse_cb_fuction + 4 
 
 p_mouse_24g_long_sleep:
-003e 20404d15 call g24_lpm_wait 
-003f 24740000 nrtn user 
-0040 6fe0c863 fetch 1 ,mem_24g_device_led_status 
-0041 247a0000 nrtn blank 
-0042 70490501 jam 1 ,mem_mouse_24g_long_sleep_flag 
-0043 20205fa6 branch mouse_24g_long_sleep + 4 
+0043 20404d15 call g24_lpm_wait 
+0044 24740000 nrtn user 
+0045 6fe0c863 fetch 1 ,mem_24g_device_led_status 
+0046 247a0000 nrtn blank 
+0047 70490501 jam 1 ,mem_mouse_24g_long_sleep_flag 
+0048 20205fa6 branch mouse_24g_long_sleep + 4 
 
 p_mouse_24g_short_sleep_clear_wake:
-0044 204074e0 call clear_wake 
-0045 20203c18 branch lpm_write_gpio_wakeup 
+0049 204074e0 call clear_wake 
+004a 20203c18 branch lpm_write_gpio_wakeup 
 
 p_mouse_24g_package_data:
-0046 2040549b call mouse_motion 
-0047 24740000 nrtn user 
-0048 6fe0c905 fetch 1 ,mem_mouse_24g_long_sleep_flag 
-0049 70490500 jam 0 ,mem_mouse_24g_long_sleep_flag 
-004a 245a0044 ncall p_mouse_24g_short_sleep_clear_wake ,blank 
-004b 20205e35 branch mouse_24g_package_data + 4 
+004b 2040549b call mouse_motion 
+004c 24740000 nrtn user 
+004d 6fe0c905 fetch 1 ,mem_mouse_24g_long_sleep_flag 
+004e 70490500 jam 0 ,mem_mouse_24g_long_sleep_flag 
+004f 245a0049 ncall p_mouse_24g_short_sleep_clear_wake ,blank 
+0050 20205e35 branch mouse_24g_package_data + 4 
 
 p_le_enable_phy_by_pdata:
-004c 18427e00 copy temp ,pdata 
-004d c280804f bbit1 bit_le_2m_phy ,p_le_enable_2m 
-004e 20203ce3 branch le_enable_phy_by_pdata + 3 
+0051 18427e00 copy temp ,pdata 
+0052 c2808054 bbit1 bit_le_2m_phy ,p_le_enable_2m 
+0053 20203ce3 branch le_enable_phy_by_pdata + 3 
 
 p_le_enable_2m:
-004f 708a6d89 jam 0x89 ,core_rx_bq_cfg0 
-0050 20203ce9 branch le_enable_2m 
+0054 708a6d89 jam 0x89 ,core_rx_bq_cfg0 
+0055 20203ce9 branch le_enable_2m 
 
 p_mouse_setgpio_hibernate:
-0051 20405339 call mouse_setgpio_hibernate + 1 
-0052 6fe0c912 fetch 1 ,mem_mouse_logo_enable_gpio0 
-0053 c0008055 beq 1 ,p_mouse_setgpio_hibernate_next 
-0054 70807080 jam 0x80 ,0x8070 
+0056 20405339 call mouse_setgpio_hibernate + 1 
+0057 6fe0c912 fetch 1 ,mem_mouse_logo_enable_gpio0 
+0058 c000805a beq 1 ,p_mouse_setgpio_hibernate_next 
+0059 70807080 jam 0x80 ,0x8070 
 
 p_mouse_setgpio_hibernate_next:
-0055 6fe08017 fetch 1 ,mem_gpio_wakeup_low + 1 
-0056 79207e05 set1 5 ,pdata 
-0057 67e08017 store 1 ,mem_gpio_wakeup_low + 1 
-0058 20403c18 call lpm_write_gpio_wakeup 
-0059 20205af0 branch mouse_1io2led_all_off 
+005a 6fe08017 fetch 1 ,mem_gpio_wakeup_low + 1 
+005b 79207e05 set1 5 ,pdata 
+005c 67e08017 store 1 ,mem_gpio_wakeup_low + 1 
+005d 20403c18 call lpm_write_gpio_wakeup 
+005e 20205af0 branch mouse_1io2led_all_off 
 
 p_g24_lpm_wait:
-005a 78347c00 enable user 
-005b 20403b1b call lpo_calibration 
-005c 6fe1c0be fetch 3 ,mem_clks_per_lpo 
-005d 203a74ca branch disable_user ,blank 
-005e 6fe0c094 fetch 1 ,mem_lpm_mode 
-005f 203a74ca branch disable_user ,blank 
-0060 6fe0c899 fetch 1 ,mem_sensor_shutdown_flag 
-0061 247a0000 nrtn blank 
-0062 20204d1c branch g24_lpm_wait_next 
+005f 78347c00 enable user 
+0060 20403b1b call lpo_calibration 
+0061 6fe1c0be fetch 3 ,mem_clks_per_lpo 
+0062 203a74ca branch disable_user ,blank 
+0063 6fe0c094 fetch 1 ,mem_lpm_mode 
+0064 203a74ca branch disable_user ,blank 
+0065 6fe0c899 fetch 1 ,mem_sensor_shutdown_flag 
+0066 247a0000 nrtn blank 
+0067 20204d1c branch g24_lpm_wait_next 
 
 p_mouse_3io6key_check:
-0063 1a627e00 copy regc ,pdata 
-0064 67e0c850 store 1 ,mem_mouse_key_status 
-0065 1fe3fe00 lshift pdata ,pdata 
-0066 1fe22400 copy pdata ,regb 
-0067 18422600 copy temp ,regc 
-0068 2040547b call mouse_gpio_config_input_pd 
-0069 1a620400 copy regc ,temp 
-006a 20406b85 call gpio_get_bit 
-006b 7d20a400 nsetflag true ,0 ,regb 
-006c 20405753 call mouse_check_press 
-006d 2020573f branch mouse_check_key_connect_gnd_1 
+0068 1a627e00 copy regc ,pdata 
+0069 67e0c850 store 1 ,mem_mouse_key_status 
+006a 1fe3fe00 lshift pdata ,pdata 
+006b 1fe22400 copy pdata ,regb 
+006c 18422600 copy temp ,regc 
+006d 2040547b call mouse_gpio_config_input_pd 
+006e 1a620400 copy regc ,temp 
+006f 20406b85 call gpio_get_bit 
+0070 7d20a400 nsetflag true ,0 ,regb 
+0071 20405753 call mouse_check_press 
+0072 2020573f branch mouse_check_key_connect_gnd_1 
+
+p_mouse_init_sunt:
+0073 20405490 call mouse_sensor_spi_init 
+0074 20758000 rtn wake 
+
+p_mouse_init_sensor_wakeup:
+0075 20405838 call mouse_sensor_poweron 
+
+p_mouse_init_sensor:
+0076 204057af call mouse_read_sensor_id 
+0077 c018007d beq p32xx_id1 ,p_mouse_init_p32xx_id2_judge 
+0078 c018d817 beq p3065_id1 ,mouse_init_p3065 
+0079 c02c5820 beq pka8g2_id1 ,mouse_ka8g2_id2_judge 
+007a 204057ac call mouse_twspi_reset 
+007b 20001af4 nop 6900 
+007c 20200076 branch p_mouse_init_sensor 
+
+p_mouse_init_p32xx_id2_judge:
+007d 6fe0c66f fetch 1 ,mem_sensor_id2 
+007e c0290080 beq om16_id2 ,p_mouse_om16_init_param 
+007f 202057b7 branch mouse_init_p32xx_id2_judge + 1 
+
+p_mouse_om16_init_param:
+0080 7045d40c jam om16 ,mem_config_sensor_type 
+0081 20600000 rtn 
+
+p_mouse_setting_dpi:
+0082 2040562f call mouse_setting_dpi_4_level 
+0083 20405ebd call mouse_dpi_led_blink_delay 
+
+p_mouse_setting_sensor_type:
+0084 6fe0c5d4 fetch 1 ,mem_config_sensor_type 
+0085 c0060087 beq om16 ,p_mouse_seting_om16_dpi 
+0086 20205639 branch mouse_setting_sensor_type + 1 
+
+p_mouse_seting_om16_dpi:
+0087 6fe0c63f fetch 1 ,mem_mouse_dpi 
+0088 c000008d beq mouse_dpi_level1 ,p_mouse_om16_set_cpi0 
+0089 c000808b beq mouse_dpi_level2 ,p_mouse_om16_set_cpi1 
+008a c001008f beq mouse_dpi_level3 ,p_mouse_om16_set_cpi2 
+
+p_mouse_om16_set_cpi1:
+008b 6848c917 fetcht 1 ,mem_om16_dpi_1 
+008c 20205647 branch mouse_dpi_store 
+
+p_mouse_om16_set_cpi0:
+008d 6848c916 fetcht 1 ,mem_om16_dpi_0 
+008e 20205647 branch mouse_dpi_store 
+
+p_mouse_om16_set_cpi2:
+008f 6848c918 fetcht 1 ,mem_om16_dpi_2 
+0090 20205647 branch mouse_dpi_store 
+
+p_mouse_sensor_poweron:
+0091 20405490 call mouse_sensor_spi_init 
+0092 2040582b call mouse_sensor_reset 
+0093 20405833 call mouse_sensor_poweron_init 
+0094 204057e6 call mouse_sensor_wr_seq 
+0095 20200084 branch p_mouse_setting_sensor_type 
+
+p_mouse_motion:
+0096 78547c00 disable user 
+0097 58000000 setarg 0 
+0098 67e34579 store 6 ,mem_mouse_x 
+0099 20405847 call mouse_check_sensor_data 
+009a 58000089 setarg 0x0089 
+009b 2040674d call twspi_write 
+009c 20400084 call p_mouse_setting_sensor_type 
+009d 202054a3 branch mouse_motion + 8 
 
 p_mouse_priority_bb_event:
-006e 1a627e00 copy regc ,pdata 
-006f c01c8073 beq bt_evt_24g_pairing_complete ,p_mouse_24g_pairing_complete 
-0070 c01e0075 beq bt_evt_24g_attempt_success ,p_mouse_24g_attempt_success 
-0071 c01d0082 beq bt_evt_24g_attempt_fail ,p_mouse_24g_attempt_fail 
-0072 20205914 branch mouse_priority_bb_event + 2 
+009e 1a627e00 copy regc ,pdata 
+009f c01c80a3 beq bt_evt_24g_pairing_complete ,p_mouse_24g_pairing_complete 
+00a0 c01e00a5 beq bt_evt_24g_attempt_success ,p_mouse_24g_attempt_success 
+00a1 c01d00b2 beq bt_evt_24g_attempt_fail ,p_mouse_24g_attempt_fail 
+00a2 20205914 branch mouse_priority_bb_event + 2 
 
 p_mouse_24g_pairing_complete:
-0073 70491301 jam 1 ,mem_mouse_commbination_dpi_check_enable 
-0074 20205e21 branch mouse_24g_pairing_complete 
+00a3 70491301 jam 1 ,mem_mouse_commbination_dpi_check_enable 
+00a4 20205e21 branch mouse_24g_pairing_complete 
 
 p_mouse_24g_attempt_success:
-0075 70491301 jam 1 ,mem_mouse_commbination_dpi_check_enable 
-0076 6fe244da fetch 4 ,mem_24g_addr 
-0077 67e24533 store 4 ,mem_24g_receiver_addr 
-0078 67e24640 store 4 ,mem_mouse_24g_addr 
-0079 20404bce call g24_ch_syncword_crc8_init 
-007a 20405e1b call mouse_device_poweron_led_config 
-007b 20405aa9 call mouse_no_data_timer_init 
-007c 204058c4 call mouse_init_sensor_reset 
-007d 70476800 jam 0 ,mem_mouse_long_mult_flag 
-007e 70454700 jam 0 ,mem_24g_conn_sm 
-007f 70452d00 jam 0 ,mem_24g_reconn_type 
-0080 684a4533 fetcht 4 ,mem_24g_receiver_addr 
-0081 20205e17 branch mouse_24g_attempt_success + 11 
+00a5 70491301 jam 1 ,mem_mouse_commbination_dpi_check_enable 
+00a6 6fe244da fetch 4 ,mem_24g_addr 
+00a7 67e24533 store 4 ,mem_24g_receiver_addr 
+00a8 67e24640 store 4 ,mem_mouse_24g_addr 
+00a9 20404bce call g24_ch_syncword_crc8_init 
+00aa 20405e1b call mouse_device_poweron_led_config 
+00ab 20405aa9 call mouse_no_data_timer_init 
+00ac 204058c4 call mouse_init_sensor_reset 
+00ad 70476800 jam 0 ,mem_mouse_long_mult_flag 
+00ae 70454700 jam 0 ,mem_24g_conn_sm 
+00af 70452d00 jam 0 ,mem_24g_reconn_type 
+00b0 684a4533 fetcht 4 ,mem_24g_receiver_addr 
+00b1 20205e17 branch mouse_24g_attempt_success + 11 
 
 p_mouse_24g_attempt_fail:
-0082 6fe0c54b fetch 1 ,mem_24g_attempt_fail_flag 
-0083 243a5d80 nbranch mouse_24g_hibernate_set ,blank 
-0084 6fe0c52d fetch 1 ,mem_24g_reconn_type 
-0085 c0015df4 beq fast_conn_and_3_0_addr ,mouse_24g_fast_conn_attempt_fail 
-0086 c0020089 beq pair_and_3_0_addr ,p_mouse_24g_auto_pair_attempt_fail 
-0087 c001808e beq receiver_and_3_0_addr ,p_mouse_reconn_dongle_attempt_fail 
-0088 20205ded branch mouse_24g_attempt_fail_enter_hibernate_next 
+00b2 6fe0c54b fetch 1 ,mem_24g_attempt_fail_flag 
+00b3 243a5d80 nbranch mouse_24g_hibernate_set ,blank 
+00b4 6fe0c52d fetch 1 ,mem_24g_reconn_type 
+00b5 c0015df4 beq fast_conn_and_3_0_addr ,mouse_24g_fast_conn_attempt_fail 
+00b6 c00200b9 beq pair_and_3_0_addr ,p_mouse_24g_auto_pair_attempt_fail 
+00b7 c00180be beq receiver_and_3_0_addr ,p_mouse_reconn_dongle_attempt_fail 
+00b8 20205ded branch mouse_24g_attempt_fail_enter_hibernate_next 
 
 p_mouse_24g_auto_pair_attempt_fail:
-0089 6fe44864 fetch mouse_flag_len ,mem_mouse_flag 
-008a c317dded bbit0 mouse_enable_24g_first_auto_pairing ,mouse_24g_attempt_fail_enter_hibernate_next 
-008b 6fe0c86c fetch 1 ,mem_device_number 
-008c c000dded beq 1 ,mouse_24g_attempt_fail_enter_hibernate_next 
-008d 20205dcb branch mouse_24g_first_bluetooth_reconnect 
+00b9 6fe44864 fetch mouse_flag_len ,mem_mouse_flag 
+00ba c317dded bbit0 mouse_enable_24g_first_auto_pairing ,mouse_24g_attempt_fail_enter_hibernate_next 
+00bb 6fe0c86c fetch 1 ,mem_device_number 
+00bc c000dded beq 1 ,mouse_24g_attempt_fail_enter_hibernate_next 
+00bd 20205dcb branch mouse_24g_first_bluetooth_reconnect 
 
 p_mouse_reconn_dongle_attempt_fail:
-008e 6fe44864 fetch mouse_flag_len ,mem_mouse_flag 
-008f c317dded bbit0 mouse_enable_24g_first_auto_pairing ,mouse_24g_attempt_fail_enter_hibernate_next 
-0090 c289dded bbit1 mouse_enable_eeprom ,mouse_24g_attempt_fail_enter_hibernate_next 
-0091 c2895ded bbit1 mouse_enable_flash ,mouse_24g_attempt_fail_enter_hibernate_next 
-0092 20205dc4 branch mouse_24g_start_auto_pair + 1 
+00be 6fe44864 fetch mouse_flag_len ,mem_mouse_flag 
+00bf c317dded bbit0 mouse_enable_24g_first_auto_pairing ,mouse_24g_attempt_fail_enter_hibernate_next 
+00c0 c289dded bbit1 mouse_enable_eeprom ,mouse_24g_attempt_fail_enter_hibernate_next 
+00c1 c2895ded bbit1 mouse_enable_flash ,mouse_24g_attempt_fail_enter_hibernate_next 
+00c2 20205dc4 branch mouse_24g_start_auto_pair + 1 
 
 p_mouse_bb_event_timer:
-0093 204053c6 call mouse_adc_read 
-0094 20405f47 call mouse_low_voltage_led_timer 
-0095 20404907 call g24_pair_timeout_timer 
-0096 20404ba5 call g24_reconn_timeout_timer 
-0097 20405d6b call mouse_24g_long_sleep_param_update_timer 
-0098 204000a3 call p_mouse_commbination_dpi_check_timer 
-0099 20405e9a call mouse_device_poweron_timer 
-009a 20405ecb call mouse_dpi_led_blink_delay_timer 
-009b 20405ac1 call mouse_led_multi_timer 
-009c 20405af3 call mouse_logo_led_on_timer 
-009d 2040561c call mouse_dpi_key_check_long_press 
-009e 20405a36 call mouse_bt_discovery_check 
-009f 20405a46 call mouse_commbination_key_process 
-00a0 20405a69 call mouse_check_discovery_timeout_timer 
-00a1 204000b1 call p_mouse_check_direct_timeout_timer 
-00a2 20205a2d branch mouse_bb_event_timer + 15 
+00c3 204053c6 call mouse_adc_read 
+00c4 20405f47 call mouse_low_voltage_led_timer 
+00c5 20404907 call g24_pair_timeout_timer 
+00c6 20404ba5 call g24_reconn_timeout_timer 
+00c7 20405d6b call mouse_24g_long_sleep_param_update_timer 
+00c8 204000d3 call p_mouse_commbination_dpi_check_timer 
+00c9 20405e9a call mouse_device_poweron_timer 
+00ca 20405ecb call mouse_dpi_led_blink_delay_timer 
+00cb 20405ac1 call mouse_led_multi_timer 
+00cc 20405af3 call mouse_logo_led_on_timer 
+00cd 2040561c call mouse_dpi_key_check_long_press 
+00ce 20405a36 call mouse_bt_discovery_check 
+00cf 20405a46 call mouse_commbination_key_process 
+00d0 20405a69 call mouse_check_discovery_timeout_timer 
+00d1 204000e1 call p_mouse_check_direct_timeout_timer 
+00d2 20205a2d branch mouse_bb_event_timer + 15 
 
 p_mouse_commbination_dpi_check_timer:
-00a3 6fe0c915 fetch 1 ,mem_mouse_commbination_key_dpi 
-00a4 c17f8000 rtneq gpio_disable 
-00a5 6fe0c913 fetch 1 ,mem_mouse_commbination_dpi_check_enable 
-00a6 207a0000 rtn blank 
-00a7 204056b9 call mouse_check_key_gpio 
-00a8 1fe17e07 and pdata ,0x07 ,pdata 
-00a9 6848c915 fetcht 1 ,mem_mouse_commbination_key_dpi 
-00aa 98467c00 isub temp ,null 
-00ab 202280ae branch p_mouse_commbination_dpi_check ,zero 
-00ac 70491401 jam 0x01 ,mem_commbination_dpi_timer 
-00ad 20600000 rtn 
+00d3 6fe0c915 fetch 1 ,mem_mouse_commbination_key_dpi 
+00d4 c17f8000 rtneq gpio_disable 
+00d5 6fe0c913 fetch 1 ,mem_mouse_commbination_dpi_check_enable 
+00d6 207a0000 rtn blank 
+00d7 204056b9 call mouse_check_key_gpio 
+00d8 1fe17e07 and pdata ,0x07 ,pdata 
+00d9 6848c915 fetcht 1 ,mem_mouse_commbination_key_dpi 
+00da 98467c00 isub temp ,null 
+00db 202280de branch p_mouse_commbination_dpi_check ,zero 
+00dc 70491401 jam 0x01 ,mem_commbination_dpi_timer 
+00dd 20600000 rtn 
 
 p_mouse_commbination_dpi_check:
-00ae da604914 arg mem_commbination_dpi_timer ,regc 
-00af da4055e5 arg mouse_dpi_process + 3 ,regb 
-00b0 20204dcc branch timer_single_step 
+00de da604914 arg mem_commbination_dpi_timer ,regc 
+00df da4055e5 arg mouse_dpi_process + 3 ,regb 
+00e0 20204dcc branch timer_single_step 
 
 p_mouse_check_direct_timeout_timer:
-00b1 da604831 arg mem_mouse_direct_timer ,regc 
-00b2 da405a74 arg mouse_check_direct_timeout ,regb 
-00b3 20404dcc call timer_single_step 
-00b4 20205a71 branch mouse_check_direct_timeout_timer + 3 
+00e1 da604831 arg mem_mouse_direct_timer ,regc 
+00e2 da405a74 arg mouse_check_direct_timeout ,regb 
+00e3 20404dcc call timer_single_step 
+00e4 20205a71 branch mouse_check_direct_timeout_timer + 3 
 
 p_mouse_store_device_info:
-00b5 20405b90 call mouse_store_device_info + 1 
-00b6 c40b8000 rtnbit0 mouse_enable_otp 
+00e5 20405b90 call mouse_store_device_info + 1 
+00e6 c40b8000 rtnbit0 mouse_enable_otp 
 
 p_mouse_store_otp_device_info:
 
 p_mouse_otp_store_24g_addr:
-00b7 dfe00790 arg otp_offset_24g_addr ,pdata 
-00b8 1fe22400 copy pdata ,regb 
+00e7 dfe00790 arg otp_offset_24g_addr ,pdata 
+00e8 1fe22400 copy pdata ,regb 
 
 p_mouse_otp_store_24g_addr_loop:
-00b9 204000d7 call p_mouse_read_otp_24g_addr_common 
-00ba 6fe2490d fetch 4 ,mem_mouse_24g_addr_temp 
-00bb 203a00c3 branch p_mouse_24g_addr_store ,blank 
-00bc 67e24909 store 4 ,mem_mouse_24g_addr_last 
-00bd 1a40a404 increase 4 ,regb 
-00be dfe007cf arg otp_offset_24g_addr_end ,pdata 
-00bf 9a467c00 isub regb ,null 
-00c0 24610000 nrtn positive 
-00c1 1a427e00 copy regb ,pdata 
-00c2 202000b9 branch p_mouse_otp_store_24g_addr_loop 
+00e9 20400107 call p_mouse_read_otp_24g_addr_common 
+00ea 6fe2490d fetch 4 ,mem_mouse_24g_addr_temp 
+00eb 203a00f3 branch p_mouse_24g_addr_store ,blank 
+00ec 67e24909 store 4 ,mem_mouse_24g_addr_last 
+00ed 1a40a404 increase 4 ,regb 
+00ee dfe007cf arg otp_offset_24g_addr_end ,pdata 
+00ef 9a467c00 isub regb ,null 
+00f0 24610000 nrtn positive 
+00f1 1a427e00 copy regb ,pdata 
+00f2 202000e9 branch p_mouse_otp_store_24g_addr_loop 
 
 p_mouse_24g_addr_store:
-00c3 6fe24909 fetch 4 ,mem_mouse_24g_addr_last 
-00c4 684a4640 fetcht 4 ,mem_mouse_24g_addr 
-00c5 98467c00 isub temp ,null 
-00c6 20628000 rtn zero 
-00c7 df200004 arg 4 ,loopcnt 
-00c8 da204640 arg mem_mouse_24g_addr ,rega 
-00c9 1a427e00 copy regb ,pdata 
-00ca 20206883 branch otp_write 
+00f3 6fe24909 fetch 4 ,mem_mouse_24g_addr_last 
+00f4 684a4640 fetcht 4 ,mem_mouse_24g_addr 
+00f5 98467c00 isub temp ,null 
+00f6 20628000 rtn zero 
+00f7 df200004 arg 4 ,loopcnt 
+00f8 da204640 arg mem_mouse_24g_addr ,rega 
+00f9 1a427e00 copy regb ,pdata 
+00fa 20206883 branch otp_write 
 
 p_mouse_read_otp_24g_addr:
-00cb dfe00790 arg otp_offset_24g_addr ,pdata 
-00cc 1fe22400 copy pdata ,regb 
+00fb dfe00790 arg otp_offset_24g_addr ,pdata 
+00fc 1fe22400 copy pdata ,regb 
 
 p_mouse_read_otp_24g_addr_loop:
-00cd 204000d7 call p_mouse_read_otp_24g_addr_common 
-00ce 6fe2490d fetch 4 ,mem_mouse_24g_addr_temp 
-00cf 203a00da branch p_mouse_24g_addr_load ,blank 
-00d0 67e24909 store 4 ,mem_mouse_24g_addr_last 
-00d1 1a40a404 increase 4 ,regb 
-00d2 dfe007cf arg otp_offset_24g_addr_end ,pdata 
-00d3 9a467c00 isub regb ,null 
-00d4 242100da nbranch p_mouse_24g_addr_load ,positive 
-00d5 1a427e00 copy regb ,pdata 
-00d6 202000cd branch p_mouse_read_otp_24g_addr_loop 
+00fd 20400107 call p_mouse_read_otp_24g_addr_common 
+00fe 6fe2490d fetch 4 ,mem_mouse_24g_addr_temp 
+00ff 203a010a branch p_mouse_24g_addr_load ,blank 
+0100 67e24909 store 4 ,mem_mouse_24g_addr_last 
+0101 1a40a404 increase 4 ,regb 
+0102 dfe007cf arg otp_offset_24g_addr_end ,pdata 
+0103 9a467c00 isub regb ,null 
+0104 2421010a nbranch p_mouse_24g_addr_load ,positive 
+0105 1a427e00 copy regb ,pdata 
+0106 202000fd branch p_mouse_read_otp_24g_addr_loop 
 
 p_mouse_read_otp_24g_addr_common:
-00d7 d8400004 arg 4 ,temp 
-00d8 da20490d arg mem_mouse_24g_addr_temp ,rega 
-00d9 202068c5 branch otpd_read_data_with_pwr_operation 
+0107 d8400004 arg 4 ,temp 
+0108 da20490d arg mem_mouse_24g_addr_temp ,rega 
+0109 202068c5 branch otpd_read_data_with_pwr_operation 
 
 p_mouse_24g_addr_load:
-00da 6fe24909 fetch 4 ,mem_mouse_24g_addr_last 
-00db 67e24640 store 4 ,mem_mouse_24g_addr 
-00dc 20600000 rtn 
+010a 6fe24909 fetch 4 ,mem_mouse_24g_addr_last 
+010b 67e24640 store 4 ,mem_mouse_24g_addr 
+010c 20600000 rtn 
               org 0x3800
 
 start:
Index: program/patch.prog
===================================================================
--- /1306ac/branch/mouse/branch/XZR_Project/Only_24G_LM_DPI_CM9079/program/patch.prog	(revision 460)
+++ /1306ac/branch/mouse/branch/XZR_Project/Only_24G_LM_DPI_CM9079/program/patch.prog	(working copy)
@@ -3,6 +3,7 @@
 //define DPI_LOAD_AND_STORE
 //define ADC_ENABLE
 define COMMBINATION_DPI
+define IC_OM16
 
 	bbit1 8,pf_patch_ext
 ifdef SENSOR_ANGLE_ICE_SDIO
@@ -15,6 +16,13 @@
 endif
 	beq patch07_5,p_mouse_setgpio_hibernate
 	beq patch08_6,p_mouse_3io6key_check
+ifdef IC_OM16
+	beq patch08_2,p_mouse_motion
+	beq patch08_4,p_mouse_setting_dpi
+	beq patch08_7,p_mouse_init_sunt
+	beq patch09_0,p_mouse_init_sensor
+	beq patch09_1,p_mouse_sensor_poweron
+endif
 	beq patch09_4,p_mouse_priority_bb_event
 	beq patch09_6,p_mouse_bb_event_timer
 	beq patch0a_2,p_mouse_store_device_info
@@ -43,7 +51,11 @@
 	jam 0,mem_mouse_commbination_dpi_check_enable
 endif
 	call mouse_le_name_load		//config tool
+ifdef IC_OM16
+	call p_mouse_setting_sensor_type
+else
 	call mouse_dpi_config
+endif
 	call mouse_drawing_optima_init
 	call p_mouse_cb_fuction
 	branch mouse_init+8
@@ -209,6 +221,76 @@
 	nsetflag true,0,regb
 	call mouse_check_press
 	branch mouse_check_key_connect_gnd_1
+
+ifdef IC_OM16
+p_mouse_init_sunt:
+	call mouse_sensor_spi_init
+	rtn wake
+p_mouse_init_sensor_wakeup:	
+	call mouse_sensor_poweron
+p_mouse_init_sensor:
+	call mouse_read_sensor_id
+	beq P32XX_ID1,p_mouse_init_p32xx_id2_judge
+	beq P3065_ID1,mouse_init_p3065
+	beq PKA8G2_ID1,mouse_ka8g2_id2_judge
+	call mouse_twspi_reset
+	nop 6900
+	branch p_mouse_init_sensor
+
+p_mouse_init_p32xx_id2_judge:
+	fetch 1,mem_sensor_id2
+	beq OM16_ID2,p_mouse_om16_init_param
+	branch mouse_init_p32xx_id2_judge+1
+
+p_mouse_om16_init_param:
+	jam OM16,mem_config_sensor_type
+	rtn
+
+p_mouse_setting_dpi:
+	call mouse_setting_dpi_4_level
+	call mouse_dpi_led_blink_delay
+p_mouse_setting_sensor_type:
+	fetch 1,mem_config_sensor_type
+	beq OM16,p_mouse_seting_om16_dpi
+	branch mouse_setting_sensor_type+1
+
+p_mouse_seting_om16_dpi:
+	fetch 1,mem_mouse_dpi
+	beq MOUSE_DPI_LEVEL1,p_mouse_om16_set_cpi0		//1200
+	beq MOUSE_DPI_LEVEL2,p_mouse_om16_set_cpi1		//1600
+	beq MOUSE_DPI_LEVEL3,p_mouse_om16_set_cpi2		//800
+//	beq MOUSE_DPI_LEVEL4,p_mouse_om16_set_cpi3		//1000
+p_mouse_om16_set_cpi1:			//1600
+	fetcht 1,mem_om16_dpi_1
+	branch mouse_dpi_store
+p_mouse_om16_set_cpi0:			//1200
+	fetcht 1,mem_om16_dpi_0
+	branch mouse_dpi_store
+p_mouse_om16_set_cpi2:			//800
+	fetcht 1,mem_om16_dpi_2
+	branch mouse_dpi_store
+//p_mouse_om16_set_cpi3:		//1000
+//	fetcht 1,mem_om16_dpi_3
+//	branch mouse_dpi_store
+
+p_mouse_sensor_poweron:
+	call mouse_sensor_spi_init
+	call mouse_sensor_reset
+	call mouse_sensor_poweron_init
+	call mouse_sensor_wr_seq
+	branch p_mouse_setting_sensor_type
+
+p_mouse_motion:
+	disable user
+	setarg 0
+	store 6,mem_mouse_x
+	call mouse_check_sensor_data
+	setarg 0x0089
+	call twspi_write	
+	call p_mouse_setting_sensor_type
+	branch mouse_motion+8
+
+endif
 	
 p_mouse_priority_bb_event:
 	copy regc,pdata
Index: sched/mouse_basic.dat
===================================================================
--- /1306ac/branch/mouse/branch/XZR_Project/Only_24G_LM_DPI_CM9079/sched/mouse_basic.dat	(revision 460)
+++ /1306ac/branch/mouse/branch/XZR_Project/Only_24G_LM_DPI_CM9079/sched/mouse_basic.dat	(working copy)
@@ -1,8 +1,8 @@
 #mem_patch00:01	#adc
 #mem_patch06:80
 mem_patch07:20	#a0 adc
-mem_patch08:40
-mem_patch09:50
+mem_patch08:d4	#40 no ic_om16
+mem_patch09:53	#50 no ic_om16
 mem_patch0a:04
 mem_patch0b:c4
 mem_patch0e:01
@@ -345,7 +345,11 @@
 09 00
 ff ff
 
-
+mem_om16_dpi:
+07 ##mem_om16_dpi_0
+05 ##mem_om16_dpi_1
+04 ##mem_om16_dpi_2
+06 ##mem_om16_dpi_3
 
 
 
