Index: output/otp.dat
===================================================================
--- /1121s/branch/shutter/branch/shutter/jxy_project/yc1386s_jxy_371-JM78/output/otp.dat	(revision 3432)
+++ /1121s/branch/shutter/branch/shutter/jxy_project/yc1386s_jxy_371-JM78/output/otp.dat	(working copy)
@@ -11,7 +11,7 @@
 00
 aa
 55
-9a
+ee
 08
 c2
 84
@@ -32,19 +32,19 @@
 c0
 0a
 01
-b1
+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
-05
+10
 c0
 13
-81
-fa
+82
+05
 c0
 58
 81
-02
+03
 c0
 62
-80
-ff
+81
+00
 c0
 6d
 01
-9a
+a5
 20
 20
 23
@@ -80,7 +80,7 @@
 c0
 12
 01
-d3
+de
 c0
 12
 80
@@ -92,7 +92,7 @@
 c0
 1c
 81
-cd
+d8
 c0
 1f
 80
@@ -100,7 +100,7 @@
 c0
 26
 81
-d1
+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
-6c
+77
 20
 40
 01
-97
+a2
 20
 40
 00
-99
+9a
 70
 41
 48
@@ -624,7 +628,7 @@
 20
 20
 01
-99
+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
@@ -1061,6 +1065,10 @@
 75
 80
 00
+20
+40
+70
+d7
 58
 00
 1e
@@ -1111,8 +1119,8 @@
 fa
 58
 00
-63
-27
+01
+2d
 67
 e1
 43
@@ -1120,7 +1128,7 @@
 58
 00
 01
-26
+30
 67
 e1
 43
@@ -1136,7 +1144,7 @@
 58
 00
 01
-64
+6f
 67
 e1
 43
@@ -1144,15 +1152,23 @@
 58
 00
 01
-31
+3b
 67
 e1
 45
 24
+58
+00
+01
+2a
+67
+e1
+43
+d5
 20
 40
 62
-c2
+c4
 20
 40
 63
@@ -1164,7 +1180,7 @@
 c0
 00
 01
-23
+27
 6f
 e0
 c5
@@ -1189,6 +1205,30 @@
 20
 63
 40
+70
+44
+ec
+ff
+20
+40
+63
+29
+20
+20
+73
+9a
+df
+e0
+00
+0a
+20
+40
+70
+c8
+20
+20
+63
+27
 1a
 62
 7e
@@ -1196,15 +1236,15 @@
 c0
 18
 81
-2b
+35
 c0
 0a
 81
-2d
+37
 c0
 1f
 81
-65
+70
 20
 20
 62
@@ -1248,7 +1288,7 @@
 20
 3a
 01
-38
+42
 70
 48
 c2
@@ -1260,7 +1300,7 @@
 20
 20
 01
-42
+4c
 70
 48
 c2
@@ -1292,7 +1332,7 @@
 24
 3a
 01
-41
+4b
 70
 48
 c1
@@ -1316,11 +1356,11 @@
 c0
 00
 01
-52
+5c
 c0
 00
 81
-48
+52
 20
 60
 00
@@ -1364,7 +1404,7 @@
 20
 20
 01
-61
+6b
 58
 00
 00
@@ -1404,7 +1444,7 @@
 20
 20
 01
-61
+6b
 68
 49
 44
@@ -1440,6 +1480,10 @@
 20
 20
 63
+71
+20
+20
+63
 0e
 70
 48
@@ -1520,7 +1564,7 @@
 20
 40
 01
-89
+94
 2a
 2f
 fe
@@ -1552,7 +1596,7 @@
 20
 40
 01
-89
+94
 d8
 a0
 8a
@@ -1580,7 +1624,7 @@
 20
 21
 01
-7e
+89
 20
 20
 21
@@ -1684,7 +1728,7 @@
 20
 40
 01
-aa
+b5
 70
 8a
 08
@@ -1728,7 +1772,7 @@
 c3
 02
 81
-ab
+b6
 68
 59
 01
@@ -1764,7 +1808,7 @@
 c0
 08
 01
-ca
+d5
 58
 00
 57
@@ -1808,7 +1852,7 @@
 c0
 08
 01
-c7
+d2
 58
 00
 2b
@@ -1844,7 +1888,7 @@
 20
 20
 01
-c3
+ce
 58
 00
 83
@@ -1856,7 +1900,7 @@
 20
 20
 01
-b8
+c3
 6f
 e0
 c3
@@ -1888,7 +1932,7 @@
 c5
 97
 81
-d9
+e4
 78
 3c
 fc
@@ -1932,7 +1976,7 @@
 20
 37
 01
-e2
+ed
 1b
 42
 04
@@ -1980,7 +2024,7 @@
 20
 40
 01
-f0
+fb
 6f
 e0
 81
@@ -2096,7 +2140,7 @@
 20
 40
 00
-9b
+9c
 6f
 e2
 40
@@ -2112,11 +2156,51 @@
 20
 40
 02
-0e
+23
+6f
+e0
+c0
+cb
+79
+20
+7e
+04
+20
+40
+23
+e1
+24
+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
-25
+2e
 60
 04
 40
