Index: output/flash.dat
===================================================================
--- /branch/mouse_project/YDN_Project/YDN_1066_G-535/output/flash.dat	(revision 5812)
+++ /branch/mouse_project/YDN_Project/YDN_1066_G-535/output/flash.dat	(working copy)
@@ -2,7 +2,7 @@
 02
 aa
 55
-36
+42
 1f
 20
 20
@@ -47,7 +47,7 @@
 20
 40
 07
-72
+75
 20
 40
 00
@@ -5803,7 +5803,7 @@
 20
 40
 07
-72
+75
 70
 4b
 39
@@ -7593,6 +7593,18 @@
 00
 01
 68
+00
+c6
+e0
+c1
+02
+00
+00
+c1
+05
+00
+00
+68
 02
 46
 9b
@@ -7603,7 +7615,7 @@
 20
 40
 07
-bc
+bf
 58
 00
 00
@@ -7611,7 +7623,7 @@
 20
 40
 07
-af
+b2
 58
 00
 00
@@ -7619,7 +7631,7 @@
 20
 40
 07
-b5
+b8
 68
 00
 cb
@@ -7627,7 +7639,7 @@
 c0
 00
 87
-75
+78
 df
 20
 00
@@ -7659,7 +7671,7 @@
 20
 40
 07
-88
+8b
 68
 01
 11
@@ -7695,7 +7707,7 @@
 20
 40
 07
-88
+8b
 68
 01
 11
@@ -7739,7 +7751,7 @@
 20
 20
 87
-95
+98
 68
 00
 91
@@ -7747,7 +7759,7 @@
 c0
 7f
 87
-9c
+9f
 68
 00
 91
@@ -7775,7 +7787,7 @@
 c0
 00
 07
-99
+9c
 68
 01
 91
@@ -7783,7 +7795,7 @@
 20
 20
 07
-91
+94
 70
 11
 c4
@@ -7795,7 +7807,7 @@
 20
 20
 07
-91
+94
 68
 00
 91
@@ -7803,7 +7815,7 @@
 20
 40
 07
-a7
+aa
 60
 00
 91
@@ -7815,7 +7827,7 @@
 20
 3a
 07
-a5
+a8
 58
 00
 00
@@ -7839,7 +7851,7 @@
 20
 20
 07
-a2
+a5
 1f
 e6
 7e
@@ -7879,7 +7891,7 @@
 24
 21
 07
-ba
+bd
 9a
 46
 7c
@@ -7887,7 +7899,7 @@
 24
 21
 07
-ba
+bd
 70
 4b
 0d
@@ -7915,7 +7927,7 @@
 20
 20
 07
-b3
+b6
 70
 4b
 0d
@@ -7935,7 +7947,7 @@
 20
 40
 07
-c5
+c8
 1f
 e2
 22
@@ -7951,7 +7963,7 @@
 20
 40
 07
-c5
+c8
 1f
 e2
 24
@@ -7967,7 +7979,7 @@
 c0
 7f
 87
-ca
+cd
 68
 00
 91
@@ -7991,9 +8003,9 @@
 20
 20
 07
-c8
-87
-38
+cb
+8d
+94
 aa
 55
 08
@@ -9118,7 +9130,7 @@
 00
 53
 4b
-af
+bb
 2f
 00
 55
@@ -12204,5 +12216,5 @@
 55
 00
 00
-0f
-83
+be
+5e
Index: output/program.lis
===================================================================
--- /branch/mouse_project/YDN_Project/YDN_1066_G-535/output/program.lis	(revision 5812)
+++ /branch/mouse_project/YDN_Project/YDN_1066_G-535/output/program.lis	(working copy)
@@ -16,7 +16,7 @@
 0007 6000cb34 store 1 ,mem_bt_ui_button_count 
 0008 204043ca call mouse_bt_discovery_button_down_disable 
 0009 2040039a call p_mouse_spi_init 
-000a 20400772 call p_drawing_optima_init 
+000a 20400775 call p_drawing_optima_init 
 000b 2040000f call p_mouse_cb_fuction 
 000c 2040001e call p_mouse_wakeup_from_power 
 000d 2040006c call p_mouse_select_device_button_wakeup_check 
@@ -1957,7 +1957,7 @@
 05a8 20203fea branch mouse_p32xx_sensor_motion_1 
 
 p_mouse_motion_nodata:
-05a9 20400772 call p_drawing_optima_init 
+05a9 20400775 call p_drawing_optima_init 
 05aa 704b3900 jam 0 ,mem_low_power_check_count 
 05ab 20600000 rtn 
 
@@ -2587,142 +2587,145 @@
 0768 20200001 branch p_zcode 
 
 p_drawing_optima:
-0769 6802469b fetch 4 ,mem_mouse_x 
-076a 207a0000 rtn blank 
-076b 204007bc call p_data_abs_check 
-076c 58000006 setarg 0x06 
-076d 204007af call p_data_greater_than_check 
-076e 58000003 setarg 0x03 
-076f 204007b5 call p_data_less_than_check 
-0770 6800cb0d fetch 1 ,mem_mouse_asm_flag 
-0771 c0008775 beq 1 ,p_drawing_optima_modify 
+0769 6800c6e0 fetch 1 ,mem_config_sensor_type 
+076a c1020000 rtneq p3212 
+076b c1050000 rtneq ka5857 
+076c 6802469b fetch 4 ,mem_mouse_x 
+076d 207a0000 rtn blank 
+076e 204007bf call p_data_abs_check 
+076f 58000006 setarg 0x06 
+0770 204007b2 call p_data_greater_than_check 
+0771 58000003 setarg 0x03 
+0772 204007b8 call p_data_less_than_check 
+0773 6800cb0d fetch 1 ,mem_mouse_asm_flag 
+0774 c0008778 beq 1 ,p_drawing_optima_modify 
 
 p_drawing_optima_init:
-0772 df200005 arg 5 ,loopcnt 
-0773 d8a04b0d arg mem_mouse_asm_flag ,contw 
-0774 20207ed4 branch clear_mem 
+0775 df200005 arg 5 ,loopcnt 
+0776 d8a04b0d arg mem_mouse_asm_flag ,contw 
+0777 20207ed4 branch clear_mem 
 
 p_drawing_optima_modify:
-0775 68014b0e fetch 2 ,mem_mouse_x_pre 
-0776 600111be store 2 ,mem_data_pre 
-0777 6801469b fetch 2 ,mem_mouse_x 
-0778 600111c0 store 2 ,mem_data_current 
-0779 20400788 call p_drawing_optima_data 
-077a 680111be fetch 2 ,mem_data_pre 
-077b 60014b0e store 2 ,mem_mouse_x_pre 
-077c 680111c0 fetch 2 ,mem_data_current 
-077d 6001469b store 2 ,mem_mouse_x 
-077e 68014b10 fetch 2 ,mem_mouse_y_pre 
-077f 600111be store 2 ,mem_data_pre 
-0780 6801469d fetch 2 ,mem_mouse_y 
-0781 600111c0 store 2 ,mem_data_current 
-0782 20400788 call p_drawing_optima_data 
-0783 680111be fetch 2 ,mem_data_pre 
-0784 60014b10 store 2 ,mem_mouse_y_pre 
-0785 680111c0 fetch 2 ,mem_data_current 
-0786 6001469d store 2 ,mem_mouse_y 
-0787 20600000 rtn 
+0778 68014b0e fetch 2 ,mem_mouse_x_pre 
+0779 600111be store 2 ,mem_data_pre 
+077a 6801469b fetch 2 ,mem_mouse_x 
+077b 600111c0 store 2 ,mem_data_current 
+077c 2040078b call p_drawing_optima_data 
+077d 680111be fetch 2 ,mem_data_pre 
+077e 60014b0e store 2 ,mem_mouse_x_pre 
+077f 680111c0 fetch 2 ,mem_data_current 
+0780 6001469b store 2 ,mem_mouse_x 
+0781 68014b10 fetch 2 ,mem_mouse_y_pre 
+0782 600111be store 2 ,mem_data_pre 
+0783 6801469d fetch 2 ,mem_mouse_y 
+0784 600111c0 store 2 ,mem_data_current 
+0785 2040078b call p_drawing_optima_data 
+0786 680111be fetch 2 ,mem_data_pre 
+0787 60014b10 store 2 ,mem_mouse_y_pre 
+0788 680111c0 fetch 2 ,mem_data_current 
+0789 6001469d store 2 ,mem_mouse_y 
+078a 20600000 rtn 
 
 p_drawing_optima_data:
-0788 680111be fetch 2 ,mem_data_pre 
-0789 680911c0 fetcht 2 ,mem_data_current 
-078a 9840fe00 iadd temp ,pdata 
-078b 600191c2 store 3 ,mem_data_sum 
-078c 2feffe10 isolate1 16 ,pdata 
-078d 20208795 branch p_data_sum_overflow ,true 
-078e 680091c3 fetch 1 ,mem_data_sum + 1 
-078f c07f879c beq 0xff ,p_data_sum_n 
-0790 680091c2 fetch 1 ,mem_data_sum 
+078b 680111be fetch 2 ,mem_data_pre 
+078c 680911c0 fetcht 2 ,mem_data_current 
+078d 9840fe00 iadd temp ,pdata 
+078e 600191c2 store 3 ,mem_data_sum 
+078f 2feffe10 isolate1 16 ,pdata 
+0790 20208798 branch p_data_sum_overflow ,true 
+0791 680091c3 fetch 1 ,mem_data_sum + 1 
+0792 c07f879f beq 0xff ,p_data_sum_n 
+0793 680091c2 fetch 1 ,mem_data_sum 
 
 p_data_store_pre:
-0791 1fe37e00 rshift pdata ,pdata 
-0792 600111be store 2 ,mem_data_pre 
-0793 600111c0 store 2 ,mem_data_current 
-0794 20600000 rtn 
+0794 1fe37e00 rshift pdata ,pdata 
+0795 600111be store 2 ,mem_data_pre 
+0796 600111c0 store 2 ,mem_data_current 
+0797 20600000 rtn 
 
 p_data_sum_overflow:
-0795 680091c3 fetch 1 ,mem_data_sum + 1 
-0796 c0000799 beq 0 ,p_data_sum_overflow_p 
-0797 680191c2 fetch 3 ,mem_data_sum 
-0798 20200791 branch p_data_store_pre 
+0798 680091c3 fetch 1 ,mem_data_sum + 1 
+0799 c000079c beq 0 ,p_data_sum_overflow_p 
+079a 680191c2 fetch 3 ,mem_data_sum 
+079b 20200794 branch p_data_store_pre 
 
 p_data_sum_overflow_p:
-0799 7011c400 jam 0 ,mem_data_sum + 2 
-079a 680091c2 fetch 1 ,mem_data_sum 
-079b 20200791 branch p_data_store_pre 
+079c 7011c400 jam 0 ,mem_data_sum + 2 
+079d 680091c2 fetch 1 ,mem_data_sum 
+079e 20200794 branch p_data_store_pre 
 
 p_data_sum_n:
-079c 680091c2 fetch 1 ,mem_data_sum 
-079d 204007a7 call p_pdata_get_half 
-079e 600091be store 1 ,mem_data_pre 
-079f 600091c0 store 1 ,mem_data_current 
-07a0 203a07a5 branch p_data_zero ,blank 
-07a1 580000ff setarg 0xff 
+079f 680091c2 fetch 1 ,mem_data_sum 
+07a0 204007aa call p_pdata_get_half 
+07a1 600091be store 1 ,mem_data_pre 
+07a2 600091c0 store 1 ,mem_data_current 
+07a3 203a07a8 branch p_data_zero ,blank 
+07a4 580000ff setarg 0xff 
 
 p_data_set_direction:
-07a2 600091bf store 1 ,mem_data_pre + 1 
-07a3 600091c1 store 1 ,mem_data_current + 1 
-07a4 20600000 rtn 
+07a5 600091bf store 1 ,mem_data_pre + 1 
+07a6 600091c1 store 1 ,mem_data_current + 1 
+07a7 20600000 rtn 
 
 p_data_zero:
-07a5 58000000 setarg 0 
-07a6 202007a2 branch p_data_set_direction 
+07a8 58000000 setarg 0 
+07a9 202007a5 branch p_data_set_direction 
 
 p_pdata_get_half:
-07a7 1fe67e00 sub pdata ,0 ,pdata 
-07a8 60008aae store 1 ,mem_rega 
-07a9 68008aae fetch 1 ,mem_rega 
-07aa 1fe37e00 rshift pdata ,pdata 
+07aa 1fe67e00 sub pdata ,0 ,pdata 
 07ab 60008aae store 1 ,mem_rega 
 07ac 68008aae fetch 1 ,mem_rega 
-07ad 1fe67e00 sub pdata ,0 ,pdata 
-07ae 20600000 rtn 
+07ad 1fe37e00 rshift pdata ,pdata 
+07ae 60008aae store 1 ,mem_rega 
+07af 68008aae fetch 1 ,mem_rega 
+07b0 1fe67e00 sub pdata ,0 ,pdata 
+07b1 20600000 rtn 
 
 p_data_greater_than_check:
-07af 9a267c00 isub rega ,null 
-07b0 242107ba nbranch p_enable_asm ,positive 
-07b1 9a467c00 isub regb ,null 
-07b2 242107ba nbranch p_enable_asm ,positive 
+07b2 9a267c00 isub rega ,null 
+07b3 242107bd nbranch p_enable_asm ,positive 
+07b4 9a467c00 isub regb ,null 
+07b5 242107bd nbranch p_enable_asm ,positive 
 
 p_disable_asm:
-07b3 704b0d00 jam 0 ,mem_mouse_asm_flag 
-07b4 20600000 rtn 
+07b6 704b0d00 jam 0 ,mem_mouse_asm_flag 
+07b7 20600000 rtn 
 
 p_data_less_than_check:
-07b5 9a267c00 isub rega ,null 
-07b6 24610000 nrtn positive 
-07b7 9a467c00 isub regb ,null 
-07b8 24610000 nrtn positive 
-07b9 202007b3 branch p_disable_asm 
+07b8 9a267c00 isub rega ,null 
+07b9 24610000 nrtn positive 
+07ba 9a467c00 isub regb ,null 
+07bb 24610000 nrtn positive 
+07bc 202007b6 branch p_disable_asm 
 
 p_enable_asm:
-07ba 704b0d01 jam 1 ,mem_mouse_asm_flag 
-07bb 20600000 rtn 
+07bd 704b0d01 jam 1 ,mem_mouse_asm_flag 
+07be 20600000 rtn 
 
 p_data_abs_check:
-07bc 6801469b fetch 2 ,mem_mouse_x 
-07bd 600111c0 store 2 ,mem_data_current 
-07be 204007c5 call p_data_abs 
-07bf 1fe22200 copy pdata ,rega 
-07c0 6801469d fetch 2 ,mem_mouse_y 
-07c1 600111c0 store 2 ,mem_data_current 
-07c2 204007c5 call p_data_abs 
-07c3 1fe22400 copy pdata ,regb 
-07c4 20600000 rtn 
+07bf 6801469b fetch 2 ,mem_mouse_x 
+07c0 600111c0 store 2 ,mem_data_current 
+07c1 204007c8 call p_data_abs 
+07c2 1fe22200 copy pdata ,rega 
+07c3 6801469d fetch 2 ,mem_mouse_y 
+07c4 600111c0 store 2 ,mem_data_current 
+07c5 204007c8 call p_data_abs 
+07c6 1fe22400 copy pdata ,regb 
+07c7 20600000 rtn 
 
 p_data_abs:
-07c5 680091c1 fetch 1 ,mem_data_current + 1 
-07c6 c07f87ca beq 0xff ,p_data_reversal 
-07c7 680091c0 fetch 1 ,mem_data_current 
+07c8 680091c1 fetch 1 ,mem_data_current + 1 
+07c9 c07f87cd beq 0xff ,p_data_reversal 
+07ca 680091c0 fetch 1 ,mem_data_current 
 
 p_data_abs_store:
-07c8 1fe17eff and_into 0xff ,pdata 
-07c9 20600000 rtn 
+07cb 1fe17eff and_into 0xff ,pdata 
+07cc 20600000 rtn 
 
 p_data_reversal:
-07ca 680111c0 fetch 2 ,mem_data_current 
-07cb 1fe67e00 sub pdata ,0 ,pdata 
-07cc 202007c8 branch p_data_abs_store 
+07cd 680111c0 fetch 2 ,mem_data_current 
+07ce 1fe67e00 sub pdata ,0 ,pdata 
+07cf 202007cb branch p_data_abs_store 
               org 0x2000
 
 start:
Index: program/patch.prog
===================================================================
--- /branch/mouse_project/YDN_Project/YDN_1066_G-535/program/patch.prog	(revision 5812)
+++ /branch/mouse_project/YDN_Project/YDN_1066_G-535/program/patch.prog	(working copy)
@@ -3158,6 +3158,9 @@
 ifdef MOUSE_SMOOTHER
 //notice: need to call p_mouse_drawing_optima_init when waked from mult
 p_drawing_optima:
+	fetch 1,mem_config_sensor_type
+	rtneq P3212
+	rtneq KA5857
 	fetch 4,mem_mouse_x
 	rtn blank
 	call p_data_abs_check
