Index: output/otp.dat
===================================================================
--- /1121s/branch/shutter/branch/shutter/dq_project/dq_yc1386p_shutter_adc_t20/output/otp.dat	(revision 4700)
+++ /1121s/branch/shutter/branch/shutter/dq_project/dq_yc1386p_shutter_adc_t20/output/otp.dat	(working copy)
@@ -11,7 +11,7 @@
 00
 aa
 55
-36
+22
 0d
 c2
 84
@@ -20,99 +20,103 @@
 c0
 00
 00
-1b
+2f
 c0
 01
 00
-72
+86
 c0
 08
 80
-7b
+8f
 c0
 0a
 02
-77
+72
 c0
 0a
 81
-08
+1c
 c0
 0c
 01
-16
+2a
 c0
 0c
 80
-d5
+e9
 c0
 0d
 00
-8d
+a1
 c0
 12
 82
-cb
+c6
 c0
 13
 82
-c0
+bb
 c0
 58
 81
-20
+34
 c0
 62
 81
-1d
+31
 c0
 6d
 02
-60
+5b
 c0
 6d
 82
-f4
+ef
 c0
 6e
 03
-31
+2c
 c0
 6e
 83
-12
+0d
 20
 20
 23
 5a
 c0
+08
+00
+1c
+c0
 12
 02
-99
+94
 c0
 12
 80
-6d
+81
 c0
 13
 00
-5d
+71
 c0
 1c
 82
-93
+8e
 c0
 1d
 00
-1f
+33
 c0
 1f
 80
-46
+5a
 c0
 26
 82
-97
+92
 c1
 7f
 80
@@ -121,6 +125,82 @@
 20
 23
 5a
+78
+54
+fc
+00
+58
+00
+00
+17
+67
+e1
+42
+e3
+1f
+e0
+fe
+04
+67
+e1
+43
+b8
+70
+01
+69
+01
+70
+43
+88
+00
+6f
+e1
+44
+e9
+79
+3f
+fe
+0b
+67
+e1
+44
+e9
+70
+00
+15
+00
+20
+40
+25
+92
+6f
+e1
+01
+96
+67
+e1
+42
+f5
+6f
+e1
+01
+6a
+1f
+ef
+fe
+05
+1f
+f1
+fe
+00
+67
+e1
+01
+96
+20
+20
+25
+06
 24
 35
 a0
@@ -144,7 +224,7 @@
 c0
 02
 00
-24
+38
 c0
 03
 2e
@@ -188,7 +268,7 @@
 c0
 06
 00
-2d
+41
 20
 20
 2b
@@ -216,7 +296,7 @@
 20
 22
 80
-34
+48
 20
 20
 2d
@@ -300,7 +380,7 @@
 20
 37
 00
-49
+5d
 24
 36
 a9
@@ -324,7 +404,7 @@
 24
 3a
 00
-5a
+6e
 6f
 e0
 c3
@@ -504,7 +584,7 @@
 20
 20
 00
-72
+86
 70
 8a
 0f
@@ -624,7 +704,7 @@
 20
 40
 00
-dd
+f1
 6f
 e0
 c4
@@ -636,7 +716,7 @@
 24
 55
 80
-89
+9d
 37
 d9
 82
@@ -652,7 +732,7 @@
 c0
 08
 00
-ca
+de
 6f
 e0
 c4
@@ -696,7 +776,7 @@
 20
 40
 00
-bc
+d0
 70
 80
 43
@@ -720,15 +800,15 @@
 20
 40
 02
-32
+2d
 20
 40
 02
-5d
+58
 20
 40
 00
-b6
+ca
 70
 41
 48
@@ -740,7 +820,7 @@
 20
 20
 02
-5f
+5a
 20
 75
 80
@@ -772,7 +852,7 @@
 c0
 0c
 00
-c2
+d6
 6f
 e0
 c4
@@ -864,7 +944,7 @@
 20
 20
 00
-a8
+bc
 6f
 e0
 c1
@@ -872,7 +952,7 @@
 c0
 05
 00
-d8
+ec
 20
 20
 22
@@ -900,7 +980,7 @@
 20
 35
 81
-04
+18
 6f
 e2
 02
@@ -1067,8 +1147,8 @@
 0f
 20
 20
-00
-ee
+01
+02
 20
 40
 68
@@ -1212,7 +1292,7 @@
 20
 40
 01
-d0
+c8
 58
 00
 00
@@ -1252,7 +1332,7 @@
 58
 00
 01
-58
+6c
 67
 e1
 43
