Index: output/otp.dat
===================================================================
--- /1121s/branch/shutter/branch/shutter/yb_project/yc1386s_shutter_r18/output/otp.dat	(revision 3563)
+++ /1121s/branch/shutter/branch/shutter/yb_project/yc1386s_shutter_r18/output/otp.dat	(working copy)
@@ -11,7 +11,7 @@
 00
 aa
 55
-c2
+ee
 08
 c2
 84
@@ -32,19 +32,19 @@
 c0
 0a
 01
-bb
+bc
 c0
 0a
 80
-ea
+eb
 c0
 0c
 00
-f8
+f9
 c0
 0c
 80
-b7
+b8
 c0
 0d
 00
@@ -56,23 +56,23 @@
 c0
 12
 82
-0f
+10
 c0
 13
 82
-04
+05
 c0
 58
 81
-02
+03
 c0
 62
-80
-ff
+81
+00
 c0
 6d
 01
-a4
+a5
 20
 20
 23
@@ -80,7 +80,7 @@
 c0
 12
 01
-dd
+de
 c0
 12
 80
@@ -92,7 +92,7 @@
 c0
 1c
 81
-d7
+d8
 c0
 1f
 80
@@ -100,7 +100,7 @@
 c0
 26
 81
-db
+dc
 c1
 7f
 80
@@ -487,6 +487,10 @@
 10
 70
 8a
+88
+40
+70
+8a
 13
 cd
 70
@@ -508,7 +512,7 @@
 20
 40
 00
-bf
+c0
 6f
 e0
 c4
@@ -536,7 +540,7 @@
 c0
 08
 00
-ac
+ad
 6f
 e0
 c4
@@ -580,7 +584,7 @@
 20
 40
 00
-9e
+9f
 70
 80
 43
@@ -604,15 +608,15 @@
 20
 40
 01
-76
+77
 20
 40
 01
-a1
+a2
 20
 40
 00
-99
+9a
 70
 41
 48
@@ -624,7 +628,7 @@
 20
 20
 01
-a3
+a4
 37
 d9
 82
@@ -652,7 +656,7 @@
 c0
 0c
 00
-a4
+a5
 6f
 e0
 c4
@@ -744,7 +748,7 @@
 20
 20
 00
-8b
+8c
 6f
 e0
 c1
@@ -752,7 +756,7 @@
 c0
 05
 00
-ba
+bb
 20
 20
 22
@@ -780,7 +784,7 @@
 20
 35
 80
-e6
+e7
 6f
 e2
 02
@@ -948,7 +952,7 @@
 20
 20
 00
-d0
+d1
 20
 40
 68
@@ -1116,7 +1120,7 @@
 58
 00
 01
-29
+2a
 67
 e1
 43
@@ -1124,7 +1128,7 @@
 58
 00
 01
-2f
+30
 67
 e1
 43
@@ -1140,7 +1144,7 @@
 58
 00
 01
-6e
+6f
 67
 e1
 43
@@ -1148,7 +1152,7 @@
 58
 00
 01
-3a
+3b
 67
 e1
 45
@@ -1156,7 +1160,7 @@
 58
 00
 01
-26
+27
 67
 e1
 43
@@ -1176,7 +1180,7 @@
 c0
 00
 01
-2c
+2d
 6f
 e0
 c5
@@ -1232,15 +1236,15 @@
 c0
 18
 81
-34
+35
 c0
 0a
 81
-36
+37
 c0
 1f
 81
-6f
+70
 20
 20
 62
@@ -1284,7 +1288,7 @@
 20
 3a
 01
-41
+42
 70
 48
 c2
@@ -1296,7 +1300,7 @@
 20
 20
 01
-4b
+4c
 70
 48
 c2
@@ -1328,7 +1332,7 @@
 24
 3a
 01
-4a
+4b
 70
 48
 c1
@@ -1352,11 +1356,11 @@
 c0
 00
 01
-5b
+5c
 c0
 00
 81
-51
+52
 20
 60
 00
@@ -1400,7 +1404,7 @@
 20
 20
 01
-6a
+6b
 58
 00
 00
@@ -1440,7 +1444,7 @@
 20
 20
 01
-6a
+6b
 68
 49
 44
@@ -1560,7 +1564,7 @@
 20
 40
 01
-93
+94
 2a
 2f
 fe
@@ -1592,7 +1596,7 @@
 20
 40
 01
-93
+94
 d8
 a0
 8a
@@ -1620,7 +1624,7 @@
 20
 21
 01
-88
+89
 20
 20
 21
@@ -1724,7 +1728,7 @@
 20
 40
 01
-b4
+b5
 70
 8a
 08
@@ -1768,7 +1772,7 @@
 c3
 02
 81
-b5
+b6
 68
 59
 01
@@ -1804,7 +1808,7 @@
 c0
 08
 01
-d4
+d5
 58
 00
 57