@@ -2184,7 +2268,7 @@
 20
 22
 82
-21
+36
 e7
 e0
 80
@@ -2204,7 +2288,7 @@
 c2
 00
 02
-1b
+30
 1a
 42
 04
@@ -2213,8 +2297,8 @@
 60
 00
 00
-96
-7b
+5c
+2e
 aa
 55
 40
@@ -2599,5 +2683,5 @@
 55
 18
 55
-8f
-89
+13
+f8
Index: output/ramcode.rom
===================================================================
--- /1121s/branch/shutter/branch/shutter/jxy_project/yc1386s_jxy_371-JM78/output/ramcode.rom	(revision 3165)
+++ /1121s/branch/shutter/branch/shutter/jxy_project/yc1386s_jxy_371-JM78/output/ramcode.rom	(working copy)
@@ -2,24 +2,24 @@
 c0000018
 c001005a
 c0088063
-c00a01b1
-c00a80ea
-c00c00f8
-c00c80b7
+c00a01bc
+c00a80eb
+c00c00f9
+c00c80b8
 c00d0071
 c00e001c
-c0128205
-c01381fa
-c0588102
-c06280ff
-c06d019a
+c0128210
+c0138205
+c0588103
+c0628100
+c06d01a5
 2020235a
-c01201d3
+c01201de
 c0128055
 c0130045
-c01c81cd
+c01c81d8
 c01f802a
-c02681d1
+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
-2040016c
-20400197
-20400099
+20400177
+204001a2
+2040009a
 7041480c
 20406f4e
-20200199
+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
@@ -260,6 +261,7 @@
 7080d6c0
 20407396
 20758000
+204070d7
 58001e1e
 67e1451d
 7040a60a
@@ -272,30 +274,38 @@
 67e44512
 6fe448a6
 67e444fa
-58006327
+5800012d
 67e143db
-58000126
+58000130
 67e143dd
 5800638a
 67e143df
-58000164
+5800016f
 67e143e3
-58000131
+5800013b
 67e14524
-204062c2
+5800012a
+67e143d5
+204062c4
 20406396
 6fe0c51a
-c0000123
+c0000127
 6fe0c51b
 67e0c4ec
 202063a1
 7044ecff
 70451c01
 20206340
+7044ecff
+20406329
+2020739a
+dfe0000a
+204070c8
+20206327
 1a627e00
-c018812b
-c00a812d
-c01f8165
+c0188135
+c00a8137
+c01f8170
 202062da
 7048ae01
 20600000
@@ -306,10 +316,10 @@
 2040635d
 24760000
 1a227e00
-203a0138
+203a0142
 7048c200
 20404323
-20200142
+2020014c
 7048c201
 7048c100
 20404325
@@ -317,14 +327,14 @@
 6fe0c8c1
 247a0000
 6fe0c8c2
-243a0141
+243a014b
 7048c101
 20206371
 6fe0c8c3
 79407e00
 67e0c8c3
-c0000152
-c0008148
+c000015c
+c0008152
 20600000
 58000000
 67e1452e
@@ -335,7 +345,7 @@
 58000006
 67e1455b
 da60452e
-20200161
+2020016b
 58000000
 67e1452e
 58000002
@@ -345,7 +355,7 @@
 58000006
 67e1455b
 da60452e
-20200161
+2020016b
 68494430
 e7e08002
 efe08005
@@ -354,6 +364,7 @@
 dfe00005
 98effe00
 9a60a600
+20206371
 2020630e
 7048ae01
 204078ad
@@ -374,7 +385,7 @@
 708ac200
 708ac300
 d8e00006
-20400189
+20400194
 2a2ffe0d
 2040211d
 2a4ffe0d
@@ -382,14 +393,14 @@
 d8e00005
 2040211c
 2040211e
-20400189
+20400194
 d8a08ac2
 1a31fe00
 20402117
 1a51fe00
 20402117
 18e08fff
-2021017e
+20210189
 2020214f
 2000003c
 58000f00
@@ -415,7 +426,7 @@
 6fe0c409
 67f080cd
 20000bb8
-204001aa
+204001b5
 708a08c1
 6a40c419
 df200008
@@ -426,7 +437,7 @@
 20600000
 7080cc03
 6ff08129
-c30281ab
+c30281b6
 68590164
 6049440a
 7080cc00
@@ -435,7 +446,7 @@
 708a8d12
 708a8e0a
 6fe0c099
-c00801ca
+c00801d5
 58005762
 67f10907
 70890103
@@ -446,7 +457,7 @@
 708a8d44
 708a8e0a
 6fe0c099
-c00801c7
+c00801d2
 58002bb1
 67f10907
 c6978000
@@ -455,10 +466,10 @@
 20600000
 58004189
 67f10907
-202001c3
+202001ce
 58008312
 67f10907
-202001b8
+202001c3
 6fe0c334
 c1000000
 c001b04a
@@ -466,7 +477,7 @@
 793f8030
 20202af6
 204025c2