@@ -1260,7 +1340,7 @@
 58
 00
 02
-20
+1b
 67
 e1
 43
@@ -1276,7 +1356,7 @@
 58
 00
 01
-70
+84
 67
 e1
 43
@@ -1292,7 +1372,7 @@
 58
 00
 01
-5b
+6f
 67
 e1
 43
@@ -1307,8 +1387,8 @@
 d7
 58
 00
-01
-a1
+63
+40
 67
 e1
 45
@@ -1316,7 +1396,7 @@
 58
 00
 01
-56
+6a
 67
 e1
 45
@@ -1356,7 +1436,7 @@
 c0
 00
 01
-53
+67
 6f
 e0
 c5
@@ -1379,8 +1459,8 @@
 01
 20
 20
-01
-a1
+63
+40
 70
 48
 d5
@@ -1412,7 +1492,7 @@
 20
 40
 01
-60
+74
 20
 40
 70
@@ -1456,7 +1536,7 @@
 20
 22
 81
-6b
+7f
 1f
 e2
 04
@@ -1464,7 +1544,7 @@
 20
 40
 01
-6e
+82
 1a
 20
 a2
@@ -1472,7 +1552,7 @@
 c2
 00
 01
-65
+79
 20
 60
 00
@@ -1488,31 +1568,31 @@
 20
 40
 01
-df
+d7
 20
 40
 01
-c1
+b9
 20
 40
 01
-b4
+ac
 20
 40
 01
-ac
+a4
 20
 40
 01
-77
+8b
 20
 40
 01
-7f
+93
 20
 20
-01
-90
+63
+22
 da
 60
 46
@@ -1520,7 +1600,7 @@
 da
 40
 01
-7a
+8e
 20
 20
 42
@@ -1552,7 +1632,7 @@
 da
 40
 01
-82
+96
 20
 20
 42
@@ -1576,7 +1656,7 @@
 20
 22
 81
-8d
+a1
 70
 48
 d7
@@ -1613,118 +1693,6 @@
 20
 43
 27
-6f
-e0
-c5
-1c
-c1
-80
-80
-00
-da
-60
-44
-f8
-da
-40
-01
-95
-20
-20
-42
-e7
-6f
-e0
-c5
-1c
-c1
-80
-80
-00
-6f
-e1
-44
-e9
-c3
-84
-80
-00
-6f
-e1
-45
-12
-67
-e1
-45
-16
-67
-e1
-45
-18
-6f
-e1
-44
-f4
-20
-40
-63
-c7
-6f
-e1
-44
-e9
-c3
-85
-80
-00
-20
-20
-43
-17
-6f
-e0
-c5
-1c
-c1
-80
-80
-00
-6f
-e1
-44
-f8
-68
-49
-44
-f6
-60
-49
-44
-f8
-24
-7a
-00
-00
-6f
-e1
-44
-f2
-20
-40
-63
-c7
-6f
-e1
-44
-e9
-c3
-85
-80
-00
-20
-20
-43
-17
 da
 60
 45
@@ -1732,7 +1700,7 @@
 da
 40
 01
-af
+a7
 20
 20
 42
@@ -1780,11 +1748,11 @@
 24
 3a
 01
-be
+b6
 20
 20
 01
-bb
+b3
 6f
 e2
 44
@@ -1794,9 +1762,9 @@
 46
 aa
 20
-20
-43
-21
+60
+00
+00
 6f
 e2
 44
@@ -1806,9 +1774,9 @@
 46
 aa
 20
-20
-43
-21
+60
+00
+00
 6f
 e0
 c8
@@ -1840,7 +1808,7 @@
 20
 22
 81
-cc
+c4
 da
 60
 48
@@ -1848,7 +1816,7 @@
 da
 40
 01
-d3
+cb
 20
 20
 42
@@ -1860,7 +1828,7 @@
 da
 40
 01
-cf
+c7
 20
 20
 42
@@ -1912,11 +1880,11 @@
 c0
 00
 01
-de
+d6
 c0
 00
 81
-dd
+d5
 20
 60
 00
@@ -1940,7 +1908,7 @@
 20
 40
 01
-fa
+f5
 24
 61
 00
@@ -1964,11 +1932,11 @@
 20
 40
 03
-31
+2c
 20
 40
 03
-12
+0d
 67
 e1
 48
@@ -1979,8 +1947,8 @@
 bb
 20
 40
-02
-00
+01
+fb
 6f
 e0
 c4
@@ -1988,7 +1956,7 @@
 c3
 00
 01
-f2
+ea
 70
 48
 c6