@@ -1848,7 +1852,7 @@
 c0
 08
 01
-d1
+d2
 58
 00
 2b
@@ -1884,7 +1888,7 @@
 20
 20
 01
-cd
+ce
 58
 00
 83
@@ -1896,7 +1900,7 @@
 20
 20
 01
-c2
+c3
 6f
 e0
 c3
@@ -1928,7 +1932,7 @@
 c5
 97
 81
-e3
+e4
 78
 3c
 fc
@@ -1972,7 +1976,7 @@
 20
 37
 01
-ec
+ed
 1b
 42
 04
@@ -2020,7 +2024,7 @@
 20
 40
 01
-fa
+fb
 6f
 e0
 81
@@ -2136,7 +2140,7 @@
 20
 40
 00
-9b
+9c
 6f
 e2
 40
@@ -2152,11 +2156,51 @@
 20
 40
 02
-18
+23
+6f
+e0
+c0
+cb
+79
 20
+7e
+04
 20
+40
+23
+e1
 24
-25
+55
+a3
+cb
+37
+d9
+82
+00
+1b
+22
+7e
+00
+67
+e3
+40
+b1
+6f
+e1
+c0
+c6
+6a
+20
+c0
+c9
+df
+20
+00
+03
+20
+20
+24
+2e
 60
 04
 40
@@ -2224,7 +2268,7 @@
 20
 22
 82
-2b
+36
 e7
 e0
 80
@@ -2244,7 +2288,7 @@
 c2
 00
 02
-25
+30
 1a
 42
 04
@@ -2253,8 +2297,8 @@
 60
 00
 00
-0a
-38
+e8
+aa
 aa
 55
 40
@@ -2639,5 +2683,5 @@
 55
 bc
 54
-cf
-1a
+fc
+dd
Index: output/ramcode.rom
===================================================================
--- /1121s/branch/shutter/branch/shutter/yb_project/yc1386s_shutter_r18/output/ramcode.rom	(revision 3563)
+++ /1121s/branch/shutter/branch/shutter/yb_project/yc1386s_shutter_r18/output/ramcode.rom	(working copy)
@@ -2,24 +2,24 @@
 c0000018
 c001005a
 c0088063
-c00a01bb
-c00a80ea
-c00c00f8
-c00c80b7
+c00a01bc
+c00a80eb
+c00c00f9
+c00c80b8
 c00d0071
 c00e001c
-c012820f
-c0138204
-c0588102
-c06280ff
-c06d01a4
+c0128210
+c0138205
+c0588103
+c0628100
+c06d01a5
 2020235a
-c01201dd
+c01201de
 c0128055
 c0130045
-c01c81d7
+c01c81d8
 c01f802a
-c02681db
+c02681dc
 c17f8000
 2020235a
 2435a002
@@ -116,19 +116,20 @@
 37d98200
 7089460d
 70896f10
+708a8840
 708a13cd
 708a0610
 708a844a
 708a8540
 708a16fe
-204000bf
+204000c0
 6fe0c436
 205a70d7
 24558041
 37d98200
 70813b5f
 6fe0c099
-c00800ac
+c00800ad
 6fe0c438
 1fe1fe04
 67f08a02
@@ -139,25 +140,25 @@
 67f18a73
 708a8660
 708a8b3b
-2040009e
+2040009f
 70804300
 70804205
 58557474
 67f18968
 7089606e
-20400176
-204001a1
-20400099
+20400177
+204001a2
+2040009a
 7041480c
 20406f4e
-202001a3
+202001a4
 37d98200
 6fe0c11c
 67f0813a
 37d98200
 20600000
 6fe0c099
-c00c00a4
+c00c00a5
 6fe0c438
 1fe1fe06
 67f08a02
@@ -180,16 +181,16 @@
 67f18a73
 708a762a
 70890204
-2020008b
+2020008c
 6fe0c141
-c00500ba
+c00500bb
 2020220e
 708a1425
 58a93f3f
 67f18a60
 708a631f
 20600000
-203580e6
+203580e7
 6fe2020d
 207a0000
 37d98200
@@ -231,7 +232,7 @@
 6fe1415b
 207a0000
 67e1020f
-202000d0
+202000d1
 2040686f
 204021ba
 18002a08
@@ -273,22 +274,22 @@
 67e44512
 6fe448a6
 67e444fa
-58000129
+5800012a
 67e143db
-5800012f
+58000130
 67e143dd
 5800638a
 67e143df
-5800016e
+5800016f
 67e143e3
-5800013a
+5800013b
 67e14524
-58000126
+58000127
 67e143d5
 204062c4
 20406396
 6fe0c51a
-c000012c
+c000012d
 6fe0c51b
 67e0c4ec
 202063a1
@@ -302,9 +303,9 @@
 70451c01
 20206340
 1a627e00
-c0188134
-c00a8136
-c01f816f
+c0188135
+c00a8137
+c01f8170
 202062da
 7048ae01
 20600000