-c59781d9
+c59781e4
 783cfc00
 2000001e
 204025c2
@@ -477,7 +488,7 @@
 78507c00
 19623600
 37c18400
-203701e2
+203701ed
 1b420400
 604b000f
 242c26fa
@@ -489,7 +500,7 @@
 984fb600
 20406877
 20372677
-204001f0
+204001fb
 6fe08168
 c301a677
 2055a477
@@ -518,12 +529,22 @@
 6fe143e9
 20407d79
 58000012
-2040009b
+2040009c
 6fe240ad
 9840fe00
 67e240ad
-2040020e
-20202425
+20400223
+6fe0c0cb
+79207e04
+204023e1
+2455a3cb
+37d98200
+1b227e00
+67e340b1
+6fe1c0c6
+6a20c0c9
+df200003
+2020242e
 600440e7
 d8c08070
 d8a040cc
@@ -540,11 +561,11 @@
 efe08011
 e8408013
 98467c00
-20228221
+20228236
 e7e08013
 37d98200
 1a20a201
 1a60a601
-c200021b
+c2000230
 1a420400
 20600000
Index: output/sched.rom
===================================================================
--- /1121s/branch/shutter/branch/shutter/jxy_project/yc1386s_jxy_371-JM78/output/sched.rom	(revision 3432)
+++ /1121s/branch/shutter/branch/shutter/jxy_project/yc1386s_jxy_371-JM78/output/sched.rom	(working copy)
@@ -74,8 +74,8 @@
 # 'AB Shutter3
 'Selfie
 
-mem_shutter_key_conf0_temp:11 ff 90 01 11 #pcb2022-277
-# mem_shutter_key_conf0_temp:15 ff 8c 01 15 #pcb2022-277
+mem_shutter_key_conf0_temp:11 ff 90 01 11 
+# mem_shutter_key_conf0_temp:15 ff 8c 01 15
 mem_shutter_soft_switch_first_power_on:00
 
 mem_tx_power:05
Index: program/patch.prog
===================================================================
--- /1121s/branch/shutter/branch/shutter/jxy_project/yc1386s_jxy_371-JM78/program/patch.prog	(revision 3165)
+++ /1121s/branch/shutter/branch/shutter/jxy_project/yc1386s_jxy_371-JM78/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
@@ -342,7 +342,8 @@
 
 	call enable_authrom
 	rtn wake
-	
+	call wdt_set_disable
+
 	setarg 0x1e1e
 	store 2,mem_shutter_soft_switch_poweron_time
 
@@ -358,7 +359,7 @@
 	fetch 8,mem_shutter_reconn_or_discovery_blink_time_conf
 	store 8,mem_ble_shutter_reconn_blink_on_time
 
-	setarg shutter_process_idle
+	setarg p_shutter_process_idle
 	store 2,mem_cb_idle_process
 
 	setarg p_shutter_process_bb_event
@@ -373,7 +374,10 @@
 	setarg p_shutter_key_change
 	store 2,mem_cb_shutter_keycan
 
-	call shutter_common_init
+	setarg p_shutter_le_before_hibernate
+	store 2,mem_cb_before_hibernate
+
+	call shutter_common_init+2
 	call shutter_load_buffer_config_form_DataRom
 
 p_shutter_power_switch:
@@ -388,6 +392,16 @@
 	jam SS_STATE_POWER_ON,mem_shutter_soft_switch_power_state
 	branch shutter_start_reconnect
 
+p_shutter_le_before_hibernate:
+	jam GPIO_DISABLE,mem_ui_button_gpio
+	call shutter_process_lpm_before
+	branch disable_authrom
+
+p_shutter_process_idle:
+	arg 10, pdata //Լ96ms
+	call wdt_init_config
+	branch shutter_process_idle
+
 p_shutter_process_bb_event:
 	copy regc,pdata
 	beq BT_EVT_LE_PAIRING_SUCCESS,p_ble_shutter_pair_success
@@ -477,6 +491,7 @@
 	arg MAX_QUEUE_NUM,pdata
 	imul32 queue,pdata
 	iadd regc,regc
+	branch push_buffer_in_queue
 
 p_shutter_le_bb_event_timer:
 ifdef ADC_1121SB
@@ -794,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
Index: sched/shutter.dat
===================================================================
--- /1121s/branch/shutter/branch/shutter/jxy_project/yc1386s_jxy_371-JM78/sched/shutter.dat	(revision 3165)
+++ /1121s/branch/shutter/branch/shutter/jxy_project/yc1386s_jxy_371-JM78/sched/shutter.dat	(working copy)
@@ -7,8 +7,8 @@
 # 'AB Shutter3
 'Selfie
 
-mem_shutter_key_conf0_temp:11 ff 90 01 11 #pcb2022-277
-# mem_shutter_key_conf0_temp:15 ff 8c 01 15 #pcb2022-277
+mem_shutter_key_conf0_temp:11 ff 90 01 11 
+# mem_shutter_key_conf0_temp:15 ff 8c 01 15
 mem_shutter_soft_switch_first_power_on:00
 
 mem_tx_power:05