@@ -1996,7 +1964,7 @@
 20
 20
 01
-f0
+e8
 70
 48
 c5
@@ -2016,11 +1984,11 @@
 c2
 85
 81
-f6
+ee
 20
 40
 01
-de
+d6
 6f
 e0
 c8
@@ -2033,10 +2001,22 @@
 48
 c6
 00
+6f
+e0
+c3
+88
 20
-60
+7a
 00
 00
+20
+40
+01
+b0
+20
+20
+43
+21
 6f
 e0
 c8
@@ -2120,7 +2100,7 @@
 20
 21
 02
-1c
+17
 68
 49
 06
@@ -2132,11 +2112,11 @@
 24
 21
 02
-1e
+19
 20
 3a
 02
-1e
+19
 1f
 ef
 a2
@@ -2196,15 +2176,15 @@
 c0
 18
 82
-25
+20
 c0
 0a
 82
-27
+22
 c0
 1f
 82
-2b
+26
 20
 20
 62
@@ -2231,8 +2211,8 @@
 00
 20
 20
-01
-a1
+63
+40
 70
 48
 d4
@@ -2312,7 +2292,7 @@
 20
 40
 02
-4f
+4a
 2a
 2f
 fe
@@ -2344,7 +2324,7 @@
 20
 40
 02
-4f
+4a
 d8
 a0
 8a
@@ -2372,7 +2352,7 @@
 20
 21
 02
-44
+3f
 20
 20
 21
@@ -2476,7 +2456,7 @@
 20
 40
 02
-70
+6b
 70
 8a
 08
@@ -2520,7 +2500,7 @@
 c3
 02
 82
-71
+6c
 68
 59
 01
@@ -2556,7 +2536,7 @@
 c0
 08
 02
-90
+8b
 58
 00
 57
@@ -2600,7 +2580,7 @@
 c0
 08
 02
-8d
+88
 58
 00
 2b
@@ -2636,7 +2616,7 @@
 20
 20
 02
-89
+84
 58
 00
 83
@@ -2648,7 +2628,7 @@
 20
 20
 02
-7e
+79
 6f
 e0
 c3
@@ -2680,7 +2660,7 @@
 c5
 97
 82
-9f
+9a
 78
 3c
 fc
@@ -2724,7 +2704,7 @@
 20
 37
 02
-a8
+a3
 1b
 42
 04
@@ -2772,7 +2752,7 @@
 20
 40
 02
-b6
+b1
 6f
 e0
 81
@@ -2896,7 +2876,7 @@
 20
 40
 02
-dc
+d7
 6f
 e0
 c0
@@ -3008,7 +2988,7 @@
 20
 22
 82
-ef
+ea
 e7
 e0
 80
@@ -3028,7 +3008,7 @@
 c2
 00
 02
-e9
+e4
 1a
 42
 04
@@ -3164,11 +3144,11 @@
 c0
 00
 83
-16
+11
 c0
 01
 03
-1d
+18
 20
 60
 00
@@ -3200,7 +3180,7 @@
 20
 20
 03
-23
+1e
 58
 00
 03
@@ -3248,7 +3228,7 @@
 20
 40
 03
-05
+00
 6f
 f0
 8a
@@ -3284,7 +3264,7 @@
 20
 40
 03
-28
+23
 20
 40
 6f
@@ -3312,7 +3292,7 @@
 20
 40
 03
-28
+23
 6f
 e0
 c4
@@ -3344,7 +3324,7 @@
 20
 40
 03
-4a
+45
 68
 59
 01
@@ -3388,13 +3368,13 @@
 c3
 02
 83
-4a
+45
 20
 60
 00
 00
-bd
-54
+66
+fe
 aa
 55
 40
@@ -3435,7 +3415,7 @@
 00
 00
 00
-00
+01
 00
 70
 00
@@ -3492,30 +3472,22 @@
 00
 db
 42
-39
+3a
 31
 1f
-98
-07
-2a
+ac
+86
+13
 aa
 55
-0c
+04
 00
 6b
 42
-0b
-4d
-69
-6e
-69
-20
-53
-65
-6c
-66
-69
-65
+03
+54
+32
+30
 aa
 55
 06
@@ -3810,7 +3782,7 @@
 aa
 aa
 55
-a9
-5c
-fa
-19
+c8
+59
+08
+ab
Index: output/ramcode.rom
===================================================================
--- /1121s/branch/shutter/branch/shutter/dq_project/dq_yc1386p_shutter_adc_t20/output/ramcode.rom	(revision 4700)
+++ /1121s/branch/shutter/branch/shutter/dq_project/dq_yc1386p_shutter_adc_t20/output/ramcode.rom	(working copy)
@@ -1,36 +1,56 @@
 c2840012