@@ -315,10 +316,10 @@
 2040635d
 24760000
 1a227e00
-203a0141
+203a0142
 7048c200
 20404323
-2020014b
+2020014c
 7048c201
 7048c100
 20404325
@@ -326,14 +327,14 @@
 6fe0c8c1
 247a0000
 6fe0c8c2
-243a014a
+243a014b
 7048c101
 20206371
 6fe0c8c3
 79407e00
 67e0c8c3
-c000015b
-c0008151
+c000015c
+c0008152
 20600000
 58000000
 67e1452e
@@ -344,7 +345,7 @@
 58000006
 67e1455b
 da60452e
-2020016a
+2020016b
 58000000
 67e1452e
 58000002
@@ -354,7 +355,7 @@
 58000006
 67e1455b
 da60452e
-2020016a
+2020016b
 68494430
 e7e08002
 efe08005
@@ -384,7 +385,7 @@
 708ac200
 708ac300
 d8e00006
-20400193
+20400194
 2a2ffe0d
 2040211d
 2a4ffe0d
@@ -392,14 +393,14 @@
 d8e00005
 2040211c
 2040211e
-20400193
+20400194
 d8a08ac2
 1a31fe00
 20402117
 1a51fe00
 20402117
 18e08fff
-20210188
+20210189
 2020214f
 2000003c
 58000f00
@@ -425,7 +426,7 @@
 6fe0c409
 67f080cd
 20000bb8
-204001b4
+204001b5
 708a08c1
 6a40c419
 df200008
@@ -436,7 +437,7 @@
 20600000
 7080cc03
 6ff08129
-c30281b5
+c30281b6
 68590164
 6049440a
 7080cc00
@@ -445,7 +446,7 @@
 708a8d12
 708a8e0a
 6fe0c099
-c00801d4
+c00801d5
 58005762
 67f10907
 70890103
@@ -456,7 +457,7 @@
 708a8d44
 708a8e0a
 6fe0c099
-c00801d1
+c00801d2
 58002bb1
 67f10907
 c6978000
@@ -465,10 +466,10 @@
 20600000
 58004189
 67f10907
-202001cd
+202001ce
 58008312
 67f10907
-202001c2
+202001c3
 6fe0c334
 c1000000
 c001b04a
@@ -476,7 +477,7 @@
 793f8030
 20202af6
 204025c2
-c59781e3
+c59781e4
 783cfc00
 2000001e
 204025c2
@@ -487,7 +488,7 @@
 78507c00
 19623600
 37c18400
-203701ec
+203701ed
 1b420400
 604b000f
 242c26fa
@@ -499,7 +500,7 @@
 984fb600
 20406877
 20372677
-204001fa
+204001fb
 6fe08168
 c301a677
 2055a477
@@ -528,12 +529,22 @@
 6fe143e9
 20407d79
 58000012
-2040009b
+2040009c
 6fe240ad
 9840fe00
 67e240ad
-20400218
-20202425
+20400223
+6fe0c0cb
+79207e04
+204023e1
+2455a3cb
+37d98200
+1b227e00
+67e340b1
+6fe1c0c6
+6a20c0c9
+df200003
+2020242e
 600440e7
 d8c08070
 d8a040cc
@@ -550,11 +561,11 @@
 efe08011
 e8408013
 98467c00
-2022822b
+20228236
 e7e08013
 37d98200
 1a20a201
 1a60a601
-c2000225
+c2000230
 1a420400
 20600000
Index: program/patch.prog
===================================================================
--- /1121s/branch/shutter/branch/shutter/yb_project/yc1386s_shutter_r18/program/patch.prog	(revision 3563)
+++ /1121s/branch/shutter/branch/shutter/yb_project/yc1386s_shutter_r18/program/patch.prog	(working copy)
@@ -159,7 +159,7 @@
 
 	jam 0x0d,0x8946
 	jam 0x10,0x896f
-
+	jam 0x40,core_rx_cfg0
 	jam 0xcd,0x8a13
 	jam 0x10,0x8a06
 	jam 0x4a,0x8a84
@@ -809,7 +809,18 @@
 	iadd temp,pdata
 	store 4,mem_sleep_counter_all
 	call p_lpm_save_context
-	branch lpm_sleep_skip_cb_function+4
+	fetch 1,mem_lpm_hv_sel
+	set1 LPM_DOZE_EN_BIT, pdata
+	call lpm_write_sel_hv
+	ncall lpm_preon_counter,wake
+	until null,lpo_edge
+	copy clkn,pdata
+	store 6,mem_sleep_clkn
+	// storer clkn,6,mem_sleep_clkn
+	fetch 3,mem_lpm_isogate
+	fetchr rega,1,mem_lpm_ldo_sel
+	arg 3,loopcnt
+	branch lpm_sleep_loop
 
 p_lpm_save_context:
 	storer mark,8,mem_saved_mark