-c000001b
-c0010072
-c008807b
-c00a0277
-c00a8108
-c00c0116
-c00c80d5
-c00d008d
-c01282cb
-c01382c0
-c0588120
-c062811d
-c06d0260
-c06d82f4
-c06e0331
-c06e8312
+c000002f
+c0010086
+c008808f
+c00a0272
+c00a811c
+c00c012a
+c00c80e9
+c00d00a1
+c01282c6
+c01382bb
+c0588134
+c0628131
+c06d025b
+c06d82ef
+c06e032c
+c06e830d
 2020235a
-c0120299
-c012806d
-c013005d
-c01c8293
-c01d001f
-c01f8046
-c0268297
+c008001c
+c0120294
+c0128081
+c0130071
+c01c828e
+c01d0033
+c01f805a
+c0268292
 c17f8000
 2020235a
+7854fc00
+58000017
+67e142e3
+1fe0fe04
+67e143b8
+70016901
+70438800
+6fe144e9
+793ffe0b
+67e144e9
+70001500
+20402592
+6fe10196
+67e142f5
+6fe1016a
+1feffe05
+1ff1fe00
+67e10196
+20202506
 2435a002
 37d98200
 37d98200
 20202002
 efe10006
-c0020024
+c0020038
 c0032ec8
 c002ae8a
 20600000
@@ -41,14 +61,14 @@
 1a220c00
 efe18006
 67e1c397
-c006002d
+c0060041
 20202b96
 efe10006
 67e106b5
 98002200
 68494398
 18467c07
-20228034
+20228048
 20202d50
 d8c0426b
 efe08006
@@ -69,13 +89,13 @@
 98408c00
 20207ccc
 7855fc00
-20370049
+2037005d
 2436a9b8
 204024d2
 6fe1409a
 67e10176
 6fe0c8d4
-243a005a
+243a006e
 6fe0c321
 c282a4e0
 c507a4e0
@@ -120,7 +140,7 @@
 20402018
 2040310f
 2040248c
-20200072
+20200086
 708a0f60
 708a10aa
 708a127a
@@ -150,14 +170,14 @@
 708a844a
 708a8540
 708a16fe
-204000dd
+204000f1
 6fe0c436
 205a70d7
-24558089
+2455809d
 37d98200
 70813b5f
 6fe0c099
-c00800ca
+c00800de
 6fe0c438
 1fe1fe04
 67f08a02
@@ -168,18 +188,18 @@
 67f18a73
 708a8660
 708a8b3b
-204000bc
+204000d0
 70804300
 70804205
 58557474
 67f18968
 7089606e
-20400232
-2040025d
-204000b6
+2040022d
+20400258
+204000ca
 7041480c
 20406f4e
-2020025f
+2020025a
 20758000
 37d98200
 6fe0c11c
@@ -187,7 +207,7 @@
 37d98200
 20600000
 6fe0c099
-c00c00c2
+c00c00d6
 6fe0c438
 1fe1fe06
 67f08a02
@@ -210,16 +230,16 @@
 67f18a73
 708a762a
 70890204
-202000a8
+202000bc
 6fe0c141
-c00500d8
+c00500ec
 2020220e
 708a1425
 58a93f3f
 67f18a60
 708a631f
 20600000
-20358104
+20358118
 6fe2020d
 207a0000
 37d98200
@@ -261,7 +281,7 @@
 6fe1415b
 207a0000
 67e1020f
-202000ee
+20200102
 2040686f
 204021ba
 18002a08
@@ -297,7 +317,7 @@
 67e1451d
 58000064
 67e144f6
-204001d0
+204001c8
 5800000e
 67e144f2
 58000140
@@ -307,23 +327,23 @@
 67e44512
 6fe448a6
 67e444fa
-58000158
+5800016c
 67e143db
-58000220
+5800021b
 67e143dd
 5800638a
 67e143df
-58000170
+58000184
 67e143e3
 58006365
 67e14524
-5800015b
+5800016f
 67e143d5
 58006329
 67e143d7
-580001a1
+58006340
 67e1451f
-58000156
+5800016a
 67e14521
 70415e07
 20402969
@@ -333,13 +353,13 @@
 204077ac
 20406396
 6fe0c51a
-c0000153
+c0000167
 6fe0c51b
 67e0c4ec
 202063a1
 7044ecff
 70451c01
-202001a1
+20206340
 7048d500
 2020639a
 dfe0000a
@@ -347,7 +367,7 @@
 20206327
 20406f35
 7044ecff
-20400160
+20400174
 2040701b
 2020739a
 6fe0c6ce
@@ -358,23 +378,23 @@
 efe08011
 6848c6cf
 98467c00
-2022816b
+2022817f
 1fe20400
-2040016e
+20400182
 1a20a201
-c2000165
+c2000179
 20600000
 79200407
 20206edd
-204001df
-204001c1
-204001b4
+204001d7
+204001b9
 204001ac
-20400177
-2040017f
-20200190
+204001a4
+2040018b
+20400193
+20206322
 da6046ca
-da40017a
+da40018e
 202042e0
 6fe144e9
 c284e39e
@@ -382,13 +402,13 @@
 7048d705
 20600000
 da6048d7
-da400182
+da400196
 202042e0
 6fe0c8d6
 1fe0fe01
 67e0c8d6
 1fe67c07
-2022818d
+202281a1
 7048d701
 6fe0c8d8
 79407e00
@@ -398,36 +418,8 @@
 7048d700
 20404325
 20204327
-6fe0c51c
-c1808000
-da6044f8
-da400195
-202042e7
-6fe0c51c
-c1808000
-6fe144e9
-c3848000
-6fe14512
-67e14516
-67e14518
-6fe144f4
-204063c7
-6fe144e9
-c3858000
-20204317
-6fe0c51c
-c1808000
-6fe144f8
-684944f6
-604944f8
-247a0000
-6fe144f2
-204063c7
-6fe144e9
-c3858000
-20204317
 da604518
-da4001af
+da4001a7
 202042e7
 7048d500
 70451c02
@@ -439,14 +431,14 @@
 6fe0c8c5
 247a0000
 6fe144f8
-243a01be
-202001bb
+243a01b6
+202001b3
 6fe244fe
 67e246aa
-20204321
+20600000
 6fe244fa
 67e246aa
-20204321
+20600000
 6fe0c8d5
 207a0000
 6fe0c8c5
@@ -454,12 +446,12 @@
 6fe0c8d0
 6848c8d1
 98467c00
-202281cc
+202281c4
 da6048cc
-da4001d3
+da4001cb
 202042e0
 da6048d3
-da4001cf
+da4001c7
 202042e0
 7048d100
 6fe0c8d2
@@ -472,38 +464,41 @@
 6fe0c8ce
 79407e00
 67e0c8ce
-c00001de
-c00081dd
+c00001d6
+c00081d5
 20600000
 20204323
 20204325
 6fe0c8d5
 207a0000
-204001fa
+204001f5
 24610000
 7048c400
 70440701
 20406ff3
 20406feb
-20400331
-20400312
+2040032c
+2040030d
 67e148c1
 da2048bb
-20400200
+204001fb
 6fe0c40c
-c30001f2
+c30001ea
 7048c601
-202001f0
+202001e8
 7048c501
 20600000
 7048c500
 6fe144e9
-c28581f6
-204001de
+c28581ee
+204001d6
 6fe0c8c6
 207a0000
 7048c600
-20600000
+6fe0c388
+207a0000
+204001b0
+20204321
 6fe0c8c4
 1fe0fe01
 67e0c8c4
@@ -524,11 +519,11 @@
 6fe10676
 68490670
 98467c00
-2021021c
+20210217
 68490672
 98467e00
-2421021e
-203a021e
+24210219
+203a0219
 1fefa264
 6fe10670
 68490672
@@ -543,16 +538,16 @@
 7048cb00
 20600000
 1a627e00
-c0188225
-c00a8227
-c01f822b
+c0188220
+c00a8222
+c01f8226
 202062da
 7048d401
 20600000
 7048d400
 204078ad
 7044f100
-202001a1
+20206340
 7048d401
 204078ad
 7044f101
@@ -572,7 +567,7 @@
 708ac200
 708ac300
 d8e00006
-2040024f
+2040024a
 2a2ffe0d
 2040211d
 2a4ffe0d
@@ -580,14 +575,14 @@
 d8e00005
 2040211c
 2040211e
-2040024f
+2040024a
 d8a08ac2
 1a31fe00
 20402117
 1a51fe00
 20402117
 18e08fff
-20210244
+2021023f
 2020214f
 2000003c
 58000f00
@@ -613,7 +608,7 @@
 6fe0c409
 67f080cd
 20000bb8
-20400270
+2040026b
 708a08c1
 6a40c419
 df200008
@@ -624,7 +619,7 @@
 20600000
 7080cc03
 6ff08129
-c3028271
+c302826c
 68590164
 6049440a
 7080cc00
@@ -633,7 +628,7 @@
 708a8d12
 708a8e0a
 6fe0c099
-c0080290
+c008028b
 58005762
 67f10907
 70890103
@@ -644,7 +639,7 @@
 708a8d44
 708a8e0a
 6fe0c099
-c008028d
+c0080288
 58002bb1
 67f10907
 c6978000
@@ -653,10 +648,10 @@
 20600000
 58004189
 67f10907
-20200289
+20200284
 58008312
 67f10907
-2020027e
+20200279
 6fe0c334
 c1000000
 c001b04a
@@ -664,7 +659,7 @@
 793f8030
 20202af6
 204025c2
-c597829f
+c597829a
 783cfc00
 2000001e
 204025c2
@@ -675,7 +670,7 @@
 78507c00
 19623600
 37c18400
-203702a8
+203702a3
 1b420400
 604b000f
 242c26fa
@@ -687,7 +682,7 @@
 984fb600
 20406877
 20372677
-204002b6
+204002b1
 6fe08168
 c301a677
 2055a477
@@ -718,7 +713,7 @@
 6fe240ad
 9840fe00
 67e240ad
-204002dc
+204002d7
 6fe0c0cb
 79207e04
 204023e1
@@ -746,12 +741,12 @@
 efe08011
 e8408013
 98467c00
-202282ef
+202282ea
 e7e08013
 37d98200
 1a20a201
 1a60a601
-c20002e9
+c20002e4
 1a420400
 20600000
 6fe401fd
@@ -785,8 +780,8 @@
 67f08a0a
 20600000
 6fe0c407
-c0008316
-c001031d
+c0008311
+c0010318
 20600000
 580003e8
 67e14405
@@ -794,7 +789,7 @@
 6fe148b4
 da600e10
 20406fc0
-20200323
+2020031e
 580003e8
 67e14405
 684948ae
@@ -806,7 +801,7 @@
 684948b8
 9846fc00
 20207d5f
-20400305
+20400300
 6ff08a09
 793ffe07
 67f08a09
@@ -815,14 +810,14 @@
 708a0d61
 708a0b00
 20600000
-20400328
+20400323
 20406f90
 6fe0c409
 67f080cd
 20406f97
 708a0d60
 7080cd00
-20400328
+20400323
 6fe0c409
 67f080cd
 708a0b50
@@ -830,7 +825,7 @@
 df00000b
 6de1440a
 7080cc03
-2040034a
+20400345
 68590164
 604948b8
 20406f9c
@@ -841,5 +836,5 @@
 7080cc00
 20600000
 6ff08129
-c302834a
+c3028345
 20600000
Index: output/sched.rom
===================================================================
--- /1121s/branch/shutter/branch/shutter/dq_project/dq_yc1386p_shutter_adc_t20/output/sched.rom	(revision 4700)
+++ /1121s/branch/shutter/branch/shutter/dq_project/dq_yc1386p_shutter_adc_t20/output/sched.rom	(working copy)
@@ -33,7 +33,7 @@
 00   #mem_patch1f
 00   #mem_patch20
 00   #mem_patch21
-00   #mem_patch22
+01   #mem_patch22
 00   #mem_patch23
 70   #mem_patch24
 00   #mem_patch25
@@ -69,12 +69,12 @@
 mem_ui_button_gpio:ff
 mem_otp_load_check_sum:5a
 
-mem_le_lap:39 31 1f 98 07 2a
+mem_le_lap:3a 31 1f ac 86 13
 mem_le_name_len:
-'Mini Selfie
+'T20
 
 mem_shutter_key_conf0_temp:11 05 90 01 05
-# mem_shutter_key_conf0_temp:15 08 8c 01 05
+# mem_shutter_key_conf0_temp:08 ff 8c 01 08
 
 mem_shutter_soft_switch_first_power_on:00
 
Index: program/patch.prog
===================================================================
--- /1121s/branch/shutter/branch/shutter/dq_project/dq_yc1386p_shutter_adc_t20/program/patch.prog	(revision 4700)
+++ /1121s/branch/shutter/branch/shutter/dq_project/dq_yc1386p_shutter_adc_t20/program/patch.prog	(working copy)
@@ -24,6 +24,7 @@
 endif
 	branch assert
 pf_patch_ext:
+	beq patch22_0,p_le_init_slave
 	beq patch24_4,p_le_receive_rxon
 	beq patch24_5,p_le_rx_dec
 	beq patch24_6,p_le_rx_nopayload
@@ -34,6 +35,29 @@
 	rtneq patch3f_7
 	branch assert
 
+p_le_init_slave:
+	disable master
+ 	setarg 0x17
+ 	store 2,mem_le_remote_mtu
+	increase 4,pdata
+	store 2,mem_remote_rx_max_octets
+	jam lemode_slave,mem_le_mode
+	jam 0,mem_le_adv_enable
+
+	fetch 2,mem_ui_state_map
+	set0 UI_STATE_BLE_ADV,pdata
+	store 2,mem_ui_state_map
+
+	jam 0,mem_lpm_current_mult
+	call le_clear_pairing_state
+	fetch 2,mem_le_superto
+	store 2,mem_le_init_superto
+	fetch 2,mem_le_tsniff
+	mul32 pdata,5,pdata
+	rshift4 pdata,pdata
+	store 2,mem_le_superto			// vol.6 part B 4.5.2 only 6*conninterval before establish
+	branch le_init_conn
+
 p_soft_reset:
 	nbranch soft_reset+1,wake
 	until null,lpo_edge
@@ -416,7 +440,7 @@
 	setarg shutter_process_lpm_before
 	store 2,mem_cb_before_lpm
 
-	setarg p_shutter_soft_swtich_power_on
+	setarg shutter_soft_swtich_power_on
 	store 2,mem_shutter_soft_switch_poweron_callback_function
 	
 	setarg p_shutter_soft_swtich_power_off
@@ -440,7 +464,7 @@
 p_shutter_hart_swtich_power_on:
 	jam UI_BUTTON_GPIO_DISABLE,mem_ui_button_gpio
 	jam SS_STATE_POWER_ON,mem_shutter_soft_switch_power_state
-	branch p_shutter_start_reconnect
+	branch shutter_start_reconnect
 
 p_shutter_soft_swtich_power_off:
 	jam 0,mem_shutter_start_adc_flag
@@ -551,12 +575,12 @@
 ifdef ADC_1121SB
 	call p_shutter_adc_read_timer
 	call p_shutter_lowpower_led_timer
-endif
-	call p_shutter_led_set1_timer //低电优先广播灯效	
+endif	
+	call p_shutter_led_set1_timer
 	call p_shutter_check_sleep_timer
 	call p_shutter_check_power_off_timer
 	call p_shutter_check_2s_timer
-	branch p_ble_shutter_reconn_timer
+	branch ble_shutter_reconn_timer
 
 p_shutter_check_power_off_timer:
 	arg mem_shutter_power_off_timer,regc
@@ -598,42 +622,44 @@
 	call app_led_off
 	branch app_enter_hibernate
 
-p_ble_shutter_reconn_timer:
-	fetch 1,mem_shutter_soft_switch_power_state
-	rtnne SS_STATE_POWER_ON
-	arg mem_ble_shutter_reconn_timer,regc
-	arg p_shutter_start_bluetooth_discovery,regb
-	branch timer_single_step_2B
-
-p_shutter_start_bluetooth_discovery:
-	fetch 1,mem_shutter_soft_switch_power_state
-	rtnne SS_STATE_POWER_ON
-p_ble_shutter_start_discovery:
-	fetch 2,mem_ui_state_map
-	rtnbit1 UI_STATE_BLE_CONNECTED
-	fetch 2,mem_ble_shutter_discovery_timeout
-	store 2,mem_shutter_sleep_timeout
-	store 2,mem_shutter_sleep_timer
-	fetch 2,mem_ble_shutter_discovery_adv_interval
-	call shutter_ble_adv_interval_set
-	fetch 2,mem_ui_state_map
-	rtnbit1 UI_STATE_BLE_ADV
-	branch app_ble_start_adv
-
-p_shutter_soft_swtich_power_on:
-p_shutter_start_reconnect:
-	fetch 1,mem_shutter_soft_switch_power_state
-	rtnne SS_STATE_POWER_ON
-p_ble_shutter_start_reconnect:
-	fetch 2,mem_ble_shutter_reconn_timer
-	fetcht 2,mem_ble_shutter_reconn_timeout
-	storet 2,mem_ble_shutter_reconn_timer
-	nrtn blank
-	fetch 2,mem_ble_shutter_reconn_adv_interval
-	call shutter_ble_adv_interval_set
-	fetch 2,mem_ui_state_map
-	rtnbit1 UI_STATE_BLE_ADV
-	branch app_ble_start_adv
+// p_ble_shutter_reconn_timer:
+// 	fetch 1,mem_shutter_soft_switch_power_state
+// 	rtnne SS_STATE_POWER_ON
+// 	arg mem_ble_shutter_reconn_timer,regc
+// 	arg p_shutter_start_bluetooth_discovery,regb
+// 	branch timer_single_step_2B
+
+// p_shutter_start_bluetooth_discovery:
+// 	fetch 1,mem_shutter_soft_switch_power_state
+// 	rtnne SS_STATE_POWER_ON
+// p_ble_shutter_start_discovery:
+// 	fetch 2,mem_ui_state_map
+// 	rtnbit1 UI_STATE_BLE_CONNECTED
+// 	fetch 2,mem_ble_shutter_discovery_timeout
+// 	store 2,mem_shutter_sleep_timeout
+// 	store 2,mem_shutter_sleep_timer
+// 	fetch 2,mem_ble_shutter_discovery_adv_interval
+// 	call shutter_ble_adv_interval_set
+// 	call app_led_start_blink
+// 	fetch 2,mem_ui_state_map
+// 	rtnbit1 UI_STATE_BLE_ADV
+// 	branch app_ble_start_adv
+
+// p_shutter_soft_swtich_power_on:
+// p_shutter_start_reconnect:
+// 	fetch 1,mem_shutter_soft_switch_power_state
+// 	rtnne SS_STATE_POWER_ON
+// p_ble_shutter_start_reconnect:
+// 	fetch 2,mem_ble_shutter_reconn_timer
+// 	fetcht 2,mem_ble_shutter_reconn_timeout
+// 	storet 2,mem_ble_shutter_reconn_timer
+// 	nrtn blank
+// 	fetch 2,mem_ble_shutter_reconn_adv_interval
+// 	call shutter_ble_adv_interval_set
+// 	call app_led_start_blink
+// 	fetch 2,mem_ui_state_map
+// 	rtnbit1 UI_STATE_BLE_ADV
+// 	branch app_ble_start_adv
 
 p_shutter_check_sleep_timer:
 	arg mem_shutter_sleep_timer,regc
@@ -659,12 +685,12 @@
 p_shutter_disc_timer_init:
 	fetch 4,mem_ble_shutter_discovery_blink_on_time
 	store 4,mem_shutter_led_struct_app_led_on_time
-	branch app_led_start_blink
+	rtn
 
 p_shutter_recon_timer_init:
 	fetch 4,mem_ble_shutter_reconn_blink_on_time
 	store 4,mem_shutter_led_struct_app_led_on_time
-	branch app_led_start_blink
+	rtn
 
 ifdef ADC_1121SB
 p_shutter_lowpower_led_timer:
@@ -745,7 +771,12 @@
 	fetch 1,mem_shutter_adc_last_low_voltage_flag
 	rtn blank
 	jam 0,mem_shutter_adc_last_low_voltage_flag
-	rtn
+	fetch 1,mem_le_adv_enable
+	rtn blank
+	call p_shutter_led_set1_timer+4
+	branch app_led_start_blink
+	
+	
 
 // p_shutter_low_voltage_power_down:	//shutterdown
 // 	jam 1,mem_shutter_enable_power_down_flag
@@ -818,7 +849,7 @@
 	jam 0,mem_shutter_ble_connect_flag
 	call queue_init
 	jam 0,mem_ble_shutter_enable_notify
-	branch p_shutter_start_reconnect
+	branch shutter_start_reconnect
 
 
 p_ble_shutter_process_reconnect_complete:
Index: sched/shutter.dat
===================================================================
--- /1121s/branch/shutter/branch/shutter/dq_project/dq_yc1386p_shutter_adc_t20/sched/shutter.dat	(revision 4700)
+++ /1121s/branch/shutter/branch/shutter/dq_project/dq_yc1386p_shutter_adc_t20/sched/shutter.dat	(working copy)
@@ -2,12 +2,12 @@
 mem_ui_button_gpio:ff
 mem_otp_load_check_sum:5a
 
-mem_le_lap:39 31 1f 98 07 2a
+mem_le_lap:3a 31 1f ac 86 13
 mem_le_name_len:
-'Mini Selfie
+'T20
 
 mem_shutter_key_conf0_temp:11 05 90 01 05
-# mem_shutter_key_conf0_temp:15 08 8c 01 05
+# mem_shutter_key_conf0_temp:08 ff 8c 01 08
 
 mem_shutter_soft_switch_first_power_on:00
 
