Index: format/app.format
===================================================================
--- /1121s/branch/shutter/branch/shutter/jxy_project/yc1386s_jxy_114_new/format/app.format	(revision 5827)
+++ /1121s/branch/shutter/branch/shutter/jxy_project/yc1386s_jxy_114_new/format/app.format	(working copy)
@@ -64,13 +64,16 @@
 2 mem_queue_ptr
 
 
-//adc
+0 mem_reference_inter1p8v_2v_adc_io_data
 0 mem_inter1v_adc_ft_data
 2 mem_3v_adc_io_data
+0 mem_reference_inter1p8v_2p6v_adc_vdcdc_data
 0 mem_inter1p2v_adc_ft_data
 2 mem_2v_adc_hvin_data
+0 mem_reference_inter1p8v_1v_adc_io_data
 0 mem_io1v_adc_ft_data
 2 mem_1v_adc_io_data
+0 mem_reference_inter1p8v_4p6v_adc_vdcdc_data
 0 mem_io2v_adc_ft_data
 2 mem_3v_adc_hvin_data
 0 mem_adc_ratio
@@ -191,8 +194,7 @@
 
 amemalloc mem_otp_temp(
 	8 mem_otp_adc
-	1 mem_otp_adc_ratio
-	7 mem_otp_temp0
+	8 mem_otp_temp0
 	1 mem_otp_core_ldo
 	1 mem_otp_verf_bg
 	1 mem_otp_charge_pump
@@ -215,6 +217,8 @@
 7 OTP_OFFSET_XRAM_BISTFIX	//2 byte
 9 OTP_OFFSET_PATCH_BISTFIX	//2 byte
 
+0xfc0 OTP_OFFSET_ADC_PARAM_L_C0
+
 0xfd0 OTP_OFFSET_ADC_PARAM_L
 0xff0 OTP_OFFSET_UCODE_KEY_L
 0x1000 OTP_OFFSET_H
@@ -233,7 +237,7 @@
 (
 4 DVC_OP_DONGLE
 5 DVC_OP_TEST
-6 DVC_OP_SHUTTER_DY   
+6 DVC_OP_SHUTTER_DY
 8 DVC_OP_MOUSE
 9 DVC_OP_SHUTTER
 0X0A DVC_OP_MODULE
@@ -241,7 +245,7 @@
 0X0C DVC_OP_HCI_BOOT
 0X0D DVC_OP_REMOTE_CAR
 0X0E DVC_OP_CAR
-0X0F DVC_OP_KEYBOARD   
+0X0F DVC_OP_KEYBOARD
 )
 
 
@@ -375,3 +379,8 @@
 0x0e ADC_CH_GPIO13
 )
 
+//mem_adc_reference_mode
+(
+1 SADC_REFERENCE_INTER3V
+2 SADC_REFERENCE_INTER1P8V_DIV2
+)
\ No newline at end of file
Index: format/app_shutter.format
===================================================================
--- /1121s/branch/shutter/branch/shutter/jxy_project/yc1386s_jxy_114_new/format/app_shutter.format	(revision 5827)
+++ /1121s/branch/shutter/branch/shutter/jxy_project/yc1386s_jxy_114_new/format/app_shutter.format	(working copy)
@@ -124,30 +124,7 @@
 4 mem_shutter_discovery_time_conf
 8 mem_shutter_reconn_or_discovery_blink_time_conf
 
-//sleep
-8 mem_new_shutter_enter_hibernate
-2 mem_shutter_discon_enter_hibinate_timer
-2 mem_shutter_conn_enter_hibinate_timer
-1 mem_le_shutter_long_press_flag
-1 mem_shutter_long_press_flag
-1 mem_shutter_release_flag
-4 mem_shutter_btclk
-1 mem_shutter_interval
-2 mem_shutter_btclk_count
-1 mem_shtter_init_flag
-1 mem_tank_powerup_flag
-1 mem_enable_key_scan
-2 mem_power_on_led_status_modify
-
-1 mem_shutter_power_off_flag
-1 mem_shutter_start_adc_flag
-1 mem_shutter_conn_state_flag
-1 mem_power_off_enter_hibernate_flag
-4 mem_shutter_ble_discovery_conf
-2 mem_shutter_connect_enter
-2 mem_shtter_sleep_count
-2 mem_shtter_sleep_temp
-2 mem_shtter_sleep_data
+1 mem_shutter_ble_connect_flag
 
 //adc
 //adc struct
@@ -157,6 +134,7 @@
 2 mem_shutter_vdd_low_vol
 2 mem_shutter_vdd_now_vol
 
+1 mem_shutter_start_adc_flag
 1 mem_shutter_adc_read_timeout
 1 mem_shutter_adc_read_timer
 1 mem_shutter_enable_low_voltage_flag
@@ -168,33 +146,33 @@
 1 mem_shutter_power_down_led_count
 1 mem_shutter_battery_level_percentage
 
-1 mem_shutter_lowpower_time
-1 mem_shutter_lowpower_gpio
-1 mem_shutter_lowpower_blink_flag
+1 mem_shutter_long_press_flag
+1 mem_shutter_release_flag
 1 mem_shutter_adc_read_time_init
 
+2 mem_shutter_le_recon_adv_interval
+2 mem_shutter_le_discovery_adv_interval
+2 mem_shutter_le_recon_timeout
+
+//sleep
+8 mem_new_shutter_enter_hibernate
+2 mem_shutter_discon_enter_hibinate_timer
+2 mem_shutter_conn_enter_hibinate_timer
+1 mem_le_shutter_long_press_flag
+4 mem_shutter_btclk
+1 mem_shutter_interval
+2 mem_shutter_btclk_count
+1 mem_shutter_power_off_flag
+1 mem_shutter_conn_state_flag
+1 mem_power_off_enter_hibernate_flag
+
 1 mem_shutter_led_enable
 1 mem_shutter_led_time_init
 1 mem_shutter_led_time
 1 mem_shutter_led_on_off_flag
 1 mem_shutter_led_count
 1 mem_shutter_led_count_init
-1 mem_shutter_otp_first_poweron
-1 mem_shutter_ble_connect_flag
-)
 
-(
-0x1fb0 OTP_OFFSET_APP_INITLAG
-)
-
-(
-1 weak_pullup
-2 weak_pullup_low_wakeup
-3 low_wakeup
-4 high_wakeup
-5 weak_pulldown_highwakeup
-6 weak_pullup_check
-7 triangle_keyscan_matrix_check
 )
 
 
Index: format/bt.format
===================================================================
--- /1121s/branch/shutter/branch/shutter/jxy_project/yc1386s_jxy_114_new/format/bt.format	(revision 5827)
+++ /1121s/branch/shutter/branch/shutter/jxy_project/yc1386s_jxy_114_new/format/bt.format	(working copy)
@@ -159,7 +159,7 @@
 1 mem_lpm_overhead
 1 mem_lpm_hibernate_switch
 1 mem_sniff_unint_lost
-4 mem_sleep_counter   
+4 mem_sleep_counter
 4 mem_sleep_counter_all
 6 mem_sleep_clkn
 3 mem_sniff_rcv
@@ -180,7 +180,7 @@
 1 mem_lpm_sysctl
 1 mem_lpm_hv_sel
 
-24 mem_saved_gpio	 
+24 mem_saved_gpio
 3 mem_saved_gsel
 8 mem_saved_mark
 1 mem_saved_spidctrl
@@ -209,8 +209,18 @@
 1 mem_system_clk
 
 ifdef DEBUG_RF_INIT
-18 mem_rf_init_data
+5 mem_rf_init_data
 endif
+
+0 mem_adc_reference3v_ft_data
+2 mem_adc_reference3v_gpio1v_ft_data
+2 mem_adc_reference3v_gpio2v_ft_data
+2 mem_adc_reference3v_vdcdc3p6v_ft_data
+2 mem_adc_reference3v_vdcdc4p6v_ft_data
+2 mem_adc_reference3v_inter1v_ft_data
+2 mem_adc_reference3v_inter1v_now_data
+1 mem_adc_reference_mode
+
 1 mem_otp_charge_pump_x
 1 mem_otp_dpll_ibais_x
 
@@ -250,7 +260,7 @@
 0x16 coffset_conn_handle
 0x17 coffset_arq
 	/* 3.0 only */
-	
+
 	/* le only */
 0x18 coffset_le_ch
 0x19 coffset_le_hop
@@ -278,7 +288,7 @@
 0x40 coffset_le_sk
 0x50 coffset_le_peer_sca
 0x53 coffset_le_transmit_window
-	
+
 83 context_size
 1 context_num
 )
@@ -297,7 +307,7 @@
 ifdef CLK24M
 0x1c86 param_tx_setup
 0x0c00 param_rf_setup
-0x0c00 param_conn_access 
+0x0c00 param_conn_access
 0x1a00 param_rx_setup
 0x0776 param_clke_cal
 0x0a00 param_pll_setup
@@ -309,7 +319,7 @@
 /* 12Mhz clock setting */
 0x0e43 param_tx_setup
 0x0600 param_rf_setup
-0x0600 param_conn_access 
+0x0600 param_conn_access
 0x03bb param_clke_cal
 0x0500 param_pll_setup		// 120 is minimum
 0x0d00 param_rx_setup	// 114us before sync
@@ -443,7 +453,7 @@
 24       regd    /* 32 bit regext[1,0] */
 25       clkn              /* {clkn_bt, clkn_rt} */
 26       clke              /* {clke_bt, clke_rt} */
-27       stop_watch		
+27       stop_watch
 28       fhs_misc   /* SR, SP, pscan mode */
 29       fhs_class  /* class field in fhs */
 30       fhs0   /* read only, bit 0-71 of fhs word */
@@ -462,7 +472,7 @@
 43       rege         /* 64bit regext[3,2] */
 44       lap
 45       uap
-46       nap         
+46       nap
 47       regext		/* r/w extended 12x32bit registers,  indexed by regext_index */
 48       alarm             /* r/w, lpo wake up time, this is also how lpo and current clock keep sync */
 49       lpo_time          /* read only, this is the value to be copied back to clkn/clke after wakeup */
@@ -470,7 +480,7 @@
 51       kc_ms             /* secret key,               127:72 */
 52       g1l               /* encryption length                */
 53		mask3ff		/* for mask 0x3ff operation */
-54       aes_ctrl		
+54       aes_ctrl
 55       regf			/* 64bit regext[5,4] */
 56       regext_index   /* index of regext */
 57	     loopcnt
@@ -562,7 +572,7 @@
 2 le_scan_interval_timer
 9 key_scan_timer
 7 smp_pairing_timer
-11  ui_led_blink  
+11  ui_led_blink
 
 8 G24_TIMER_NODATA
 13 G24_TIMER_MS_BLANK
Index: format/utility.format
===================================================================
--- /1121s/branch/shutter/branch/shutter/jxy_project/yc1386s_jxy_114_new/format/utility.format	(revision 5827)
+++ /1121s/branch/shutter/branch/shutter/jxy_project/yc1386s_jxy_114_new/format/utility.format	(working copy)
@@ -61,21 +61,7 @@
 2 mem_scale_ratio_temp
 )
 
-amemalloc mem_temp_block2(
-	2 mem_inter1v_adc_now_data
-	2 mem_Vinter1v_adc_data
-	2 mem_inter1p2v_adc_now_data
-	2 mem_Vinter1p2v_adc_data
-	2 mem_gpio_gnd_adc_now_data
-	2 mem_channel2_gnd_adc_now_data
-	2 mem_difference_between_ext_gnd_and_in_gnd
-	2 mem_adc_gpio_k
-	2 mem_adc_gpio_b
-	
-	1 mem_adc_gpio_gnd_channel
-	2 mem_gpio_adc_value
-	2 mem_vdcdc_adc_value
-)
+
 //util fifo param
 (
 
Index: output/otp.dat
===================================================================
--- /1121s/branch/shutter/branch/shutter/jxy_project/yc1386s_jxy_114_new/output/otp.dat	(revision 5827)
+++ /1121s/branch/shutter/branch/shutter/jxy_project/yc1386s_jxy_114_new/output/otp.dat	(working copy)
@@ -11,64 +11,76 @@
 00
 aa
 55
-92
-0a
+6a
+0d
 c2
 84
 00
-0f
+12
 c0
 00
 00
-2f
+32
 c0
 01
 00
-4e
+51
 c0
 08
 80
-58
+6b
 c0
 0a
 02
-27
+3f
 c0
 0a
 80
-e5
+f7
 c0
 0c
-00
-f3
+01
+05
 c0
 0c
 80
-b2
+c4
 c0
 0d
 00
-6a
+7d
 c0
 12
 82
-49
+61
 c0
 13
 82
-99
+b3
 c0
 14
 01
-1c
+2e
 c0
 58
 81
-2f
+45
 c0
 62
-80
-fa
+81
+0c
+c0
+6d
+83
+01
+c0
+6e
+03
+3e
+c0
+6e
+83
+1f
 20
 20
 23
@@ -76,31 +88,31 @@
 c0
 12
 02
-72
+8c
 c0
 12
 80
-33
+36
 c0
 13
 00
-3c
+3f
 c0
 1c
 82
-43
+5b
 c0
 1f
 80
-18
+1b
 c0
 26
 00
-38
+3b
 c0
 26
 82
-47
+5f
 c1
 7f
 80
@@ -116,7 +128,7 @@
 20
 37
 00
-1b
+1e
 24
 36
 a9
@@ -136,11 +148,11 @@
 6f
 e0
 c8
-f1
+aa
 24
 3a
 00
-2c
+2f
 6f
 e0
 c3
@@ -327,8 +339,8 @@
 af
 20
 40
-00
-fd
+01
+0f
 20
 40
 75
@@ -339,8 +351,8 @@
 48
 20
 40
-2a
-45
+00
+5b
 20
 40
 20
@@ -351,8 +363,8 @@
 ad
 20
 40
-20
-18
+00
+63
 20
 40
 31
@@ -364,7 +376,71 @@
 20
 20
 00
-4e
+51
+6f
+f0
+89
+60
+79
+3f
+fe
+01
+67
+f0
+89
+60
+20
+40
+2a
+45
+6f
+f0
+89
+60
+79
+20
+7e
+01
+67
+f0
+89
+60
+20
+60
+00
+00
+6f
+f0
+89
+60
+79
+3f
+fe
+01
+67
+f0
+89
+60
+20
+40
+20
+18
+6f
+f0
+89
+60
+79
+20
+7e
+01
+67
+f0
+89
+60
+20
+60
+00
+00
 70
 8a
 0f
@@ -484,7 +560,7 @@
 20
 40
 00
-ba
+cc
 6f
 e0
 c4
@@ -496,7 +572,7 @@
 24
 55
 80
-66
+79
 37
 d9
 82
@@ -512,7 +588,7 @@
 c0
 08
 00
-a7
+b9
 6f
 e0
 c4
@@ -556,7 +632,7 @@
 20
 40
 00
-99
+ab
 70
 80
 43
@@ -579,16 +655,16 @@
 6e
 20
 40
-01
-f9
+02
+11
 20
 40
 02
-24
+3c
 20
 40
 00
-93
+a6
 70
 41
 48
@@ -600,11 +676,7 @@
 20
 20
 02
-26
-20
-75
-80
-00
+3e
 37
 d9
 82
@@ -632,7 +704,7 @@
 c0
 0c
 00
-9f
+b1
 6f
 e0
 c4
@@ -724,7 +796,7 @@
 20
 20
 00
-85
+98
 6f
 e0
 c1
@@ -732,7 +804,7 @@
 c0
 05
 00
-b5
+c7
 20
 20
 22
@@ -760,7 +832,7 @@
 20
 35
 80
-e1
+f3
 6f
 e2
 02
@@ -928,7 +1000,7 @@
 20
 20
 00
-cb
+dd
 20
 40
 68
@@ -1032,15 +1104,15 @@
 20
 40
 01
-00
+12
 20
 20
 01
-1e
+30
 68
 4a
 48
-b9
+d3
 1c
 42
 7e
@@ -1060,11 +1132,11 @@
 6f
 e2
 48
-b9
+d3
 68
 48
 c8
-bd
+d7
 98
 40
 84
@@ -1088,11 +1160,11 @@
 67
 e2
 48
-b9
+d3
 6f
 e1
 48
-be
+d8
 1f
 e0
 fe
@@ -1100,23 +1172,23 @@
 67
 e1
 48
-be
+d8
 6f
 e0
 c8
-c7
+db
 24
 3a
 01
-1a
+2c
 68
 49
 48
-b2
+ce
 6f
 e1
 48
-be
+d8
 98
 46
 7c
@@ -1124,7 +1196,7 @@
 20
 22
 81
-17
+29
 20
 60
 00
@@ -1144,11 +1216,11 @@
 68
 49
 48
-b4
+d0
 20
 20
 01
-13
+25
 c6
 1a
 00
@@ -1180,7 +1252,7 @@
 6f
 e4
 48
-aa
+c6
 20
 40
 7d
@@ -1204,7 +1276,7 @@
 20
 20
 01
-36
+4a
 6f
 f0
 81
@@ -1212,7 +1284,7 @@
 c3
 00
 81
-27
+39
 6f
 f0
 81
@@ -1220,7 +1292,23 @@
 c3
 03
 81
-27
+39
+20
+60
+00
+00
+6f
+e1
+44
+e9
+c3
+84
+80
+00
+c5
+1a
+01
+3c
 20
 60
 00
@@ -1237,18 +1325,10 @@
 40
 73
 96
-6f
-e1
-44
-e9
-c3
-84
-80
-00
-c5
-1a
+20
+40
 01
-2a
+41
 20
 75
 80
@@ -1263,8 +1343,8 @@
 0a
 20
 40
-63
-d9
+42
+a3
 58
 00
 19
@@ -1304,7 +1384,7 @@
 58
 00
 01
-6e
+85
 67
 e1
 43
@@ -1312,7 +1392,7 @@
 58
 00
 01
-71
+88
 67
 e1
 43
@@ -1328,7 +1408,7 @@
 58
 00
 01
-a4
+bb
 67
 e1
 43
@@ -1336,7 +1416,7 @@
 58
 00
 01
-e4
+fc
 67
 e1
 45
@@ -1344,7 +1424,7 @@
 58
 00
 01
-6b
+80
 67
 e1
 43
@@ -1368,15 +1448,19 @@
 58
 00
 01
-69
+7e
 67
 e1
 45
 21
 20
 40
-62
-ca
+01
+83
+20
+40
+62
+ca
 20
 40
 63
@@ -1392,11 +1476,11 @@
 6f
 e0
 c8
-b6
+d2
 c0
 00
 81
-93
+aa
 6f
 e0
 c5
@@ -1408,7 +1492,7 @@
 20
 20
 01
-5d
+72
 58
 00
 00
@@ -1432,7 +1516,7 @@
 20
 3a
 01
-65
+7a
 6f
 f0
 81
@@ -1440,7 +1524,7 @@
 c2
 82
 01
-93
+aa
 6f
 e1
 44
@@ -1459,7 +1543,7 @@
 27
 70
 48
-c5
+da
 01
 20
 20
@@ -1477,6 +1561,14 @@
 20
 73
 9a
+70
+48
+b3
+01
+20
+60
+00
+00
 df
 e0
 00
@@ -1496,34 +1588,34 @@
 c0
 0a
 01
-87
+9e
 c0
 18
 81
-79
+90
 c0
 0a
 81
-7b
+92
 c0
 1f
 81
-7f
+96
 c0
 08
 01
-90
+a7
 c0
 16
 01
-86
+9d
 20
 20
 62
 db
 70
 48
-f1
+aa
 01
 20
 60
@@ -1531,7 +1623,7 @@
 00
 70
 48
-f1
+aa
 00
 20
 40
@@ -1547,7 +1639,7 @@
 40
 70
 48
-f1
+aa
 01
 20
 40
@@ -1579,7 +1671,7 @@
 00
 70
 48
-c7
+db
 01
 20
 40
@@ -1599,16 +1691,16 @@
 25
 70
 48
-ea
+dd
 01
 6f
 e0
 c8
-eb
+de
 67
 e0
 c8
-ec
+df
 20
 60
 00
@@ -1624,10 +1716,10 @@
 c0
 00
 81
-9a
+b1
 70
 48
-c8
+dc
 00
 6f
 e0
@@ -1647,7 +1739,7 @@
 34
 70
 48
-b6
+d2
 01
 20
 20
@@ -1655,11 +1747,11 @@
 b9
 70
 48
-c7
+db
 00
 70
 48
-c8
+dc
 00
 70
 43
@@ -1667,7 +1759,7 @@
 00
 70
 48
-b6
+d2
 00
 58
 00
@@ -1688,23 +1780,27 @@
 20
 3a
 01
-d3
+eb
 20
 20
 7d
 79
 20
 40
+02
+c4
+20
+40
 01
-a8
+c0
 20
 40
 01
-c1
+d9
 20
 40
 01
-ca
+e2
 20
 20
 63
@@ -1712,7 +1808,7 @@
 6f
 e0
 c8
-ea
+dd
 20
 7a
 00
@@ -1720,11 +1816,11 @@
 6f
 e0
 c8
-ee
+e1
 68
 48
 c8
-ef
+e2
 98
 46
 7c
@@ -1732,19 +1828,19 @@
 20
 22
 81
-be
+d6
 20
 20
 01
-af
+c7
 da
 60
 48
-ec
+df
 da
 40
 01
-b2
+ca
 20
 20
 42
@@ -1752,7 +1848,7 @@
 6f
 e0
 c8
-ee
+e1
 1f
 e0
 fe
@@ -1760,11 +1856,11 @@
 67
 e0
 c8
-ee
+e1
 6f
 e0
 c8
-ed
+e0
 79
 40
 7e
@@ -1772,19 +1868,19 @@
 67
 e0
 c8
-ed
+e0
 c2
 80
 01
-ba
+d2
 c3
 00
 01
-bc
+d4
 20
 40
 01
-8d
+a4
 20
 20
 43
@@ -1792,18 +1888,18 @@
 20
 40
 01
-8d
+a4
 20
 20
 43
 25
 70
 48
-ee
+e1
 00
 70
 48
-ea
+dd
 00
 20
 60
@@ -1816,14 +1912,14 @@
 da
 40
 01
-c4
+dc
 20
 20
 42
 e7
 70
 48
-c8
+dc
 01
 70
 45
@@ -1852,7 +1948,7 @@
 da
 40
 01
-cd
+e5
 20
 20
 42
@@ -1884,7 +1980,7 @@
 6f
 e0
 c8
-c5
+da
 24
 3a
 43
@@ -1896,7 +1992,7 @@
 6f
 e0
 c8
-c8
+dc
 24
 7a
 00
@@ -1916,11 +2012,11 @@
 6f
 e0
 c8
-c7
+db
 24
 5a
 01
-e1
+f9
 20
 40
 63
@@ -1952,7 +2048,7 @@
 20
 40
 01
-da
+f2
 24
 76
 00
@@ -1963,11 +2059,11 @@
 00
 20
 3a
-01
-ec
+02
+04
 70
 48
-b8
+be
 00
 20
 40
@@ -1979,15 +2075,15 @@
 2e
 20
 20
-01
-f0
+02
+08
 70
 48
-b8
+be
 01
 70
 48
-b7
+bd
 00
 20
 40
@@ -2012,7 +2108,7 @@
 6f
 e0
 c8
-b7
+bd
 24
 7a
 00
@@ -2020,14 +2116,14 @@
 6f
 e0
 c8
-b8
+be
 24
 3a
-01
-f8
+02
+10
 70
 48
-b7
+bd
 01
 20
 20
@@ -2084,7 +2180,7 @@
 20
 40
 02
-16
+2e
 2a
 2f
 fe
@@ -2116,7 +2212,7 @@
 20
 40
 02
-16
+2e
 d8
 a0
 8a
@@ -2144,7 +2240,7 @@
 20
 21
 02
-0b
+23
 20
 20
 21
@@ -2236,7 +2332,7 @@
 c0
 08
 02
-40
+58
 58
 00
 57
@@ -2280,7 +2376,7 @@
 c0
 08
 02
-3d
+55
 58
 00
 2b
@@ -2316,7 +2412,7 @@
 20
 20
 02
-39
+51
 58
 00
 83
@@ -2328,7 +2424,7 @@
 20
 20
 02
-2e
+46
 6f
 e0
 c3
@@ -2361,6 +2457,14 @@
 40
 7d
 79
+58
+00
+00
+12
+20
+40
+00
+a8
 6f
 e2
 40
@@ -2376,7 +2480,7 @@
 20
 40
 02
-5a
+74
 6f
 e0
 c0
@@ -2488,7 +2592,7 @@
 20
 22
 82
-6d
+87
 e7
 e0
 80
@@ -2508,7 +2612,7 @@
 c2
 00
 02
-67
+81
 1a
 42
 04
@@ -2524,7 +2628,7 @@
 c5
 97
 82
-78
+92
 78
 3c
 fc
@@ -2568,7 +2672,7 @@
 20
 37
 02
-81
+9b
 1b
 42
 04
@@ -2616,7 +2720,7 @@
 20
 40
 02
-8f
+a9
 6f
 e0
 81
@@ -2717,74 +2821,698 @@
 20
 24
 7d
-0f
-50
-aa
-55
-40
-00
-00
-40
-05
-00
-32
-07
-a0
+6f
+e0
+c8
+b5
+1f
+e0
+fe
 01
-00
-00
-00
-00
-00
-00
-00
-00
-00
-00
-00
-00
-00
-00
-00
-00
-02
+67
+e0
+c8
+b5
+68
+48
+c8
+bf
+98
+46
+7c
 00
 20
+60
 00
 00
+6f
+e0
+c8
+b3
+20
+7a
 00
 00
-00
-00
-00
-00
-00
+20
+40
+02
+be
+24
+61
 00
 00
 70
+48
+b5
+00
+70
+44
+07
+01
+20
+40
+6f
+f3
+20
+40
+6f
+eb
+20
+40
+03
+3e
+20
+40
+03
+1f
+67
+e1
+48
+b1
+da
+20
+48
+ab
+20
+40
+02
+d6
+6f
+e0
+c4
+0c
+c2
+80
+82
+f6
+c3
+00
+02
+fc
+70
+48
+b7
+01
+20
+20
+02
+fa
+ef
+e4
+00
+11
+67
+e4
+06
+70
+20
+40
+6f
+f3
+20
+40
+6f
+eb
+6f
+e1
+06
+76
+68
+49
+06
+72
+98
+46
+7c
+00
+24
+41
+6f
+ef
+68
+49
+06
+74
+98
+46
+7c
+00
+24
+41
+6f
+e7
+6f
+e1
+06
+76
+68
+49
+06
+70
+98
+46
+7c
+00
+20
+21
+02
+f2
+68
+49
+06
+72
+98
+46
+7e
+00
+24
+21
+02
+f4
+20
+3a
+02
+f4
+1f
+ef
+a2
+64
+6f
+e1
+06
+70
+68
+49
+06
+72
+98
+46
+04
+00
+1a
+22
+7e
+00
+98
+46
+fc
+00
+20
+40
+7d
+5f
+67
+e0
+c8
+bc
+20
+60
+00
+00
+70
+48
+bc
+64
+20
+60
+00
+00
+70
+48
+bc
+00
+20
+60
+00
+00
+70
+48
+b8
+01
+70
+48
+b9
+01
+20
+40
+43
+25
+20
+20
+43
+27
+70
+48
+b6
+01
+20
+60
+00
+00
+70
+48
+b6
+00
+6f
+e0
+c8
+b7
+20
+7a
+00
+00
+70
+48
+b7
+00
+20
+60
+00
+00
+6f
+e4
+01
+fd
+20
+3a
+6f
+79
+67
+e4
+43
+fd
+20
+40
+6b
+3a
+20
+40
+6a
+ad
+df
+e0
+0f
+c0
+9a
+40
+a4
+00
+df
+20
+00
+0a
+da
+20
+01
+fd
+20
+40
+6b
+74
+20
+40
+6b
+37
+6f
+e4
+01
+fd
+20
+7a
+00
+00
+67
+e4
+41
+4e
+ef
+e1
+00
+06
+e7
+e1
+00
+05
+20
+60
+00
+00
+6f
+f0
+80
+cc
+79
+20
+7e
+01
+67
+f0
+80
+cc
+6a
+40
+c4
+19
+6f
+e0
+c4
+33
+67
+e0
+c4
+19
+df
+20
+00
+08
+20
+40
+6f
+67
+62
+40
+c4
+19
+6f
+f0
+8a
+0a
+79
+3f
+fe
+04
+67
+f0
+8a
+0a
+20
+60
+00
+00
+6f
+e0
+c4
+07
+c0
+00
+83
+23
+c0
+01
+03
+2a
+20
+60
+00
+00
+58
+00
+03
+e8
+67
+e1
+44
+05
+68
+49
+41
+52
+6f
+e1
+41
+54
+da
+60
+0e
+10
+20
+40
+6f
+c0
+20
+20
+03
+30
+58
+00
+03
+e8
+67
+e1
+44
+05
+68
+49
+41
+4e
+6f
+e1
+41
+50
+da
+60
+03
+e8
+20
+40
+6f
+c0
+68
+49
+41
+56
+98
+4f
+fe
+00
+68
+49
+41
+58
+98
+46
+fc
+00
+20
+20
+7d
+5f
+20
+40
+03
+12
+6f
+f0
+8a
+09
+79
+3f
+fe
+07
+67
+f0
+8a
+09
+70
+8a
+07
+77
+70
+8a
+08
+c1
+70
+8a
+0d
+61
+70
+8a
+0b
+00
+20
+60
+00
+00
+20
+40
+03
+35
+20
+40
+6f
+90
+6f
+e0
+c4
+09
+67
+f0
+80
+cd
+20
+40
+6f
+97
+70
+8a
+0d
+60
+70
+80
+cd
+00
+20
+40
+03
+35
+6f
+e0
+c4
+09
+67
+f0
+80
+cd
+70
+8a
+0b
+50
+70
+8a
+0e
+c0
+df
+00
+00
+0b
+6d
+e1
+44
+0a
+70
+80
+cc
+03
+20
+40
+03
+57
+68
+59
+01
+64
+60
+49
+41
+58
+20
+40
+6f
+9c
+df
+00
+00
+0b
+65
+e1
+44
+0a
+70
+8a
+0d
+60
+70
+80
+cd
+00
+70
+80
+cc
+00
+20
+60
+00
+00
+6f
+f0
+81
+29
+c3
+02
+83
+57
+20
+60
+00
+00
+59
+2c
+aa
+55
+40
+00
+00
+40
+05
+00
+32
+07
+a0
+01
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+02
+00
+20
+00
+00
+38
+00
+00
+00
+00
+00
+00
+00
+00
+70
+00
+00
+82
+00
+30
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
+00
 00
-00
-82
-00
-30
-00
-00
-00
-00
-00
-00
-00
-00
-00
-00
-00
-00
-00
-00
-00
-00
-00
-00
 00
 00
 00
@@ -2866,6 +3594,25 @@
 00
 aa
 55
+01
+00
+bf
+48
+05
+aa
+55
+06
+00
+ab
+48
+68
+10
+b8
+0b
+e4
+0c
+aa
+55
 04
 00
 9e
@@ -2878,7 +3625,7 @@
 55
 08
 00
-aa
+c6
 48
 00
 1b
@@ -2892,14 +3639,14 @@
 55
 01
 00
-bd
+d7
 48
 64
 aa
 55
 04
 00
-b2
+ce
 48
 08
 07
@@ -2923,14 +3670,14 @@
 55
 01
 00
-eb
+de
 48
 06
 aa
 55
 01
 00
-ef
+e2
 48
 02
 aa
@@ -3125,7 +3872,7 @@
 aa
 aa
 55
-94
-57
-34
-73
+33
+5e
+04
+3d
Index: output/ramcode.rom
===================================================================
--- /1121s/branch/shutter/branch/shutter/jxy_project/yc1386s_jxy_114_new/output/ramcode.rom	(revision 5827)
+++ /1121s/branch/shutter/branch/shutter/jxy_project/yc1386s_jxy_114_new/output/ramcode.rom	(working copy)
@@ -1,35 +1,38 @@
-c284000f
-c000002f
-c001004e
-c0088058
-c00a0227
-c00a80e5
-c00c00f3
-c00c80b2
-c00d006a
-c0128249
-c0138299
-c014011c
-c058812f
-c06280fa
+c2840012
+c0000032
+c0010051
+c008806b
+c00a023f
+c00a80f7
+c00c0105
+c00c80c4
+c00d007d
+c0128261
+c01382b3
+c014012e
+c0588145
+c062810c
+c06d8301
+c06e033e
+c06e831f
 2020235a
-c0120272
-c0128033
-c013003c
-c01c8243
-c01f8018
-c0260038
-c0268247
+c012028c
+c0128036
+c013003f
+c01c825b
+c01f801b
+c026003b
+c026825f
 c17f8000
 2020235a
 7855fc00
-2037001b
+2037001e
 2436a9b8
 204024d2
 6fe1409a
 67e10176
-6fe0c8f1
-243a002c
+6fe0c8aa
+243a002f
 6fe0c321
 c282a4e0
 c507a4e0
@@ -76,16 +79,32 @@
 1800700c
 65e20154
 202026af
-204000fd
+2040010f
 20407552
 20407448
-20402a45
+2040005b
 2040202a
 204042ad
-20402018
+20400063
 2040310f
 2040248c
-2020004e
+20200051
+6ff08960
+793ffe01
+67f08960
+20402a45
+6ff08960
+79207e01
+67f08960
+20600000
+6ff08960
+793ffe01
+67f08960
+20402018
+6ff08960
+79207e01
+67f08960
+20600000
 708a0f60
 708a10aa
 708a127a
@@ -115,14 +134,14 @@
 708a844a
 708a8540
 708a16fe
-204000ba
+204000cc
 6fe0c436
 205a70d7
-24558066
+24558079
 37d98200
 70813b5f
 6fe0c099
-c00800a7
+c00800b9
 6fe0c438
 1fe1fe04
 67f08a02
@@ -133,26 +152,25 @@
 67f18a73
 708a8660
 708a8b3b
-20400099
+204000ab
 70804300
 70804205
 58557474
 67f18968
 7089606e
-204001f9
-20400224
-20400093
+20400211
+2040023c
+204000a6
 7041480c
 20406f4e
-20200226
-20758000
+2020023e
 37d98200
 6fe0c11c
 67f0813a
 37d98200
 20600000
 6fe0c099
-c00c009f
+c00c00b1
 6fe0c438
 1fe1fe06
 67f08a02
@@ -175,16 +193,16 @@
 67f18a73
 708a762a
 70890204
-20200085
+20200098
 6fe0c141
-c00500b5
+c00500c7
 2020220e
 708a1425
 58a93f3f
 67f18a60
 708a631f
 20600000
-203580e1
+203580f3
 6fe2020d
 207a0000
 37d98200
@@ -226,7 +244,7 @@
 6fe1415b
 207a0000
 67e1020f
-202000cb
+202000dd
 2040686f
 204021ba
 18002a08
@@ -252,36 +270,36 @@
 20406b75
 20206b38
 c69a0000
-20400100
-2020011e
-684a48b9
+20400112
+20200130
+684a48d3
 1c427e00
 98467c00
 24413255
 1fe22400
-6fe248b9
-6848c8bd
+6fe248d3
+6848c8d7
 98408400
 1a427e00
 98467c00
 24610000
 793ffe1c
-67e248b9
-6fe148be
+67e248d3
+6fe148d8
 1fe0fe01
-67e148be
-6fe0c8c7
-243a011a
-684948b2
-6fe148be
+67e148d8
+6fe0c8db
+243a012c
+684948ce
+6fe148d8
 98467c00
-20228117
+20228129
 20600000
 793f8034
 20404325
 20204327
-684948b4
-20200113
+684948d0
+20200125
 c61a0000
 2020248d
 20402408
@@ -289,28 +307,30 @@
 207a0000
 204077ac
 20406329
-6fe448aa
+6fe448c6
 20407d25
 604a40a9
 2020241e
 793f8034
 7044ee01
-20200136
+2020014a
 6ff0811e
-c3008127
+c3008139
 6ff0811d
-c3038127
+c3038139
+20600000
+6fe144e9
+c3848000
+c51a013c
 20600000
 70807dc0
 7080d6c0
 20407396
-6fe144e9
-c3848000
-c51a012a
+20400141
 20758000
 204070d7
 7040a60a
-204063d9
+204042a3
 58001919
 67e1451d
 580000a0
@@ -320,68 +340,71 @@
 67e24512
 6fe448a2
 67e444fa
-5800016e
+58000185
 67e143db
-58000171
+58000188
 67e143dd
 5800638a
 67e143df
-580001a4
+580001bb
 67e143e3
-580001e4
+580001fc
 67e14524
-5800016b
+58000180
 67e143d5
 58006329
 67e143d7
 58006340
 67e1451f
-58000169
+5800017e
 67e14521
+20400183
 204062ca
 20406396
 6fe144e9
 c3860000
-6fe0c8b6
-c0008193
+6fe0c8d2
+c00081aa
 6fe0c51b
 67e0c4ec
-2020015d
+20200172
 58000000
 204063ad
 7044e401
 20407776
 6fe0c6d0
-203a0165
+203a017a
 6ff08132
-c2820193
+c28201aa
 6fe144e9
 c3860000
 20404325
 20204327
-7048c501
+7048da01
 2020639a
 7044ecff
 20406329
 2020739a
+7048b301
+20600000
 dfe0000a
 204070c8
 20206327
 1a627e00
-c00a0187
-c0188179
-c00a817b
-c01f817f
-c0080190
-c0160186
+c00a019e
+c0188190
+c00a8192
+c01f8196
+c00801a7
+c016019d
 202062db
-7048f101
+7048aa01
 20600000
-7048f100
+7048aa00
 204078ad
 7044f100
 20206340
-7048f101
+7048aa01
 204078ad
 7044f101
 6fe44502
@@ -389,75 +412,76 @@
 2040432b
 20202e93
 20600000
-7048c701
+7048db01
 2040632d
 58000000
 67e144f8
 20404325
-7048ea01
-6fe0c8eb
-67e0c8ec
+7048dd01
+6fe0c8de
+67e0c8df
 20600000
 68494430
 efe08002
-c000819a
-7048c800
+c00081b1
+7048dc00
 6fe0c51c
 c000e305
 70438801
 793f8034
-7048b601
+7048d201
 202063b9
-7048c700
-7048c800
+7048db00
+7048dc00
 70438800
-7048b600
+7048d200
 58000002
 204063ad
 18408c05
 efe10006
-203a01d3
+203a01eb
 20207d79
-204001a8
-204001c1
-204001ca
+204002c4
+204001c0
+204001d9
+204001e2
 20206322
-6fe0c8ea
+6fe0c8dd
 207a0000
-6fe0c8ee
-6848c8ef
+6fe0c8e1
+6848c8e2
 98467c00
-202281be
-202001af
-da6048ec
-da4001b2
+202281d6
+202001c7
+da6048df
+da4001ca
 202042e0
-6fe0c8ee
+6fe0c8e1
 1fe0fe01
-67e0c8ee
-6fe0c8ed
+67e0c8e1
+6fe0c8e0
 79407e00
-67e0c8ed
-c28001ba
-c30001bc
-2040018d
+67e0c8e0
+c28001d2
+c30001d4
+204001a4
 20204323
-2040018d
+204001a4
 20204325
-7048ee00
-7048ea00
+7048e100
+7048dd00
 20600000
 da604518
-da4001c4
+da4001dc
 202042e7
-7048c801
+7048dc01
 70451c02
 20404325
 7044ee00
 2040634e
 2020639e
 da6046ca
-da4001cd
+da4001e5
 202042e0
 6fe144e9
 c284e39e
@@ -465,16 +489,16 @@
 c000e39e
 c002639e
 c002e39e
-6fe0c8c5
+6fe0c8da
 243a4327
 79200034
-6fe0c8c8
+6fe0c8dc
 247a0000
 793f8034
 20204327
 78567c00
-6fe0c8c7
-245a01e1
+6fe0c8db
+245a01f9
 20406351
 24740000
 78367c00
@@ -482,26 +506,26 @@
 6fe14516
 67e14518
 20600000
-204001da
+204001f2
 24760000
 1a227e00
-203a01ec
-7048b800
+203a0204
+7048be00
 20404323
 da60452e
-202001f0
-7048b801
-7048b700
+20200208
+7048be01
+7048bd00
 20404325
 da604556
 dfe00005
 98effe00
 9a60a600
-6fe0c8b7
+6fe0c8bd
 247a0000
-6fe0c8b8
-243a01f8
-7048b701
+6fe0c8be
+243a0210
+7048bd01
 20206371
 20758000
 20402160
@@ -515,7 +539,7 @@
 708ac200
 708ac300
 d8e00006
-20400216
+2040022e
 2a2ffe0d
 2040211d
 2a4ffe0d
@@ -523,14 +547,14 @@
 d8e00005
 2040211c
 2040211e
-20400216
+2040022e
 d8a08ac2
 1a31fe00
 20402117
 1a51fe00
 20402117
 18e08fff
-2021020b
+20210223
 2020214f
 2000003c
 58000f00
@@ -553,7 +577,7 @@
 708a8d12
 708a8e0a
 6fe0c099
-c0080240
+c0080258
 58005762
 67f10907
 70890103
@@ -564,7 +588,7 @@
 708a8d44
 708a8e0a
 6fe0c099
-c008023d
+c0080255
 58002bb1
 67f10907
 c6978000
@@ -573,10 +597,10 @@
 20600000
 58004189
 67f10907
-20200239
+20200251
 58008312
 67f10907
-2020022e
+20200246
 6fe0c334
 c1000000
 c001b04a
@@ -585,10 +609,12 @@
 20202af6
 6fe143e9
 20407d79
+58000012
+204000a8
 6fe240ad
 9840fe00
 67e240ad
-2040025a
+20400274
 6fe0c0cb
 79207e04
 204023e1
@@ -616,16 +642,16 @@
 efe08011
 e8408013
 98467c00
-2022826d
+20228287
 e7e08013
 37d98200
 1a20a201
 1a60a601
-c2000267
+c2000281
 1a420400
 20600000
 204025c2
-c5978278
+c5978292
 783cfc00
 2000001e
 204025c2
@@ -636,7 +662,7 @@
 78507c00
 19623600
 37c18400
-20370281
+2037029b
 1b420400
 604b000f
 242c26fa
@@ -648,7 +674,7 @@
 984fb600
 20406877
 20372677
-2040028f
+204002a9
 6fe08168
 c301a677
 2055a477
@@ -674,3 +700,159 @@
 20407d10
 1a220400
 2020247d
+6fe0c8b5
+1fe0fe01
+67e0c8b5
+6848c8bf
+98467c00
+20600000
+6fe0c8b3
+207a0000
+204002be
+24610000
+7048b500
+70440701
+20406ff3
+20406feb
+2040033e
+2040031f
+67e148b1
+da2048ab
+204002d6
+6fe0c40c
+c28082f6
+c30002fc
+7048b701
+202002fa
+efe40011
+67e40670
+20406ff3
+20406feb
+6fe10676
+68490672
+98467c00
+24416fef
+68490674
+98467c00
+24416fe7
+6fe10676
+68490670
+98467c00
+202102f2
+68490672
+98467e00
+242102f4
+203a02f4
+1fefa264
+6fe10670
+68490672
+98460400
+1a227e00
+9846fc00
+20407d5f
+67e0c8bc
+20600000
+7048bc64
+20600000
+7048bc00
+20600000
+7048b801
+7048b901
+20404325
+20204327
+7048b601
+20600000
+7048b600
+6fe0c8b7
+207a0000
+7048b700
+20600000
+6fe401fd
+203a6f79
+67e443fd
+20406b3a
+20406aad
+dfe00fc0
+9a40a400
+df20000a
+da2001fd
+20406b74
+20406b37
+6fe401fd
+207a0000
+67e4414e
+efe10006
+e7e10005
+20600000
+6ff080cc
+79207e01
+67f080cc
+6a40c419
+6fe0c433
+67e0c419
+df200008
+20406f67
+6240c419
+6ff08a0a
+793ffe04
+67f08a0a
+20600000
+6fe0c407
+c0008323
+c001032a
+20600000
+580003e8
+67e14405
+68494152
+6fe14154
+da600e10
+20406fc0
+20200330
+580003e8
+67e14405
+6849414e
+6fe14150
+da6003e8
+20406fc0
+68494156
+984ffe00
+68494158
+9846fc00
+20207d5f
+20400312
+6ff08a09
+793ffe07
+67f08a09
+708a0777
+708a08c1
+708a0d61
+708a0b00
+20600000
+20400335
+20406f90
+6fe0c409
+67f080cd
+20406f97
+708a0d60
+7080cd00
+20400335
+6fe0c409
+67f080cd
+708a0b50
+708a0ec0
+df00000b
+6de1440a
+7080cc03
+20400357
+68590164
+60494158
+20406f9c
+df00000b
+65e1440a
+708a0d60
+7080cd00
+7080cc00
+20600000
+6ff08129
+c3028357
+20600000
Index: output/romcode.rom
===================================================================
--- /1121s/branch/shutter/branch/shutter/jxy_project/yc1386s_jxy_114_new/output/romcode.rom	(revision 5827)
+++ /1121s/branch/shutter/branch/shutter/jxy_project/yc1386s_jxy_114_new/output/romcode.rom	(working copy)
@@ -17472,48 +17472,48 @@
 c00063d3
 c000e3d6
 20600000
-6fe34f38
+6fe34f29
 67e34526
 70452306
 58004523
 67e1442c
 20600000
-6fe3cf38
+6fe3cf29
 67e3c526
 70452307
 58004523
 67e1442c
 20600000
-6fe44f38
+6fe44f29
 67e44526
 70452308
 58004523
 67e1442c
 20600000
-6fe0cf37
+6fe0cf28
 c0036442
 c003e448
 c004644e
 20600000
 44d0c014
-6fe44f5e
+6fe44f4f
 67e44512
 58000096
 67e144f6
-6fe3cfae
+6fe3cf9f
 67e3c6a7
-6fe3cfb5
+6fe3cfa6
 67e3c6b2
-6fe24fbc
+6fe24fad
 67e244fa
-6fe24fc0
+6fe24fb1
 67e244fe
 5800000e
 67e144f2
 58000140
 67e144f4
 67e14389
-6fe44f56
+6fe44f47
 67e4450a
 20600000
 20407396
@@ -17531,7 +17531,7 @@
 58006505
 67e14524
 204062c2
-6fe14fdb
+6fe14fcc
 67e14332
 6fe4450a
 67e44502
@@ -17550,7 +17550,7 @@
 2020656e
 5800001f
 1feffe0a
-d8404c56
+d8404c47
 9840a200
 1a20a203
 d8400062
@@ -17570,21 +17570,21 @@
 247a0000
 204078fa
 207a0000
-684a4a3a
+684a4a2b
 1c427e00
 98460400
 20628000
 242164ac
-6fe0ca39
+6fe0ca2a
 98467c00
 20610000
 1c427e00
-67e24a3a
+67e24a2b
 20406385
 24740000
 1fe0ffff
 1feffe0a
-d8404c56
+d8404c47
 98408c00
 202063cb
 20406858
@@ -17594,12 +17594,12 @@
 204064d3
 20406311
 202064d9
-da604f15
+da604f06
 da4064bf
 202042e0
 204078fa
 247a0000
-6fe14900
+6fe148f1
 247a0000
 20406730
 203a64cd
@@ -17609,19 +17609,19 @@
 18e27e00
 2fe00e01
 2020e4d1
-da604f0a
+da604efb
 20206371
-da604f1e
+da604f0f
 20206371
-da604f23
+da604f14
 20206371
-da604f2d
+da604f1e
 20206371
-da604c53
+da604c44
 da4064d6
 202042e0
 df20000a
-d8a04a48
+d8a04a39
 20207ca1
 da6046ca
 da4064dc
@@ -17636,22 +17636,22 @@
 c1200000
 c01966c8
 202062d9
-704f1601
+704f0701
 20406783
-6fe14fc8
-67e14f02
-68494fca
+6fe14fb9
+67e14ef3
+68494fbb
 58000fff
 98467e00
-67e14f04
+67e14ef5
 20600000
-704eff00
-704f1600
+704ef000
+704f0700
 204065ad
 20406500
 202062e6
 1c427e00
-67e24a3a
+67e24a2b
 20406729
 202062e2
 78567c00
@@ -17662,7 +17662,7 @@
 20406351
 24740000
 20207dbe
-704f1900
+704f0a00
 20600000
 18e27e00
 c1808000
@@ -17672,23 +17672,23 @@
 1a227e00
 203a6537
 44d1c014
-6fe0cff3
+6fe0cfe4
 243a6502
-704c5401
+704c4501
 20404323
 2040652c
 20406561
 20216500
 18e27e00
-6848cf19
+6848cf0a
 98467c00
 2442e526
 18e27e00
-67e0cf19
-6848cf1c
+67e0cf0a
+6848cf0d
 98467c00
 2022e524
-6fe0cf1d
+6fe0cf0e
 243a651f
 20406732
 dfe0000a
@@ -17698,17 +17698,17 @@
 c000e51c
 20406642
 202065f4
-704f1a01
+704f0b01
 202065f4
 44d24014
-6fe0cf1d
+6fe0cf0e
 203a64c3
 18e27e00
 c000e4c3
 20600000
 dfe0000a
 98effe00
-da604a3e
+da604a2f
 9a60a600
 1c427e00
 e7e20013
@@ -17718,11 +17718,11 @@
 e7e08013
 20600000
 44d2c014
-6fe0cf1d
+6fe0cf0e
 205a654b
 dfe0000a
 98effe00
-da604a3e
+da604a2f
 9a60a600
 e8420013
 18467c00
@@ -17737,14 +17737,14 @@
 1c427e00
 e7e20013
 20600000
-6fe0cff3
+6fe0cfe4
 243a4323
 20204325
 1a608c04
 efe08006
 20206551
 2040656b
-6fe0cf1d
+6fe0cf0e
 243a655d
 20406561
 20216500
@@ -17764,23 +17764,23 @@
 98467e00
 1fe67c0a
 20600000
-704f1401
+704f0501
 2040656b
-da604b02
+da604af3
 dfe00003
 2020655a
 df20000a
 1a620a00
 20207ca1
-6fe14900
+6fe148f1
 67e1442e
 204065be
 6fe1442e
-67e14900
+67e148f1
 d8e00000
 6fe0c523
 1fe27200
-da604a3e
+da604a2f
 1f227e00
 67e10678
 1a627e00
@@ -17815,12 +17815,12 @@
 1a60a609
 58000001
 e7e08013
-6fe0cf14
+6fe0cf05
 207a0000
-704f1400
+704f0500
 44d34014
 20406755
-6fe0cf1b
+6fe0cf0c
 c00065a2
 c000e5a5
 20600000
@@ -17828,19 +17828,19 @@
 dfe00003
 2020655a
 18e27e00
-6848cf1c
+6848cf0d
 98467c00
 2422e5a2
-6fe0cf1d
+6fe0cf0e
 79407e00
-67e0cf1d
+67e0cf0e
 247a0000
-704f1d00
+704f0e00
 20204325
-da604aed
+da604ade
 20406730
 207a0000
-da604c14
+da604c05
 20600000
 1a60a405
 efe20012
@@ -17864,7 +17864,7 @@
 6fe0c388
 247a0000
 44d3c014
-6fe0cf1b
+6fe0cf0c
 c000e5cf
 20406628
 204065dc
@@ -17875,15 +17875,15 @@
 7006fa00
 18000e00
 2020703b
-6fe0cf19
-6848cf1c
+6fe0cf0a
+6848cf0d
 98467c00
 2022c323
-6fe0cf1d
+6fe0cf0e
 243a4325
 20600000
 d8e00000
-da404b17
+da404b08
 dfe00002
 98effe00
 9a40a400
@@ -17894,9 +17894,9 @@
 2022e5e8
 18e08e01
 202065dd
-67e14b23
+67e14b14
 20404323
-da604b25
+da604b16
 dfe0000a
 98effe00
 9a60a600
@@ -17914,78 +17914,78 @@
 20406382
 20406730
 207a0000
-704a3978
+704a2a78
 dfe00006
 20206382
-6848cefe
+6848ceef
 20406730
 207a0000
-6848cf01
+6848cef2
 18408401
-6fe0cf1a
+6fe0cf0b
 207a0000
-6848cefe
-704f1a00
+6848ceef
+704f0b00
 20600000
 204065ff
 18427e00
 207a0000
-67e0cf07
+67e0cef8
 dfe00013
 20406382
-6fe0cf07
+6fe0cef8
 1fe0ffff
-67e0cf07
+67e0cef8
 207a0000
 2020660d
-6fe0cf00
+6fe0cef1
 207a0000
-67e0cf08
+67e0cef9
 dfe00020
 20406382
-6fe0cf08
+6fe0cef9
 1fe0ffff
-67e0cf08
+67e0cef9
 207a0000
 20206617
-6fe0cf01
+6fe0cef2
 207a0000
-67e0cf09
+67e0cefa
 dfe00021
 20406382
-6fe0cf09
+6fe0cefa
 1fe0ffff
-67e0cf09
+67e0cefa
 207a0000
 20206621
-6fe14b23
+6fe14b14
 207a0000
 684906f1
 18467c00
 2022e636
 98467c00
 20628000
-60494b23
-6fe14f17
+60494b14
+6fe14f08
 98467c00
 2042c325
 6fe106f1
 67e1442e
 20207dba
-704f1401
+704f0501
 20404325
-da604b61
+da604b52
 204065f0
 58000000
-67e14b23
-7048f232
+67e14b14
+7048e332
 20406633
 6fe0c523
 1feff20a
-d8a04a3e
+d8a04a2f
 20207ca1
 44d44015
-6fe0cf1b
+6fe0cf0c
 c000e647
 c000664d
 20600000
@@ -18006,29 +18006,29 @@
 243a665e
 58000004
 1feffe0a
-d8404c56
+d8404c47
 98408a00
 18a08a03
-6fe1cb6b
+6fe1cb5c
 e7e18005
 20600000
 58000004
 1feffe0a
-d8404c56
+d8404c47
 98408a00
 18a08a03
-6fe14f02
+6fe14ef3
 e7e18005
 18a08a07
-6fe14f04
+6fe14ef5
 1ff27e00
 1fed7e00
 e7e18005
 20600000
-6fe0cf00
+6fe0cef1
 207a0000
 1fe0ffff
-67e0cf00
+67e0cef1
 dfe00062
 20600000
 d840000a
@@ -18037,47 +18037,47 @@
 d8400007
 20600000
 20406671
-6fe14f02
+6fe14ef3
 98467c00
 2441666b
 24610000
 98467e00
-67e14f02
+67e14ef3
 44d4c015
-6fe14f02
-68494f04
+6fe14ef3
+68494ef5
 184d0400
 18520400
 9840fe00
-67e1cb6b
+67e1cb5c
 20206654
-6fe14f02
+6fe14ef3
 d8400062
 98460400
 24610000
 18427e00
-6848cf00
+6848cef1
 18467c03
 2022e690
 18408401
-6048cf00
+6048cef1
 2020667c
-704f0000
+704ef100
 dfe00000
 2020667c
 20406730
 245a6685
 20406671
-6fe14f02
+6fe14ef3
 9840fe00
 d8400fff
 20407d6c
 2020667c
 20406671
-6fe14f04
+6fe14ef5
 98467e00
-67e14f04
-68494f04
+67e14ef5
+68494ef5
 20406730
 203a667d
 58000fff
@@ -18087,29 +18087,29 @@
 2421667d
 58000fff
 98467e00
-6848cf01
+6848cef2
 18467c05
 2022e6af
 18408401
-6048cf01
+6048cef2
 202066bc
-704f0100
+704ef200
 58000fff
 202066bc
 20406730
 203a66b0
-6fe0cf01
+6fe0cef2
 203a66b0
 1fe0ffff
-67e0cf01
+67e0cef2
 58000fff
 d8400062
 98467e00
 9a20fe00
-67e14f04
+67e14ef5
 2020667d
 20406671
-6fe14f04
+6fe14ef5
 9840fe00
 d8400fff
 98462200
@@ -18129,7 +18129,7 @@
 e7e10005
 58002800
 e7e10005
-d8c04a28
+d8c04a19
 20207c8f
 44d54015
 1a220c00
@@ -18149,10 +18149,10 @@
 2422ad50
 20406730
 243a66e9
-68494a24
+68494a15
 202066ea
-68494a26
-d8c04902
+68494a17
+d8c048f3
 20407c6d
 18427e00
 9a267e00
@@ -18175,34 +18175,34 @@
 6fe14332
 98467c00
 2422ad1d
-d8c04902
+d8c048f3
 18007e17
 20202d2d
 44d5c015
-704efe05
-704a3801
-704f0601
-704a39f0
-704f150a
-704f1a01
+704eef05
+704a2901
+704ef701
+704a2af0
+704f060a
+704f0b01
 204067bf
-6fe0cf16
+6fe0cf07
 207a0000
 20406783
 d8400062
-6fe14fcc
-da204f02
-da404f00
+6fe14fbd
+da204ef3
+da404ef1
 2040671e
 d8400062
-6fe14fce
-da204f04
-da404f01
+6fe14fbf
+da204ef5
+da404ef2
 2040671e
 58000fff
-68494f04
+68494ef5
 98467e00
-67e14f04
+67e14ef5
 20600000
 9846fc00
 20407d62
@@ -18215,33 +18215,33 @@
 efe08006
 c003672e
 20600000
-704efe01
-704a3800
-704f0600
-704a390a
+704eef01
+704a2900
+704ef700
+704a2a0a
 20600000
 20406729
 202067bf
-6fe0ca38
+6fe0ca29
 20600000
-da604f68
+da604f59
 20406730
 207a0000
-704a3978
-da604b6f
+704a2a78
+da604b60
 20600000
-da604a84
+da604a75
 20406730
 207a0000
-da604bab
-704a390c
+da604b9c
+704a2a0c
 18e27e00
 c1008000
 20600000
 44d64015
-6fe0cc52
+6fe0cc43
 79407e00
-67e0cc52
+67e0cc43
 c0006749
 c000e747
 20600000
@@ -18249,191 +18249,191 @@
 20206371
 2040674b
 20206371
-da604ab1
+da604aa2
 20406730
 207a0000
-da604bd8
+da604bc9
 20600000
-da604c3e
+da604c2f
 20406730
 207a0000
-da604c48
+da604c39
 20600000
 18e27e00
 c000e777
 c0016765
 c0026761
 20600000
-da604fe1
+da604fd2
 da40675d
 202042e0
-704fe104
-6fe0cc52
+704fd204
+6fe0cc43
 203a6761
 20206765
-704c5200
-704fe104
-da604af9
+704c4300
+704fd204
+da604aea
 20206371
-704c5201
-704fe104
-da604af3
+704c4301
+704fd204
+da604ae4
 20206371
-704c5200
-704fe100
+704c4300
+704fd200
 20600000
-da604fe2
+da604fd3
 da40676f
 202042e0
-704fe202
+704fd302
 20406772
 20206371
-da604fe3
+da604fd4
 20406730
 207a0000
-da604feb
+da604fdc
 20600000
-6fe0cff3
+6fe0cfe4
 243a677c
-704ff301
-704fe202
+704fe401
+704fd302
 20600000
-704ff300
-704fe200
+704fe400
+704fd300
 20600000
-6fe0ceff
+6fe0cef0
 247a0000
-704eff01
+704ef001
 2020667d
 58000000
-67e3cf00
+67e3cef1
 20600000
 20406730
 c000e78e
 c00067a0
 20600000
-6fe0cfd4
+6fe0cfc5
 c000e7a7
 c00067b9
 20600000
-6fe0cf00
+6fe0cef1
 1feffe62
 1fe20400
-6fe14f02
+6fe14ef3
 9840fe00
-67e14fd0
-6fe0cf01
+67e14fc1
+6fe0cef2
 1feffe62
 1fe20400
-6fe14f04
+6fe14ef5
 1fe22200
 58000fff
 9a267e00
 9840fe00
-67e14fd2
+67e14fc3
 20406730
-67e0cfd4
+67e0cfc5
 20600000
-6fe14f02
-67e14fd0
-6fe14f04
-67e14fd2
+6fe14ef3
+67e14fc1
+6fe14ef5
+67e14fc3
 20406730
-67e0cfd4
+67e0cfc5
 20600000
-6fe14fd0
+6fe14fc1
 1fe6fc62
 20407d62
 1807fe00
 18070400
-67e0cf00
+67e0cef1
 18427e00
-67e14f02
-6fe14fd2
+67e14ef3
+6fe14fc3
 1fe6fc62
 20407d62
 1807fe00
 18070400
-67e0cf01
+67e0cef2
 58000fff
 98467e00
-67e14f04
+67e14ef5
 20600000
-6fe14fd0
-67e14f02
-6fe14fd2
-67e14f04
+6fe14fc1
+67e14ef3
+6fe14fc3
+67e14ef5
 20600000
 2020683c
 20206823
 204067e2
-6fe14fd7
+6fe14fc8
 2040684f
-704fdf00
-6fe2cfd0
-704fe000
-704fdd00
+704fd000
+6fe2cfc1
+704fd100
+704fce00
 204067e6
-6fe0cfdd
+6fe0cfce
 c1000000
 202067c0
-6fe14fc4
+6fe14fb5
 1fe0fffb
-67e14fd7
+67e14fc8
 20600000
-6fe14fd7
+6fe14fc8
 1fe0fffb
-67e14fd7
+67e14fc8
 20600000
-6fe14fd7
+6fe14fc8
 1fe0fe05
-67e14fd7
+67e14fc8
 20600000
-6fe14fd9
+6fe14fca
 1fe0fe05
-67e14fd9
-6fe14fd9
+67e14fca
+6fe14fca
 1fe20400
-6fe14fc4
+6fe14fb5
 98467e00
 d8400005
 98467c00
 24216806
 20600000
-6fe0cfdf
+6fe0cfd0
 c000e7cb
 c00067cf
 20600000
 da400000
 1a420400
-6fe14fd0
+6fe14fc1
 a843fe00
 2440e7f6
 da400000
 1a420400
-6fe14fd2
+6fe14fc3
 a843fe00
 2440e7f6
 da400000
 1a420400
-6fe0cfd4
+6fe0cfc5
 a841fe00
 2440e7f6
 20600000
-6fe0cfdd
+6fe0cfce
 1fe0fe01
-67e0cfdd
+67e0cfce
 20600000
-704fdd01
+704fce01
 204067d7
-6fe14fd9
+6fe14fca
 2040684f
 20406730
 1fe20400
-6fe0cfd4
+6fe0cfc5
 a841fe00
 2040e821
-6fe0cfdd
+6fe0cfce
 c1000000
 202067fa
 44d6c015
@@ -18441,84 +18441,84 @@
 20406730
 203a680b
 20206812
-6fe14fc8
-67e14f02
-68494fca
+6fe14fb9
+67e14ef3
+68494fbb
 58000fff
 98467e00
-67e14f04
+67e14ef5
 202067be
 d8400062
-6fe14fcc
-da204f02
-da404f00
+6fe14fbd
+da204ef3
+da404ef1
 2040671e
 d8400062
-6fe14fce
-da204f04
-da404f01
+6fe14fbf
+da204ef5
+da404ef2
 2040671e
 58000fff
-68494f04
+68494ef5
 98467e00
-67e14f04
+67e14ef5
 202067be
-704fdd00
+704fce00
 20600000
 44d74015
-704fdf01
+704fd001
 204067c0
-6fe14fc6
+6fe14fb7
 1fe20400
-6fe14fd7
+6fe14fc8
 98467e00
 d8400000
 98467c00
 24610000
-6fe14fd7
+6fe14fc8
 1fe20400
-6fe14fc4
+6fe14fb5
 1fe0fffb
 98467e00
-6fe14fd7
-67e14fd9
+6fe14fc8
+67e14fca
 204067fa
-6fe14fd9
+6fe14fca
 2442e84f
-704fdd00
+704fce00
 204067e6
-6fe0cfdd
+6fe0cfce
 c1000000
 2020678a
 44d7c015
-704fdf01
+704fd001
 204067c0
-68494fc6
-6fe14fd7
+68494fb7
+6fe14fc8
 98467e00
 d8400000
 98467c00
 24610000
-68494fd7
-6fe14fc4
+68494fc8
+6fe14fb5
 98467e00
 d8400000
 98467c00
 24610000
-6fe14fd7
-67e14fd5
+6fe14fc8
+67e14fc6
 20406786
 20206854
 44d84016
 1fe22400
 df200005
-da204fd0
+da204fc1
 20206b74
 df200005
-da204fd0
-6a414fd5
+da204fc1
+6a414fc6
 20206b45
-da6048f2
+da6048e3
 da4067be
 202042e0
 6fe10912
@@ -24573,4 +24573,4 @@
 00000000
 00000000
 00000000
-0000a72d
\ No newline at end of file
+0000a18f
\ No newline at end of file
Index: output/sched.rom
===================================================================
--- /1121s/branch/shutter/branch/shutter/jxy_project/yc1386s_jxy_114_new/output/sched.rom	(revision 5827)
+++ /1121s/branch/shutter/branch/shutter/jxy_project/yc1386s_jxy_114_new/output/sched.rom	(working copy)
@@ -26,7 +26,7 @@
 20   #mem_patch18
 00   #mem_patch19
 00   #mem_patch1a
-00   #mem_patch1b
+38   #mem_patch1b
 00   #mem_patch1c
 00   #mem_patch1d
 00   #mem_patch1e
@@ -82,15 +82,11 @@
 
 mem_shutter_dy_conf:00
 
-# mem_shutter_adc_read_time_init:05
-# mem_shutter_lowpower_gpio:11
-# mem_shutter_lowpower_time:05
-# mem_shutter_vdd_calculate_set:
-# e4 0c	#mem_shutter_vdd_full_vol 3.3v*1000
-# d0 07	#mem_shutter_vdd_empty_vol 2.3v*1000
-# bf 09	#mem_shutter_vdd_low_vol 2.5v*1000
-
-
+mem_shutter_adc_read_time_init:05
+mem_shutter_vdd_calculate_set:
+68 10	#mem_shutter_vdd_full_vol 4.2v*1000
+b8 0b	#mem_shutter_vdd_empty_vol 3.0v*1000
+e4 0c	#mem_shutter_vdd_low_vol 3.3v*1000
 mem_shutter_discovery_time_conf:
 68 17 #discovery_timeout 这里的时间是1770减去回连8s所消耗的时间，也就是未连接的总时间
 70 17 #connect_timeout
Index: program/app_shutter.prog
===================================================================
--- /1121s/branch/shutter/branch/shutter/jxy_project/yc1386s_jxy_114_new/program/app_shutter.prog	(revision 5827)
+++ /1121s/branch/shutter/branch/shutter/jxy_project/yc1386s_jxy_114_new/program/app_shutter.prog	(working copy)
@@ -4,13 +4,13 @@
 shutter_init:
 	call enable_authrom
 	rtn wake
-	
+
 	setarg shutter_process_idle
 	store 2,mem_cb_idle_process
-		
-	setarg shutter_process_bb_event 
+
+	setarg shutter_process_bb_event
 	store 2,mem_cb_bb_event_process
-	
+
 	setarg ble_shutter_receive_data
 	store 2,mem_cb_att_write
 
@@ -21,7 +21,7 @@
 	store 2,mem_cb_shutter_keycan
 
 	call shutter_common_init
-	
+
 	bpatch patch14_0,mem_patch14
 	call shutter_load_buffer_config_form_DataRom
 
@@ -42,13 +42,13 @@
 
 	setarg shutter_soft_swtich_power_on
 	store 2,mem_shutter_soft_switch_poweron_callback_function
-	
+
 	setarg shutter_soft_swtich_power_off
 	store 2,mem_shutter_soft_switch_poweroff_callback_function
 
 	jam 7,mem_version
 	call le_modified_name_adv
-	call shutter_init_param	
+	call shutter_init_param
 	call keyscan_key_init
 	call queue_init
 	branch ui_led_init_global
@@ -74,7 +74,7 @@
 /**************c512bt event callback function*************/
 shutter_process_bb_event:
 	copy regc,pdata
-	
+
 /**************ble shutter event*****************/
 	beq BT_EVT_LE_CONNECTED,ble_shutter_process_baseband_connect
 	beq BT_EVT_LE_DISCONNECTED,ble_shutter_process_baseband_disconnect
@@ -131,14 +131,14 @@
 	rtnne SS_STATE_POWER_ON
 	call shutter_store_currenct_led_state
 	branch app_led_on
-	
+
 shutter_store_currenct_led_state:
 	jam 1,mem_shutter_soft_swtich_botton_down
 	arg 11,loopcnt
 	arg mem_shutter_soft_swtich_led_struct_temp,contw
 	arg mem_shutter_led_struct_app_led,contr
 	branch memcpy
-	
+
 shutter_process_soft_swtich_button_up:
 	fetch 1,mem_shutter_hard_soft_switch_case
 	rtneq HARD_SWITCH
@@ -156,7 +156,7 @@
 	arg mem_shutter_soft_swtich_led_struct_temp,contr
 	arg mem_shutter_led_struct_app_led,contw
 	branch memcpy
-	
+
 /**************************************/
 
 
@@ -234,7 +234,7 @@
 	store 2,mem_shutter_sleep_timeout
 	store 2,mem_shutter_sleep_timer
 	branch app_ble_stop_adv
-	
+
 
 shutter_start_bluetooth_discovery:
 	fetch 1,mem_shutter_soft_switch_power_state
@@ -323,7 +323,7 @@
 
 	call shutter_check_bluetooth_conn
 	branch shutter_change_bluetooth_status_bt_disconn,user
-	
+
 	call shutter_check_data_enable
 	nrtn user
 	branch enable_user2
@@ -348,7 +348,7 @@
 	arg MAX_QUEUE_NUM,pdata
 	imul32 queue,pdata
 	iadd regc,regc
-	
+
 //input:regc the address that want push to queue buffer
 push_buffer_in_queue:
 	ifetch 1,regc
@@ -445,7 +445,7 @@
 	fetch 1,mem_shutter_power_off_timeout
 	store 1,mem_shutter_power_off_timer
 	rtn
-	
+
 
 /*************soft swtich ui config*********************/
 ui_soft_swtich_init:
@@ -459,14 +459,14 @@
 	branch ui_soft_swtich_init_next, blank
 	fetch 1,core_lpm_isogate
 	bbit1 cold_wake,ui_soft_switch_power_on
-ui_soft_swtich_init_next:		
+ui_soft_swtich_init_next:
 	fetch 2,mem_ui_state_map
 	rtnbit1 UI_STATE_BTN_DOWN
 	branch app_enter_hibernate
 
 ui_soft_swtich_init_power_on_time:
 	fetcht 2,mem_power_param_ptr
-	istore 1,temp		//init power state 
+	istore 1,temp		//init power state
 	ifetch 1,contw		//power on time
 	store 1,mem_ui_button_timeout
 	rtn
@@ -486,7 +486,7 @@
 ui_soft_switch_power_on:
 	setarg SS_STATE_POWER_ON
 	fetcht 2,mem_power_param_ptr
-	istore 1,temp		//init power state 
+	istore 1,temp		//init power state
 	add temp,SS_POWER_OFF_TIME,contr
 	ifetch 1,contr
 	istore 1,mem_ui_button_timeout
@@ -500,7 +500,7 @@
 	ifetch 2,contr
 	branch app_enter_hibernate,blank		//no call back function , just enter hibernate
 	branch callback_func
-	
+
 /*************soft swtich ui config ending*********************/
 
 //pdata:adv interval value
@@ -511,7 +511,7 @@
 	rtn
 
 le_send_notify_from_list:
-	ifetch 1,contr	//length 
+	ifetch 1,contr	//length
 	copy pdata,rega
 	ifetcht 2,contr	//handle
 	call store_contr
@@ -524,9 +524,9 @@
 	setarg BLE_SHUTTER_GATT_LIST_ADDR
 	store 2,mem_ui_le_uuid_table	//BLE ATT LIST END
 	rtn
-	
+
 shutter_dy_le_uuid_table_conf:
-	setarg mem_shutter_le_uuid_sup	//BLE ATT LIST 
+	setarg mem_shutter_le_uuid_sup	//BLE ATT LIST
 	store 2,mem_ui_le_uuid_table	//BLE ATT LIST END
 	rtn
 
@@ -641,8 +641,8 @@
 	fetch 1,mem_shutter_dy_conf
 	beq SHUTTER_TYPE,shutter_le_uuid_table_conf
 	beq SHUTTER_DY_TYPE,shutter_dy_le_uuid_table_conf
-	rtn	
-	
+	rtn
+
 
 /*************shutter default_init ending*********************/
 
@@ -652,5 +652,5 @@
 
 else
 	branch assert
-	
+
 endif
Index: program/ble_protocol_stack/le.prog
===================================================================
--- /1121s/branch/shutter/branch/shutter/jxy_project/yc1386s_jxy_114_new/program/ble_protocol_stack/le.prog	(revision 5827)
+++ /1121s/branch/shutter/branch/shutter/jxy_project/yc1386s_jxy_114_new/program/ble_protocol_stack/le.prog	(working copy)
@@ -35,7 +35,7 @@
 	force 0,pdata
 	store 5,mem_ccm_pcnt_rx
 	set1 LE_CCM_DIRECTIONBIT,pdata
-	store 5,mem_ccm_pcnt_tx	
+	store 5,mem_ccm_pcnt_tx
 	branch le_init_conn
 
 
@@ -57,7 +57,7 @@
 	rshift4 pdata,pdata
 	store 2,mem_le_superto			// vol.6 part B 4.5.2 only 6*conninterval before establish
 	branch le_init_conn
-	
+
 
 //******************************************//
 //*************LE main process*********//
@@ -73,11 +73,11 @@
 	fetch 1,mem_le_mode
 	bbit1 mode_master,le_master_dispatch
 	branch le_slave_dispatch
-	
+
 //******************************************//
 //***********LE master process*********//
 //******************************************//
-	
+
 le_master_dispatch:
 	bpatchx patch22_2,mem_patch22
 	enable master
@@ -94,12 +94,12 @@
 	call le_acknowledge
 	disable master
 	rtn
-	
+
 le_master_disconn:
 	call le_disconnect
 	disable master
 	rtn
-	
+
 //******************************************//
 //***********LE slave process***********//
 //******************************************//
@@ -123,7 +123,7 @@
 	branch le_slave_match,match
 	bmark1 mark_ble_crc_fail,le_slave_crc_fail
 	branch le_slave_cont
-	
+
 
 le_slave_crc_fail:
 le_slave_match:
@@ -194,12 +194,12 @@
 le_clear_pairing_state:
 	bpatchx patch23_1,mem_patch23
 	jam FLAG_LE_ENC_NULL,mem_le_enc_state
-	jam FLAG_LE_PAIRING_NULL,mem_le_pairing_state 
+	jam FLAG_LE_PAIRING_NULL,mem_le_pairing_state
 ifdef SECURE_CONNECTION
 	call sp_clear_flags
 endif
 	rtn
-	
+
 le_got_first_packet:
 	bpatchx patch23_2,mem_patch23
 	fetch 1,mem_le_conn_rcv
@@ -266,7 +266,7 @@
 	jam 0x80,0x8920
 	jam 0x03,0x8930
 	rtn
-	
+
 le_prep:
 	bpatchx patch23_6,mem_patch23
 	disable enable_crc
@@ -279,11 +279,11 @@
 	set1 1,temp
 	rshift temp,white_init
 	rtn
-	
+
 
 le_rx_setfreq:
 	call le_setfreq
-le_rf_rx_enable:	
+le_rf_rx_enable:
 	call set_freq_rx
 	fetch 2,mem_param_pll_setup
 	call sleep
@@ -295,7 +295,7 @@
 le_tx_setfreq0:
 	call le_setfreq
 	branch set_freq_tx
-	
+
 le_setfreq:
 	bpatchx patch23_7,mem_patch23
 	call set_sync_on
@@ -310,17 +310,17 @@
 	rtneq 38
 	force 78,temp
 	rtn
-	
+
 le_ctf_normal:
 	sub pdata,10,null
 	branch le_ctf_low,positive
 	increase 1,pdata
-	
-le_ctf_low:	
+
+le_ctf_low:
 	lshift pdata,pdata
 	add pdata,2,temp
 	rtn
-	
+
 le_ctf_test:
 	fetch 1,mem_le_ch_mapped
 	lshift pdata,temp
@@ -345,7 +345,7 @@
 	rtn
 
 
-	
+
 le_setup:
 	bpatchx patch24_0,mem_patch24
 	enable swfine
@@ -377,13 +377,13 @@
 	istore 2,contw
 	call le_update_param
 	call le_update_channel_map
-	call le_update_phy	
+	call le_update_phy
 	call le_context_nexthop
 	call pop_stack_rega_b_c
 	fetchr loopcnt ,2,mem_loopcnt
 	rtn
-	
-le_context_nexthop:	
+
+le_context_nexthop:
 	add rega,coffset_le_hop,contr
 	ifetch 1,contr
 	add rega,coffset_le_ch,contw
@@ -449,7 +449,7 @@
 	branch le_wait_master,master
 	until null,timeout
 	rtn
-	
+
 le_wait_master:
 	arg 0xea0,timeup
 	until clkn_rt,meet
@@ -526,23 +526,23 @@
 	loop le_rx_loop
 	branch le_rx_nopayload
 
-le_rx_dec: 
+le_rx_dec:
 	copy contw,regb
 	bpatchx patch24_5,mem_patch24
-	call le_check_retransmit	
+	call le_check_retransmit
 //	bmark1 mark_old_packet,le_retransmit_end_of_packet
 	fetchr rega, 1,mem_le_rxbuf_data_length
 	increase -4,rega
 	nbranch le_mic_error,positive
 //	storer rega, 1,mem_le_rxbuf_data_length
-	call le_dec_start	
+	call le_dec_start
 	copy regb,contw
 	arg 0,temp
 	fetchr loopcnt, 1,mem_le_rxbuf_data_length
 	increase -4,loopcnt
 	branch le_rx_dec_loop_end,zero
 le_rx_dec_loop:
-	
+
 	parse demod,bucket,8
 	rshift3 pwindow,pdata
 	istore 1,contw
@@ -551,13 +551,13 @@
 	call le_dec,zero
 	loop le_rx_dec_loop
 le_rx_dec_loop_end:
-	call le_dec_end	
+	call le_dec_end
 	copy regb,contw
-	
+
 
 le_rx_nopayload:
 	bpatchx patch24_6,mem_patch24
-	parse demod,bucket,24	
+	parse demod,bucket,24
 	rshift32 pdata,pdata
 	rshift16 pdata,pdata
 	istore 3,contw
@@ -586,16 +586,16 @@
 	store 1,mem_le_rx_phy
 	call le_match_set_sync_on
 	branch le_match_set_txfreq
-	
-le_match_set_sync_on:	
+
+le_match_set_sync_on:
 	disable decode_fec0
 	branch set_sync_on
-	
+
 le_match_set_txfreq:
 	bpatchx patch25_0,mem_patch25
 	fetcht 1,mem_last_freq
-	branch set_freq_tx_int	
-	
+	branch set_freq_tx_int
+
 
 le_dec_init:
 	rtnmark0 mark_ble_encryption
@@ -603,16 +603,16 @@
 	force regidx_result,regext_index
 	call aes_clear
 	branch aes_clear_data
-	
-	
+
+
 le_dec_start:
 	bpatchx patch25_1,mem_patch25
-	jam 0,core_ccm_aad0 
+	jam 0,core_ccm_aad0
 	jam 1,core_ccm_aad1
 	fetch 1,mem_le_rxbuf_data_header
 	and_into 0x3,pdata
 	store 1,core_ccm_aad2
-	
+
 	setarg mem_le_rxbuf_data_payload
 	store 2,core_ccm_input_playload_addr
 	store 2,core_ccm_output_playload_addr
@@ -620,15 +620,15 @@
 	fetchr rega, 1,mem_le_rxbuf_data_length
 	increase -4,rega
 
-	fetcht 5,mem_ccm_pcnt_rx	
+	fetcht 5,mem_ccm_pcnt_rx
 	isolate1 mark_old_packet,mark
 	call le_pcnt_rx_sub1,true
 	call ccm_b0
 	setarg 0
 	store 2,core_ccm_inptr
 	jam 6,core_ccm_ctrl
-	jam 7,core_ccm_ctrl	
-	rtn	
+	jam 7,core_ccm_ctrl
+	rtn
 
 le_pcnt_rx_sub1:
 	sub temp,0,null
@@ -653,7 +653,7 @@
 	storet 2,core_ccm_inptr
 	copy regb,contw
 	rtn
-	
+
 le_dec_end://mic
 	parse demod,bucket,32
 	rshift32 pdata,pdata
@@ -679,8 +679,8 @@
 	bmark1 mark_ble_crc_fail,le_crc_fail_consecutive //two consecutive packets received with an invalid CRC match within a connection event shall close the event
 	set1 mark_ble_crc_fail,mark
 	branch le_crc_fail_tx
-	
-le_unsync_end:	
+
+le_unsync_end:
 le_crc_fail_consecutive:
 	set0 mark_ble_crc_fail,mark
 	branch le_end_of_packet
@@ -689,7 +689,7 @@
 	bpatchx patch25_2,mem_patch25
 	call ccm_ctrl_clr
 	branch end_of_packet
-	
+
 calc_clke_all_modem:
 	bmark1 mark_ble_lr,calc_clke_modem_coded
 	bmark1 mark_ble_2M,calc_clke_modem_2M
@@ -786,7 +786,7 @@
 	bpatchx patch25_4,mem_patch25
 	call le_transmit
 	branch end_of_packet
-	
+
 le_transmit:
 	bpatchx patch25_5,mem_patch25
 	call le_prep
@@ -817,15 +817,15 @@
 	branch le_tr_nopayload,zero
 
 	fetch 1,core_ccm_ctrl
-	branch le_transmit_packet_not_enc,blank 
+	branch le_transmit_packet_not_enc,blank
 	bmark1 mark_ble_encryption,le_transmit_packet_enc
-le_transmit_packet_not_enc:	
+le_transmit_packet_not_enc:
 	arg mem_le_txpayload,contr
 le_tr_loop:
 	ifetch 1,contr
 	inject mod,8
 	loop le_tr_loop
-	
+
 le_tr_nopayload:
 	enable enable_parity
 	inject mod,24
@@ -852,12 +852,12 @@
 	fetch 1,mem_le_txpayload
 	beq LL_START_ENC_REQ,le_set_enc
 	rtn
-	
+
 
 le_transmit_packet_enc:
 	increase -4,loopcnt
-	copy loopcnt,temp	
-	call ccm_wait_enc	
+	copy loopcnt,temp
+	call ccm_wait_enc
 	arg mem_le_txpayload,contr
 le_transmit_packet_enc_loop:
 	ifetch 1,contr
@@ -893,10 +893,10 @@
 	branch le_transmit_packet
 
 le_transmit_2M:
-	fetch 1,mem_system_clk	
+	fetch 1,mem_system_clk
 	fetcht 1,mem_le_tx2m_delay
 	iadd temp,pdata
-	call sleep				//2M ǰ˷ͱ1M
+	call sleep				//2M ǰ�˷��ͱ�1M��
 	rshift16 access,pdata
 	rshift8 pdata,pdata
 	rshift4 pdata,temp
@@ -905,7 +905,7 @@
 	copy temp,pdata
 	inject mod,40
 	branch le_transmit_packet
-	
+
 
 le_update_param:
 	arg le_update_param_ahead1_cb,regc
@@ -923,7 +923,7 @@
 	ifetch 2,contr
 	lshift2 pdata,pdata
 	iadd temp,timeup	//add windowsize
-	add rega,coffset_sniff_anchor,contw  
+	add rega,coffset_sniff_anchor,contw
 	deposit timeup
 	istore 4,contw
 	ifetch 2,contr
@@ -945,28 +945,28 @@
 	jam BT_EVT_LE_PARSE_CONN_PARAM_ACCEPTED,mem_fifo_temp
 	call ui_ipc_send_event
 	fetchr rega,2,mem_rega
-	rtn	
+	rtn
 
 le_update_channel_map:
 	arg 0,regc
 	arg le_update_channel_map_cb,regb
 	arg lestate_update_map,queue
 	branch le_check_update_flag
-	
+
 le_update_channel_map_cb:
 	add rega,coffset_le_new_map,contr
 	ifetch 5,contr
 	add rega,coffset_le_channel_map,contw
 	istore 5,contw
 	branch le_calc_channel_map
-	
+
 
 le_update_phy:
 	arg 0,regc
 	arg le_update_phy_cb,regb
 	arg lestate_update_phy,queue
 	branch le_check_update_flag
-	
+
 le_update_phy_cb:
 	add rega,coffset_le_new_m2s_phy,contr
 	ifetch 1,contr
@@ -980,7 +980,7 @@
 	jam BT_EVT_LE_UPDATE_PHY,mem_fifo_temp
 	call ui_ipc_send_event
 	fetchr rega,2,mem_rega
-	rtn	
+	rtn
 
 le_update_phy_cb_m2s:
 	call le_update_phy_cb_m2s_no_change,blank
@@ -1018,7 +1018,7 @@
 	add rega,coffset_le_rx_phy,contr
 	ifetch 1,contr
 	rtn
-	
+
 
 //regb regc is cb function
 //queue is state flag
@@ -1031,14 +1031,14 @@
 	ifetcht 2,contr
 	add rega,coffset_le_instant,contr
 	ifetch 2,contr
-	
+
 	isub temp,pdata
 	branch le_update,zero
 	nbranch le_check_update_small,positive
 	sub pdata,1,null
 	branch le_update_ahead1,zero
 	rtn
-	
+
 le_update_ahead1:
 	copy regc,pdata
 	branch callback_func
@@ -1049,7 +1049,7 @@
 	istore 1,rega
 	copy regb,pdata
 	branch callback_func
-	
+
 le_check_update_small:
 	add rega,coffset_le_event_cnt,contr
 	ifetch 2,contr
@@ -1063,7 +1063,7 @@
 	isub temp,null
 	nbranch le_update,positive
 	rtn
-	
+
 
 le_check_retransmit:
 	fetcht 1,mem_le_arq
@@ -1095,7 +1095,7 @@
 	fetch 1,mem_le_state
 	bbit0 lestate_encryption,le_ack_unenc
 	fetcht 4,mem_le_peer_mic
-	fetch 4,mem_ccm_last_mic			
+	fetch 4,mem_ccm_last_mic
 	isub temp,null
 	branch assert,zero
 	storet 4,mem_ccm_last_mic
@@ -1103,7 +1103,7 @@
 	increase 1,pdata
 	set1 LE_CCM_DIRECTIONBIT,pdata
 	store 5,mem_ccm_pcnt_rx
-	
+
 le_ack_unenc:
 	fetcht 1,mem_le_arq
 	setflip nesn,temp
@@ -1120,7 +1120,7 @@
 	branch le_parse_writing_attribute_start,true
 	rtn
 
-	
+
 le_check_wak:
 	bpatchx patch26_3,mem_patch26
 	fetcht 1,mem_le_arq
@@ -1136,15 +1136,15 @@
 	compare 3,temp,3
 //	nrtn true
 	rtn
-	
+
 
 le_set_enc:
 	fetch 1,mem_le_state
 	set1 lestate_encryption,pdata
 	store 1,mem_le_state
 	set1 mark_ble_encryption,mark
-	rtn	
-	
+	rtn
+
 le_clear_enc:
 	bpatchx patch26_4,mem_patch26
 	jam FLAG_LE_ENC_NULL,mem_le_enc_state
@@ -1197,7 +1197,7 @@
 	store 2,mem_contr
 	call le_update_tx_type
 	call le_send_packet
-	
+
 	call le_fifo_get_first_tx_ptr
 	ifetch 2,contr
 	copy pdata,rega	//rega:total length
@@ -1213,7 +1213,7 @@
 	nrtn zero
 	branch le_fifo_release_first_node
 
-	
+
 le_check_tx_md:
 	call le_check_continue
 	rtnmark1 mark_ble_tx_md
@@ -1223,7 +1223,7 @@
 	branch le_clear_md,blank
 	branch le_set_md
 
-	
+
 le_check_continue:
 	call le_fifo_get_first_tx_ptr	//no packet to send
 	branch le_clear_md,blank
@@ -1262,12 +1262,12 @@
 	copy contr,rega
 	ifetch 1,contr
 	rtn
-	
+
 
 le_send_empty:
 	force 0,temp
 	force 1,type
-	
+
 le_send_packet:
 	bpatchx patch26_7,mem_patch26
 	storet 1,mem_le_txlen
@@ -1286,15 +1286,15 @@
 	nbranch le_send_no_txlen,true
 	fetch 1,mem_le_txlen
 	rtn blank
-	
-le_send_no_txlen:	
+
+le_send_no_txlen:
 	bmark1 mark_ble_encryption,le_send_packet_enc
 	fetchr loopcnt,1,mem_le_txlen
 	fetch 2,mem_contr
 	copy pdata,contr
 	arg mem_le_txpayload,contw
 	branch memcpy_fast
-	
+
 le_send_packet_enc:
 	call load_sk
 	branch le_encrypt_new_start
@@ -1346,7 +1346,7 @@
 
 //input: pdata is CID number
 //output: 	if CID is legal ,enable user
-//		if ICD is illegal,disable user 
+//		if ICD is illegal,disable user
 le_check_l2cap_CID_legal:
 	call enable_user
 	arg LE_L2CAP_CID_ATT,temp
@@ -1360,7 +1360,7 @@
 	rtn zero
 	branch disable_user
 
-	
+
 le_check_l2cap_llid_start:
 	fetch 2,mem_le_payload_ptr
 	copy pdata,contr
@@ -1384,7 +1384,7 @@
 
 //no input
 //output: 	if CID is legal ,enable user
-//		if ICD is illegal,disable user 
+//		if ICD is illegal,disable user
 le_check_l2cap_continue_legal:
 	call enable_user
 	fetch 2,mem_le_packet_len_recved
@@ -1420,7 +1420,7 @@
 le_writeatt_cb:
 	fetch 2,mem_cb_att_write
 	branch callback_func
-	
+
 le_supervision_update:
 	bpatchx patch27_3,mem_patch27
 	fetcht 4,mem_le_supervision_timer
@@ -1432,13 +1432,13 @@
 	lshift temp,temp
 	isub temp,pdata
 	rtn
-	
+
 le_supervision_flush:
 	call get_clkbt
 	store 4,mem_le_supervision_timer
 	rtn
 
-	
+
 //input rega
 le_receive_window_size:
 	bpatchx patch27_4,mem_patch27
@@ -1459,7 +1459,7 @@
 	ifetch 1,contr
 	imul32 temp,pdata
 	iadd temp,pdata
-	store 4,mem_le_transmit_window	
+	store 4,mem_le_transmit_window
 	fetch 2,mem_rx_window_sniff
 	call wait_div_end
 	quotient temp
@@ -1468,9 +1468,6 @@
 	istore 2,contw
 	rtn
 
-	
-
-	
 le_modified_name:
 	bpatchx patch27_5,mem_patch27
 	call le_modified_name_att_list
@@ -1525,7 +1522,7 @@
 	call le_modified_name_adv_loop
 	fetch 1,mem_le_name_len
 	add pdata,1,temp
-	iadd regb,rega	
+	iadd regb,rega
 	increase 2,rega
 	sub rega,0x1f,null
 	nbranch le_modified_name_adv_and_scan_name_overflow,positive
@@ -1546,7 +1543,7 @@
 le_modified_name_adv_and_scan_name_overflow:
 	call disable_user
 	branch le_modified_name_adv_and_scan_store_data
-	
+
 le_modified_name_adv_loop:
 	ifetch 1,rega		//pdata:length
 	rtn blank			//length is zero,ending find
@@ -1554,7 +1551,7 @@
 	ifetcht 1,contr		//pdata:type
 	sub temp,GAP_ADTYPE_LOCAL_NAME_COMPLETE,null
 	branch le_modified_name_adv_found_name,zero
-	iadd regb,regb	
+	iadd regb,regb
 	copy rega,contr
 	iforce loopcnt
 	call memcpy_fast
@@ -1576,7 +1573,7 @@
 	loop memcpy_empty
 	rtn
 
-	
+
 le_lpm_set_mult:
 	bpatchx patch27_7,mem_patch27
 	disable wake
@@ -1593,13 +1590,13 @@
 	nbranch lpm_mult_short,blank		// rx not empty, short interval
 	fetch 1,mem_le_txlen
 	nbranch lpm_mult_short,blank		// tx not empty, short interval
-	
+
 	fetch 1,mem_le_state
 	bbit1 lestate_update_param,lpm_mult_short
 	bbit1 lestate_update_phy,lpm_mult_short
 	bbit1 lestate_update_map,lpm_mult_short
 	branch lpm_mult_wait_timeout
-	
+
 le_lpm_lost:
 	fetch 1,mem_sniff_unint_lost
 	sub pdata,30,null
@@ -1713,7 +1710,7 @@
 	copy regb,pdata
 	istore 1,contw
 	rtn
-	
+
 
 //rega:len regb:cid
 le_fifo_malloc_tx_l2cap:
@@ -1793,7 +1790,7 @@
 le_fifo_check_nearly_full:
 	branch l2cap_malloc_is_fifo_nearly_full
 
-	
+
 le_fifo_check_empty:
 	branch l2cap_malloc_is_fifo_empty
 
@@ -1832,7 +1829,7 @@
 
 le_set_tx_phy:
 	storer rega,1,mem_le_tx_phys
-le_set_phy_common:	
+le_set_phy_common:
 	isolate1 BIT_LE_2M_PHY,rega
 	call le_set_feature_2M_phy,true
 	isolate1 BIT_LE_CODED_PHY,rega
Index: program/ble_protocol_stack/le_l2cap_att.prog
===================================================================
--- /1121s/branch/shutter/branch/shutter/jxy_project/yc1386s_jxy_114_new/program/ble_protocol_stack/le_l2cap_att.prog	(revision 5827)
+++ /1121s/branch/shutter/branch/shutter/jxy_project/yc1386s_jxy_114_new/program/ble_protocol_stack/le_l2cap_att.prog	(working copy)
@@ -71,7 +71,7 @@
 	force 0,pdata
 	rtn
 
-	
+
 le_send_att_find_information_response:
 	arg 3,timeup
 	call le_init_attlist_search
@@ -103,20 +103,20 @@
 	setarg UUID_SIZE_16BIT
 	istore  1,contw
 	branch le_send_att_find_information_res_store_info
-	
+
 le_send_att_find_information_res_uuid128:
 	setarg UUID_SIZE_128BIT
 	istore 1,contw
 	arg 1,timeup
 	branch le_send_att_find_information_res_store_info
-		
+
 le_send_att_find_information_res_store_info2:
 	call get_contr
 	ifetch 2,contr
 	ifetch 1,contr
 	isub rega,null //uuid size format
 	nbranch le_send_att_find_information_res_end,zero
-	
+
 le_send_att_find_information_res_store_info:
 	call get_contr
 	ifetch 2,contr
@@ -130,11 +130,11 @@
 le_send_att_find_information_res_cont:
 	call le_att_contr_add_len
 	branch le_send_att_find_information_res_loop
-	
+
 le_send_att_find_information_res_next:
 	call le_att_contr_add_len
 	branch le_send_att_find_information_res_cont
-	
+
 le_send_att_find_information_res_end:
 	branch le_send_att_error_response_notfound,user
 	branch le_send_auto_len_by_mem
@@ -174,7 +174,7 @@
 	isub temp,null
 	branch le_send_att_find_by_type_value_res_primary,zero
 	branch le_send_att_error_response_notfound
-	
+
 
 le_send_att_find_by_type_value_res_primary:
 	jam LE_FIND_BY_TYPE_VAL_RES_NOT_FOUND,mem_le_search_res
@@ -185,7 +185,7 @@
 le_send_att_find_primary_search_loop:
 	fetcht 2,mem_temp
 	call le_att_get_handle_info
-	nbranch le_send_att_error_response_notfound2,blank	
+	nbranch le_send_att_error_response_notfound2,blank
 	copy contr,rega
 	fetch 1,mem_le_curr_att_len
 	copy pdata,loopcnt
@@ -212,7 +212,7 @@
 	beq LE_FIND_BY_TYPE_VAL_RES_FOUND_STARTING_HANDLE,le_send_att_find_primary_search_end_ending_handle_found
 	branch le_send_att_error_response_notfound
 
-	
+
 le_send_att_find_primary_search_end_start_handle_found:
 	fetch 2,mem_le_cur_uuid
 	fetcht 2,mem_le_search_uuid
@@ -231,7 +231,7 @@
 	fetcht 2,mem_temp
 	increase -1,temp
 	storet 2,mem_le_cur_handle_end
-	
+
 le_send_att_find_primary_search_end:
 	arg 5,rega
 	call le_fifo_malloc_tx_l2cap_gatt
@@ -249,7 +249,7 @@
 	call le_get_search_handle_start_end_common
 	call le_get_search_att_type
 	branch le_send_att_read_by_type_response
-	
+
 le_send_att_read_by_type_response:
 	fetcht 2,mem_le_search_handle_start
 	storet 2,mem_temp
@@ -284,7 +284,7 @@
 	istore 1,contw
 	copy contw,alarm
 	increase 1,contw
-	
+
 	call le_send_att_read_by_type_write_properties
 	call le_att_next_handle
 	call le_att_get_handle_info_from_ptr
@@ -292,7 +292,7 @@
 	fetch 1,mem_le_cur_uuid_length
 	add pdata,5,rega
 	istorer rega,1,alarm
-	
+
 	sub rega,7,null
 	ncall enable_user2,zero
 	call disable_user2,zero
@@ -327,11 +327,11 @@
 	branch le_send_att_read_by_type_response_end,zero
 	branch le_send_att_read_by_type_response_next_handle
 
-	
+
 le_send_att_read_by_type_write_properties:
 	fetch 2,mem_temp
 	istore 2,contw
-	
+
 	fetch 1,mem_le_curr_att_len
 	copy pdata,loopcnt
 	call get_contr
@@ -344,7 +344,7 @@
 	call store_contw
 	fetch 1,mem_le_cur_uuid_length
 	copy pdata,loopcnt
-	call get_contw	
+	call get_contw
 	call get_contr
 	isub loopcnt,contr
 	increase -1,contr
@@ -356,7 +356,7 @@
 	call le_att_get_uuid_ptr
 	branch le_send_att_error_response_notfound,blank
 	copy contr,regc
-	
+
 	call le_get_search_max_mtu_data
 	copy regc,contr
 	ifetcht 1,contr
@@ -377,12 +377,12 @@
 	call get_contr
 	branch  memcpy_fast
 
-	
+
 le_send_att_read_by_type_res_device_name:
 	call le_att_get_uuid_ptr
 	branch le_send_att_error_response_notfound,blank
 	increase -5,contr // point to handle
-	ifetch 2,contr		
+	ifetch 2,contr
 	store 2,mem_temp
 	call le_get_search_max_mtu_data
 	fetcht 1,mem_le_name_len
@@ -400,7 +400,7 @@
 	istore 2,contw
 	arg mem_le_name,contr
 	branch memcpy_fast
-	
+
 
 le_init_attlist_search:
 	bpatchx patch2a_6,mem_patch2a
@@ -418,7 +418,7 @@
 	call le_att_get_handle_ptr2
 	branch le_att_get_handle_ptr_found,zero
 	rtn
-	
+
 le_att_get_handle_ptr2:
 	bpatchx patch2a_7,mem_patch2a
 	fetch 2,mem_ui_le_uuid_table
@@ -432,13 +432,13 @@
 	call le_att_contr_add_len
 	call le_att_contr_add_len
 	branch le_att_get_handle_loop1
-	
+
 le_att_get_handle_ptr_found:
 le_att_contr_add_len:
 	ifetch 1,contr
-	iadd contr,contr	
-	rtn	
-	
+	iadd contr,contr
+	rtn
+
 
 le_att_get_uuid_ptr:
 	bpatchx patch2b_0,mem_patch2b
@@ -461,10 +461,10 @@
 	call string_compare
 	rtn zero
 	fetch 1,mem_le_search_att_type_length
-le_att_get_uuid_ptr_next:	
+le_att_get_uuid_ptr_next:
 	iadd contw,contr
 	call le_att_contr_add_len
-	branch le_att_get_uuid_loop	
+	branch le_att_get_uuid_loop
 
 
 
@@ -505,7 +505,7 @@
 	call le_att_contr_add_len
 	call le_att_contr_add_len
 	branch le_att_get_handle_loop
-	
+
 le_att_unfind_handle:
 	branch disable_blank
 
@@ -571,8 +571,8 @@
 	add regc,-1,loopcnt
 	arg mem_le_name,contr
 	branch memcpy
-	
-	
+
+
 le_send_att_read_response_check_auth:
 	fetch 2,mem_le_pairing_handle
 	isub temp,null
@@ -594,7 +594,7 @@
 	iforce rega
 	fetcht 2,mem_le_att_handle
 le_send_att_read_blob_response:
-	call le_att_get_handle_ptr 
+	call le_att_get_handle_ptr
 	branch le_send_att_error_response_notfound,blank
 	ifetch 1,contr
 	isub rega,loopcnt
@@ -616,7 +616,7 @@
 	branch memcpy_fast
 
 
-//ѯserver
+//��ѯserver
 le_parse_att_read_by_group_type_request:
 	call le_get_search_handle_start_end_common
  	call le_get_search_att_type
@@ -678,7 +678,7 @@
 	store 2,mem_le_cur_handle_start
 	call le_store_att_record
 	increase -1,timeup
-//	branch le_send_att_read_by_group_type_last_find,zero		
+//	branch le_send_att_read_by_group_type_last_find,zero
 le_send_att_read_by_group_type_next_handle:
 	call le_att_next_handle
 	branch le_send_att_read_by_group_type_response_loop
@@ -702,7 +702,7 @@
 	fetch 2,mem_temp
 	store 2,mem_le_cur_handle_end
 	branch le_send_att_read_by_group_type_end_common
-le_send_att_read_by_group_type_end1:	//>att max list handle or diff len 
+le_send_att_read_by_group_type_end1:	//>att max list handle or diff len
 	fetch 2,mem_temp
 	increase -1,pdata
 	store 2,mem_le_cur_handle_end
@@ -786,7 +786,7 @@
 	fetch 2,mem_le_att_handle
 	istore 2,contw
 	fetch 2,mem_le_l2cap_size
-	add pdata,-5,loopcnt	
+	add pdata,-5,loopcnt
 	fetch 2,mem_le_payload_ptr
 	add pdata,7,contr
 	ifetch 2,contr		//offset
@@ -848,10 +848,10 @@
 
 ///////////////////////////ATT common function////////////////////////////////////
 
-le_send_att_error_response_notfound:	
+le_send_att_error_response_notfound:
 	bpatchx patch2b_4,mem_patch2b
 	jam ATT_ERR_ATTRIBUTE_NOT_FOUND,mem_le_err_code
-le_send_att_error_response:	
+le_send_att_error_response:
 	force 5,rega
 	call le_fifo_malloc_tx_l2cap_gatt
 	setarg ATTOP_ERROR_RESPONSE
@@ -961,14 +961,14 @@
 	bpatchx patch2c_3,mem_patch2c
 	call store_contr
 	arg mem_le_search_att_type_length,contw
-le_get_search_common:	
+le_get_search_common:
 	fetch 2,mem_le_l2cap_size
 	increase -5,pdata
-le_get_search_common2:		
+le_get_search_common2:
 	istore 1,contw
 	copy pdata,loopcnt
 	call get_contr
-	branch memcpy_fast	
+	branch memcpy_fast
 
 
 
Index: program/bt.prog
===================================================================
--- /1121s/branch/shutter/branch/shutter/jxy_project/yc1386s_jxy_114_new/program/bt.prog	(revision 5827)
+++ /1121s/branch/shutter/branch/shutter/jxy_project/yc1386s_jxy_114_new/program/bt.prog	(working copy)
@@ -54,7 +54,7 @@
 //	call sp_wait_pubkey_calc_done
 endif
 	call lpm_recover_clk,wake
-main_loop:	
+main_loop:
 	bpatch patch00_2,mem_patch00
 ifdef SECURE_CONNECTION
 	call sp_calc_sequence_256
@@ -75,7 +75,7 @@
 	set0 mark_context,mark
 	call context_save
 	branch le_disable
-	
+
 connection_incontext:
 	bpatch patch00_3,mem_patch00
 	call context_search_insniff
@@ -87,7 +87,7 @@
 //	bbit1 mode_master, master_dispatch
 //	branch slave_dispatch
 	rtn
-	
+
 connection_nosniff:
 	jam 0,mem_current_context
 	call context_get_next
@@ -99,7 +99,7 @@
 /**************************************/
 /**************idle dispatch*********/
 /**************************************/
-	
+
 idle_dispatch:
 	fetch 1,mem_hci_cmd
 	rtn blank
@@ -131,7 +131,7 @@
 	copy rega,contr
 	bbit1 mode_le,memcpy
 	rtn
-	
+
 context_save:
 	bpatch patch00_5,mem_patch00
 	fetch 2,mem_context_ptr
@@ -139,8 +139,8 @@
 	force context_size,loopcnt
 	arg mem_le_state,contr
 	branch memcpy
-	
-	
+
+
 
 context_get_next:
 	arg context_num,loopcnt
@@ -161,7 +161,7 @@
 context_get_next_sniff:
 	loop context_get_next_loop
 	rtn
-	
+
 context_new:
 	bpatch patch00_6,mem_patch00
 	arg context_search_empty,regc
@@ -170,23 +170,23 @@
 	deposit rega
 	store 2,mem_context_ptr
 	branch enable_zero
-	
 
-	
+
+
 	//rtn nzero if idle(no conn)
 context_check_idle:
 	arg context_check_inconn,regc
 	branch context_search
-	
 
-	
+
+
 	/* return zero if conn handle is found */
 context_search_conn_handle:
 	fetcht 1,mem_hci_conn_handle
 context_search_conn_handle2:
 	arg context_search_handle,regc
 	branch context_search
-	
+
 	/* return zero if plap is found */
 context_search_plap:
 	bpatch patch00_7,mem_patch00
@@ -218,7 +218,7 @@
 context_search_empty:
 	bbit1 state_inconn,context_search_next
 	branch enable_zero
-	
+
 context_search_lap:
 	bbit0 state_inconn,context_search_next
 context_search_lap_cont:
@@ -250,26 +250,26 @@
 ifdef SECURE_CONNECTION
 	fetch 1,mem_sc_calc
 	nbranch context_search_sniff_sc,blank
-endif	
+endif
 	fetch 9,mem_temp
 	copy regb,contr
-	increase 5,pdata  
+	increase 5,pdata
 	branch context_search_meet1
-	
+
 ifdef SECURE_CONNECTION
 context_search_sniff_sc:
 	fetch 9,mem_temp
-	copy regb,contr	
-	increase 20,pdata  
-endif	
+	copy regb,contr
+	increase 20,pdata
+endif
 context_search_meet1:
 	nbranch context_search_next,positive
 context_search_meet:
 	copy temp,bt_clk
 	call context_next_anchor
 	branch enable_zero
-	
-	
+
+
 context_search_sniff_miss:
 	iforce regb
 	add rega,coffset_tsniff,contr
@@ -279,29 +279,29 @@
 	branch context_search_sniff_loop
 
 sign_pdata_temp:
-	rshift16 pdata,timeup    
-	rshift8 timeup,timeup    
-	branch sign_pdata_temp_p0,zero    
-	compare 0xf,timeup,0xf    
-	nrtn true    
-	rshift16 temp,timeup    
-	rshift8 timeup,timeup    
-	nrtn zero    
-	set1 28,temp    
-	rtn
-sign_pdata_temp_p0:    
-	rshift16 temp,timeup    
-	rshift8 timeup,timeup    
-	compare 0xf,timeup,0xf    
-	nrtn true    
-	set1 28,pdata    
+	rshift16 pdata,timeup
+	rshift8 timeup,timeup
+	branch sign_pdata_temp_p0,zero
+	compare 0xf,timeup,0xf
+	nrtn true
+	rshift16 temp,timeup
+	rshift8 timeup,timeup
+	nrtn zero
+	set1 28,temp
+	rtn
+sign_pdata_temp_p0:
+	rshift16 temp,timeup
+	rshift8 timeup,timeup
+	compare 0xf,timeup,0xf
+	nrtn true
+	set1 28,pdata
 	rtn
 
 context_check_inconn:
 	bbit0 state_inconn,context_search_next
 	branch enable_zero			// found
 
-	
+
 context_check_a_wack:
 	bbit0 state_inconn,context_search_next
 	add rega,coffset_mode,contr
@@ -331,7 +331,7 @@
 	deposit timeup
 	istore 4,contw
 	branch le_context_nextevent
-	
+
 
 context_search_window:
 	bbit0 state_insniff,context_search_next
@@ -413,7 +413,7 @@
 	fetch 2,mem_param_rt_rthalfslot
 	isub temp,pdata
 	iadd alarm,temp
-	
+
 calc_clke_pos:
 	storet 6,mem_le_clk_offset
 	rtn
@@ -438,7 +438,7 @@
 calc_clke_pos_adj:		/* add 2 clock */
 	force 0,null
 	branch calc_clke_pos2
-	
+
 /******************************************/
 /********* RF related functions ***********/
 /******************************************/
@@ -460,7 +460,7 @@
 	qsetflag true,pdata
 	istore 1,contw
 	rtn
-	
+
 rx_dcoc_avg:
 	nop 60
 btdma:
@@ -469,7 +469,7 @@
 	jam 9,0x8985
 	jam 0x9,0x8981
 	jam 0x3,0x8981
-	jam 0x6,0x8980	
+	jam 0x6,0x8980
 	nop 60
 	arg 0,rega
 	arg 0,regb
@@ -487,7 +487,7 @@
 	bpatch patch01_7,mem_patch01
 	call set_sync_on
 	arg 39,temp
-	call set_freq_rx	
+	call set_freq_rx
 	call rf_rx_enable
 	jam 0x7f,0x8a25
 	jam 0x1a,0x8a30
@@ -516,7 +516,7 @@
 	jam 0x52,0x8a8f
 	jam 2,0x8a30
 	jam 0,0x8981
-	
+
 shutdown_radio:
 	bpatch patch02_0,mem_patch02
 	call rf_debug_shutdown_radio_line	//L-H-L
@@ -536,34 +536,34 @@
 
 set_sync_on:
 	bpatch patch02_1,mem_patch02
-	jam 0x60,0x8a0f 
-	jam 0xaa,0x8a10 
-	jam 0x7a,0x8a12 
-	jam 0x00,0x8a25 
-	jam 0x00,0x8a26 
+	jam 0x60,0x8a0f
+	jam 0xaa,0x8a10
+	jam 0x7a,0x8a12
+	jam 0x00,0x8a25
+	jam 0x00,0x8a26
 	nop 60
-	jam 0x20,0x8a20 
-	jam 0xfd,0x8a23 
-	jam 0x12,0x8a24 
-	jam 0x10,0x8a24 
+	jam 0x20,0x8a20
+	jam 0xfd,0x8a23
+	jam 0x12,0x8a24
+	jam 0x10,0x8a24
 	nop 60
-	jam 0x60,0x8a12 
-	jam 0xdd,0x8a23 
+	jam 0x60,0x8a12
+	jam 0xdd,0x8a23
 	rtn
 
 set_freq_rx:
 	bpatch patch02_2,mem_patch02
-	jam 0x01,0x8900 
-	jam 0x9d,0x8a23 
-	jam 0x02,0x8a24 
-	nop 20 
+	jam 0x01,0x8900
+	jam 0x9d,0x8a23
+	jam 0x02,0x8a24
+	nop 20
 	jam 0x65,0x8a70
 	jam 0x9f,0x8a23
 	call set_lemode
 	storet 1,mem_last_freq
 	increase 1,temp
 //	branch aac_res_lookup
-	
+
 /* temp is frequency, 00=2400Mhz */
 aac_res_lookup:
 	bpatch patch02_3,mem_patch02
@@ -607,7 +607,7 @@
 	store 2,0x8907
 set_lemode_2m:
 	jam 3,0x8901
-	jam 0x84,0x8920	
+	jam 0x84,0x8920
 	rtnmark1 mark_ble_2M
 	jam 1,0x8901
 	jam 0x80,0x8920
@@ -646,28 +646,28 @@
 	jam 0xd,0x8900
 	rtn
 
-	
+
 rf_rx_agc_set:
 	fetch 1,mem_gain_fix
-	beq 0xff,rf_rx_enable_no_soft_agc 
+	beq 0xff,rf_rx_enable_no_soft_agc
 	arg mem_gain_table,contr
 	iadd contr,contr
 	ifetch 1,contr
 	store 1,core_rf_rx_gain_fix
 	jam 0x27,core_rf_rx_agc_ctrl
-	
+
 rf_rx_enable_no_soft_agc:
 	fetcht 1,mem_gain_second_agc_en	//0x00 or 0x08
 	fetch 1,core_rf_rx_agc_ctrl
 	ior temp,pdata
 	store 1,core_rf_rx_agc_ctrl
 	rtn
-	
+
 
 set_freq_tx_int:
-	jam 0x03,0x8900 
-	jam 0x02,0x8a24 
-	nop 20 
+	jam 0x03,0x8900
+	jam 0x02,0x8a24
+	nop 20
 	jam 0x65,0x8a70
 	jam 0xdf,0x8a23
 	call set_lemode
@@ -704,8 +704,8 @@
 	storer rega, 1,0x8a22
 	rshift8 rega,rega
 	storer rega, 1,0x8a21
-	jam 0xa0,0x8a20 
-	jam 0xe0,0x8a20 
+	jam 0xa0,0x8a20
+	jam 0xe0,0x8a20
 	jam 0xa0,0x8a20
 	rtn
 
@@ -741,20 +741,20 @@
 	setarg 0x0aaa7e
 	store 3,0x8a0f
 	nop 60
-	jam 0x00,0x8a25 
-	jam 0x0d,0x8a26 
-	jam 0x56,0x8a16 
+	jam 0x00,0x8a25
+	jam 0x0d,0x8a26
+	jam 0x56,0x8a16
 	nop 30
-	jam 0x1b,0x8a15 
+	jam 0x1b,0x8a15
 	call set_tx_power
 	nop 20
-	jam 0x0f,0x8a26 
+	jam 0x0f,0x8a26
 	nop 20
-	jam 0xa8,0x8a10 
-	jam 0x00,0x8a11 
+	jam 0xa8,0x8a10
+	jam 0x00,0x8a11
 	rtn
-	
-set_tx_power:	
+
+set_tx_power:
 	bpatch patch03_1,mem_patch03
 	fetch 1,mem_tx_power
 	beq TX_POWER_0DB,set_tx_power_0db
@@ -767,60 +767,60 @@
 	beq TX_POWER_F10DB,set_tx_power_f10db
 	beq TX_POWER_F20DB,set_tx_power_f20db
 set_tx_power_0db:
-	jam 0x17,0x8a14 
+	jam 0x17,0x8a14
 	setarg 0x251a3f
 	store 3,0x8a60
-set_tx_power_8a63_28:	
-	jam 0x28,0x8a63 
+set_tx_power_8a63_28:
+	jam 0x28,0x8a63
 	rtn
 
 set_tx_power_3db:
-	jam 0x25,0x8a14 
+	jam 0x25,0x8a14
 	setarg 0xa91c2d
 	store 3,0x8a60
-set_tx_power_8a63_2f:	
-	jam 0x2f,0x8a63 
+set_tx_power_8a63_2f:
+	jam 0x2f,0x8a63
 	rtn
 
 set_tx_power_5db:
-	jam 0x25,0x8a14 
+	jam 0x25,0x8a14
 	setarg 0xa91c3f
 	store 3,0x8a60
 	branch set_tx_power_8a63_2f
 
 set_tx_power_7db:
-	jam 0x25,0x8a14 
+	jam 0x25,0x8a14
 	setarg 0xa9383f
 	store 3,0x8a60
 	branch set_tx_power_8a63_2f
 
 set_tx_power_10db:
-	jam 0x25,0x8a14 
+	jam 0x25,0x8a14
 	setarg 0xa93f3f
 	store 3,0x8a60
 	branch set_tx_power_8a63_2f
 
 
 set_tx_power_f3db:
-	jam 0x17,0x8a14 
+	jam 0x17,0x8a14
 	setarg 0x251827
 	store 3,0x8a60
 	branch set_tx_power_8a63_28
-	
+
 set_tx_power_f5db:
-	jam 0x17,0x8a14 
+	jam 0x17,0x8a14
 	setarg 0x25181c
 	store 3,0x8a60
 	branch set_tx_power_8a63_28
 
 set_tx_power_f10db:
-	jam 0x17,0x8a14 
+	jam 0x17,0x8a14
 	setarg 0x25180b
 	store 3,0x8a60
 	branch set_tx_power_8a63_28
 
 set_tx_power_f20db:
-	jam 0x17,0x8a14 
+	jam 0x17,0x8a14
 	setarg 0x251000
 	store 3,0x8a60
 	branch set_tx_power_8a63_28
@@ -841,14 +841,14 @@
 	ifetch 1,contr
 	istore 1,contw
 	branch initialize_radio_loop
-	
+
 initialize_radio_cont:
 	bpatch patch03_2,mem_patch03
 	fetch 1,mem_wdt_always_work
 	call wdt_set_disable,blank
 
 	until null,lpo_edge
-	jam 0x5f,0x813b 
+	jam 0x5f,0x813b
 	fetch 1,mem_fcomp_div
 	beq XTAL_16M,initialize_radio_16m
 	fetch 1,mem_ring_ibias_trim
@@ -858,11 +858,11 @@
 	jam 0x24,0x8a80
 	jam 0x62,0x8a81
 	setarg 0xe61212
-	store 3,0x8a73	
+	store 3,0x8a73
 initialize_radio2:
 //	call gpio_set_before_lpm
 	jam 0x60,0x8a86
-	jam 0x3b,0x8a8b 
+	jam 0x3b,0x8a8b
 
 	call dpll_on
 	jam 0,core_config
@@ -878,7 +878,7 @@
 	jam SYSTEM_CLK_12M,mem_system_clk
 	call sadc_calibration
 	branch dpll_ring_ibias_calc
-	
+
 initialize_radio_16m:
 	fetch 1,mem_ring_ibias_trim
 	or_into 0x06,pdata
@@ -889,7 +889,7 @@
 	setarg 0xe40909
 	store 3,0x8a73
 	jam 0x2a,0x8a76
-	jam 0x04,0x8902	
+	jam 0x04,0x8902
 	branch initialize_radio2
 
 rfpll_aac_ghpc:
@@ -925,7 +925,7 @@
 	or_into 0x06,pdata
 	store 1,0x8a02
 	jam 0xe0,0x8a05
-dpll_on_24m:	
+dpll_on_24m:
 	jam 0xc8,0x8a00
 	nop 60
 	jam 0xa0,0x8a01
@@ -938,7 +938,7 @@
 aac_ghpc:
 	bpatch patch03_4,mem_patch03
 	jam 0x30,0x8a20
-	jam 0xdd,0x8a23 
+	jam 0xdd,0x8a23
 	call calc_freq
 wait_cal_done:
 	fetch 1,0x8a7c
@@ -1022,7 +1022,7 @@
 	isub temp,null
 	branch ring_ibias_trim_incrs,positive
 	fetcht 2,mem_ring_ibias_vtune_low
-	isub temp,null	
+	isub temp,null
 	rtn positive
 ring_ibias_trim_decrs:
 	fetch 1,mem_ring_ibias_trim
@@ -1038,7 +1038,7 @@
 	store 1,mem_ring_ibias_trim
 	rtn
 
-	
+
 save_rssi:
 	bpatch patch03_6,mem_patch03
 	 // bit6 is signed bit.
@@ -1062,22 +1062,22 @@
 	and pdata,0x1ff,pdata
 	isolate1 8,pdata
 	nbranch save_rssi_store,true
-	setarg 0	 
+	setarg 0
 save_rssi_store:
 	store 1,mem_rssi_hex
 	branch rssi_hex2dec
- 
+
 byte_sign_extern:
 	isolate1 7,pdata
 	nrtn true
 	arg 0xff00,temp
 	ior temp,pdata
 	rtn
- 
+
 rssi_hex2dec:
 	fetch 1,mem_rssi_hex
 	call bcd
-	store 1,mem_rssi			 
+	store 1,mem_rssi
 	rtn
 
 bcd:
@@ -1099,10 +1099,10 @@
 	nbranch gain_descend,positive
 	sub pdata,0x7f,null
 	branch gain_descend,positive
-	
+
 	fetchr rega, 1,core_rf_rx_gain_fix
 	fetch 1,mem_gain_fix
-	rtneq 0	
+	rtneq 0
 	arg mem_gain_table,contr
 	iadd contr,contr
 	ifetch 1,contr
@@ -1131,14 +1131,14 @@
 	and pdata,0xff,pdata
 	rtneq 0xff
 	rtneq 0xfe
-	
-gain_increase:	
+
+gain_increase:
 	fetch 1,mem_gain_fix
 	beq 1,set_rx_gain0
 	beq 2,set_rx_gain1
 //	beq 0,set_rx_gain0
 	branch set_rx_gain0
-	
+
 gain_descend:
 	fetch 1,mem_gain_fix
 	beq 0,set_rx_gain1
@@ -1151,12 +1151,12 @@
 set_rx_gain0:
 	jam 0,mem_gain_fix
 	rtn
-	
+
 set_rx_gain1:
 	jam 1,mem_gain_fix
 	rtn
 
-	
+
 
 
 
@@ -1195,14 +1195,14 @@
 assert:
 	bpatch patch04_1,mem_patch04
 	branch assert
-	
 
-sleep:	
+
+sleep:
 	rtn blank
 	/* sleep pdata clocks, only even clocks are accurate */
 	rshift pdata,pdata
 	increase -3,pdata
-sleep_loop:	
+sleep_loop:
 	increase -1,pdata
 	nbranch sleep_loop,zero
 	force 0,pdata
@@ -1234,7 +1234,7 @@
 	store 2,mem_param_clke_cal_le_2m
 	setarg param_clke_cal_le_coded
 	store 2,mem_param_clke_cal_le_coded
-	
+
 	bpatch patch04_2,mem_patch04
 	rtn wake
 	setarg ATT_DEFAULT_MTU
@@ -1243,7 +1243,7 @@
 	setarg mem_ble_tx_buff0
 	store 2,mem_ble_l2cap_tx_buff0_ptr
 	setarg mem_ble_l2cap_tx_buff_size
-	store 2,mem_ble_l2cap_tx_buff_size_ptr	
+	store 2,mem_ble_l2cap_tx_buff_size_ptr
 	rshift clkn_bt,pdata
 	store 4,mem_last_clkn
 	rtn
@@ -1260,7 +1260,7 @@
 	fetch 1,core_lpm_isogate
 	bbit0 gpio_latch,power_up
 	enable wake
-	bbit1 cold_wake,lpmwake		// wakeup from lpm	
+	bbit1 cold_wake,lpmwake		// wakeup from lpm
 	disable wake
 	deposit auxcnt
 	nbranch lpmwake,blank		// sleep interrupted, wakeup
@@ -1273,7 +1273,7 @@
 	call lpm_load_context,wake
 	fetch 1,core_lpm_isogate
 	set0 gpio_latch,pdata			// enable gpio normal function after load gpio configuration
-	store 1,core_lpm_isogate		
+	store 1,core_lpm_isogate
 	nbranch boot_load,wake		// wakeup from hibernate
 ifdef YC1121SB
 	nop 1
@@ -1286,25 +1286,25 @@
 power_up:
 	call lpm_poweron_retmem
 boot_load:
-	call loadcode	
+	call loadcode
 	storer alarm,4,mem_saved_gpio_in
 	rtn
 
 lpm_poweron_retmem:
 	until null,lpo_edge
 	fetch 1,core_lpm_ldosel
-	and_into 0x88,pdata			// clear ldo to default all zero 
+	and_into 0x88,pdata			// clear ldo to default all zero
 	store 1,core_lpm_ldosel
 	until null,lpo_edge
 	fetch 1,core_lpm_isogate
 	or_into 0xf,pdata				// turn on all retmem switch
-	store 1,core_lpm_isogate		
+	store 1,core_lpm_isogate
 	until null,lpo_edge
 	set1 isogate,pdata				// turn on isolation gate
-	store 1,core_lpm_isogate		
+	store 1,core_lpm_isogate
 	until null,lpo_edge
 	set1 retmem_cs,pdata			// assert CSN
-	store 1,core_lpm_isogate		
+	store 1,core_lpm_isogate
 	until null,lpo_edge
 	rtn
 
@@ -1335,7 +1335,7 @@
 	set1 option_lock,pdata
 	store 1,core_peripheral_lock
 	branch lpm_write_wait
-	
+
 lpm_write_ice_disable:
 	fetch 1,core_lpm_sysctl
 	set0 ice_mode,pdata
@@ -1354,7 +1354,7 @@
 lpm_write_3bytes:
 	arg 3,loopcnt
 	branch lpm_write_loop
-	
+
 lpm_write_mpu_s0:
 	arg core_mpu_s0_saddr,contw
 lpm_write_dword:
@@ -1387,7 +1387,7 @@
 	store 1,mem_lpm_hv_sel
 lpm_write_sel_hv:
 	store 1,core_io_doze_en
-lpm_write_wait:	
+lpm_write_wait:
 	until null,lpo_edge
 	rtn
 
@@ -1423,7 +1423,7 @@
 	fetch 1,core_spid_ctrl
 	store 1,mem_saved_spidctrl
 	branch lpm_write_gpio_wakeup
-	
+
 lpm_write_gpio_wakeup:
 	arg 12,loopcnt
 	arg mem_gpio_wakeup_cfg,contr
@@ -1466,7 +1466,7 @@
 	bpatch patch04_4,mem_patch04
 	arg param_hibernate_clks,temp
 	fetch 1,mem_lpm_hibernate_switch
-	store 1,mem_lpm_isogate_final	
+	store 1,mem_lpm_isogate_final
 	fetch 1,mem_lpm_sysctl
 	store 1,core_lpm_sysctl
 	until null,lpo_edge
@@ -1525,7 +1525,7 @@
 	store 1,mem_lpm_xtalcnt
 	nop 30000
 	nop 30000
-	nop 30000	
+	nop 30000
 	rtn
 
 
@@ -1599,7 +1599,7 @@
 	store 4,mem_sleep_counter_all
 	rtn
 
-	
+
 lpm_dispatch:
 	bpatch patch05_0,mem_patch05
 	call lpo_calibration
@@ -1614,14 +1614,14 @@
 	rtn blank
 lpm_dispatch_next:
 	fetch 1,mem_sc_calc
-	nrtn blank	
+	nrtn blank
 endif
 	arg context_check_a_wack,regc
 	call context_search
 	rtn zero
 	call lpm_check_wake_lock
 	nrtn blank
-	call context_check_idle						
+	call context_check_idle
 	nbranch lpm_dispatch_unconn,zero
 	rtn wake
 	bpatch patch05_1,mem_patch05
@@ -1656,24 +1656,24 @@
 //	call l2cap_lpm_save_txbuf
 	fetcht 4,mem_sleep_counter
 	branch lpm_sleep
-	
+
 lpm_dispatch_unconn:
 	bpatch patch05_3,mem_patch05
 	fetch 1,mem_le_adv_enable
 	nbranch lpm_unconn_cont,blank
 	rtn
-	
+
 lpm_unconn_cont:
 	fetch 2,mem_lpm_interval
 	rtn blank
 lpm_sleep_btclk:
 	fetcht 1,mem_lpm_overhead
 	isub temp,pdata
-	arg 7500,temp				
+	arg 7500,temp
 	imul32 temp,pdata
 	branch lpm_dispatch_sleep
 
-	
+
 lpm_mult_wait_timeout:
 	fetch 2,mem_cb_bt_set_mult
 	call callback_func
@@ -1762,6 +1762,6 @@
 	nsetflag blank,wake_lock_uart_tx ,rega
 	rtn
 
-	
+
 
 
Index: program/patch.prog
===================================================================
--- /1121s/branch/shutter/branch/shutter/jxy_project/yc1386s_jxy_114_new/program/patch.prog	(revision 5827)
+++ /1121s/branch/shutter/branch/shutter/jxy_project/yc1386s_jxy_114_new/program/patch.prog	(working copy)
@@ -1,5 +1,9 @@
 
-//define AUTO_TEST
+define ADC_1121SB
+ifdef ADC_1121SB
+//define ADC_1121SB_1V8_MODE
+endif
+define XTAL_CALP_SET
 
 	bbit1 8,pf_patch_ext
 	beq patch00_0,p_soft_reset
@@ -13,10 +17,14 @@
 	beq patch04_5,p_lpm_sleep
 	beq patch04_7,p_lpm_adjust_clk
 	beq patch05_0,p_lpm_dispatch
-	beq patch16_1,p_app_init
+	beq patch16_1,p_shutter_init
 	beq patch18_5,p_otp_read_data
+ifdef ADC_1121SB
+	beq patch1b_3,p_adc_init_data
+	beq patch1b_4,p_enable_adc
+	beq patch1b_5,p_vdd_calculate_by_mode
+endif
 	branch assert
-
 pf_patch_ext:
 	beq patch24_4,p_le_receive_rxon
 	beq patch24_5,p_le_rx_dec
@@ -67,7 +75,6 @@
 
 p_le_rx_dec:
 	call le_check_retransmit
-//	bmark1 mark_old_packet,le_retransmit_end_of_packet
 	fetchr rega, 1,mem_le_rxbuf_data_length
 	increase -4,rega
 	nbranch le_crc_fail_consecutive,positive
@@ -106,14 +113,35 @@
 	call sp_calc_sequence_256
 	call sp_calc_sequence_256_check
 endif
-	call le_advertising_dispatch
+	call p_le_advertising_dispatch
 	call idle_dispatch
 	call app_process_idle
-	call connection_dispatch
+	call p_connection_dispatch
 	call g24_dispatch
 	call lpm_dispatch
 	branch p_main_loop
 
+p_le_advertising_dispatch:
+	fetch 1,core_rf_rx_agc_ctrl
+	set0 1,pdata
+	store 1,core_rf_rx_agc_ctrl
+	call le_advertising_dispatch
+	fetch 1,core_rf_rx_agc_ctrl
+	set1 1,pdata
+	store 1,core_rf_rx_agc_ctrl
+	rtn
+
+p_connection_dispatch:
+	fetch 1,core_rf_rx_agc_ctrl
+	set0 1,pdata
+	store 1,core_rf_rx_agc_ctrl
+	call connection_dispatch
+	fetch 1,core_rf_rx_agc_ctrl
+	set1 1,pdata
+	store 1,core_rf_rx_agc_ctrl
+	rtn
+
+
 p_set_sync_on:
 	jam 0x60,0x8a0f
 	jam 0xaa,0x8a10
@@ -182,9 +210,12 @@
 	branch p_dpll_ring_ibias_calc
 
 p_set_xtal_cap:
+ifndef XTAL_CALP_SET
 	rtn wake
+endif
 	until null,lpo_edge
 	fetch 1,mem_xtal_c_sel
+p_set_xtal_cap_next:
 	store 1,core_xtal_cap
 	until null,lpo_edge
 	rtn
@@ -318,7 +349,6 @@
 
 p_shutter_long_sleep:
 	rtnmark0 mark_shutter_long_sleep
-	//call p_shutter_low_voltage_led_off
 	call p_shutter_enter_hibernate_timer
 	branch p_shutter_lpm_long_sleep
 
@@ -377,7 +407,6 @@
 
 p_shutter_clear_long_sleep_mark:
 	set0 mark_shutter_long_sleep,mark
-	//jam 0,mem_power_on_led_status_modify
 	jam 1,mem_ui_led_struct_num
 	branch p_shutter_init_next
 
@@ -388,19 +417,23 @@
 	bbit0 7,p_shutter_clear_long_sleep_mark
 	rtn
 
-p_app_init:
-	jam 0xc0,0x807d
-	jam 0xc0,0x80d6
-	call enable_authrom
-p_shutter_init:
+p_shutter_wake_event:
 	fetch 2,mem_ui_state_map
 	rtnbit1 UI_STATE_BLE_CONNECTED
 	bmark1 mark_shutter_long_sleep,p_shutter_clean_long_wake
+	rtn
+
+p_shutter_init:
+	jam 0xc0,0x807d				//gpio13
+	jam 0xc0,0x80d6				//gpio18
+	// jam 0xc0,0x807f				//gpio15
+	call enable_authrom
+	call p_shutter_wake_event
 	rtn wake
 p_shutter_init_next:
 	call wdt_set_disable
 	jam 0x0a,mem_lpm_overhead
-	call shutter_default_init
+	call app_param_init
 	setarg 0x1919
 	store 2,mem_shutter_soft_switch_poweron_time
 
@@ -440,6 +473,7 @@
 	setarg p_shutter_soft_swtich_power_off
 	store 2,mem_shutter_soft_switch_poweroff_callback_function
 
+	call p_shutter_adc_init
 	call shutter_common_init+8
 	call shutter_load_buffer_config_form_DataRom
 p_shutter_soft_hard_switch_power_on_signal:
@@ -475,6 +509,10 @@
 	call shutter_process_lpm_before
 	branch disable_authrom
 
+p_shutter_adc_init:
+	jam 1,mem_shutter_start_adc_flag
+	rtn
+
 p_shutter_process_idle:
 	arg 10, pdata //Լ96ms
 	call wdt_init_config
@@ -522,7 +560,6 @@
 	call app_led_off
 p_shutter_connect_success_led_event:
 	jam 1,mem_shutter_led_enable
-	// branch p_shutter_led_time_init
 p_shutter_led_time_init:
 	fetch 1,mem_shutter_led_time_init
 	store 1,mem_shutter_led_time
@@ -531,26 +568,18 @@
 	fetcht 2,mem_power_param_ptr
 	ifetch 1,temp
 	beq SS_STATE_POWER_ON,p_ui_soft_switch_power_off
-// p_shutter_evt_button_long_pressed0:
-// 	jam 1,mem_power_on_led_status_modify
 p_shutter_work_start:
 	jam 0,mem_power_off_enter_hibernate_flag
 	fetch 1,mem_shutter_soft_switch_power_state
 	beq SS_STATE_POWER_ON,shutter_load_currenct_led_state
-	//fetch 1,mem_tank_powerup_flag
 	jam ON,mem_le_adv_enable
 	set0 mark_shutter_long_sleep,mark
 	jam 1,mem_le_shutter_long_press_flag
 	branch ui_soft_switch_power_on
 
 p_ui_soft_switch_power_off:
-	//jam 0,mem_shtter_init_flag
 	jam 0,mem_shutter_conn_state_flag
-	//jam 0,mem_shutter_start_adc_flag
 	jam 0,mem_power_off_enter_hibernate_flag
-	//call app_led_off
-	//jam SS_STATE_POWER_OFF,mem_tank_powerup_flag
-	//jam 0,mem_enable_key_scan
 	jam OFF,mem_le_adv_enable
 	jam 0,mem_le_shutter_long_press_flag
 	setarg SS_STATE_POWER_OFF
@@ -560,19 +589,15 @@
 	branch p_shutter_shutter_power_off_signal,blank		//no call back function , just enter hibernate
 	branch callback_func
 
-// p_shutter_load_currenct_led_state:
-// 	jam 0,mem_power_on_led_status_modify
-// 	branch shutter_load_currenct_led_state
-
 p_shutter_le_bb_event_timer:
-	// call p_shutter_lowpower_led_timer
-	// call p_shutter_adc_read_timer
+ifdef ADC_1121SB
+	call p_shutter_adc_read_start
+endif
 	call P_shutter_poweron_led_timer
 	call p_shutter_check_sleep_timer
 	call p_shutter_check_power_off_timer
 	branch ble_shutter_reconn_timer
 
-
 P_shutter_poweron_led_timer:
 	fetch 1,mem_shutter_led_enable
 	rtn blank
@@ -616,19 +641,13 @@
 	branch timer_single_step_2B
 
 p_shutter_sleep_timeout:
-	//jam 0,mem_shtter_init_flag
-	//jam 0,mem_shutter_conn_state_flag
-	//jam 0,mem_shutter_start_adc_flag
 	jam 1,mem_power_off_enter_hibernate_flag
 	jam SS_STATE_POWER_OFF,mem_shutter_soft_switch_power_state
 	call app_led_off
-	//call p_shutter_low_voltage_led_off
 	jam 0,mem_ui_led_struct_num
-	//jam 0,mem_shutter_enable_low_voltage_flag
 	call shutter_disconnect_current_connection
 	branch shutter_wait_power_off
 
-
 p_shutter_check_power_off_timer:
 	arg mem_shutter_power_off_timer,regc
 	arg p_shutter_check_power_off_timeout,regb
@@ -807,6 +826,10 @@
 	//call xtal_fast_wake
 	fetch 2,mem_cb_before_lpm_sleep
 	call callback_func
+ifdef XTAL_CALP_SET
+	setarg 0x12
+	call p_set_xtal_cap_next
+endif
 p_lpm_sleep_skip_cb_function:
 	fetch 4,mem_sleep_counter_all	// sleep total time, 32k unit
 	iadd temp,pdata
@@ -919,3 +942,319 @@
 //	rtn positive
 	copy rega,temp
 	branch lpm_adjust_clk+6
+
+/////////////////////////////////////////////// adc ////////////////////////////////////////
+
+ifdef ADC_1121SB
+p_shutter_adc_read_interval:
+	fetch 1,mem_shutter_adc_read_timer
+	increase 1,pdata
+	store 1,mem_shutter_adc_read_timer
+	fetcht 1,mem_shutter_adc_read_time_init	//1s read adc
+	isub temp,null
+	rtn
+
+p_shutter_adc_read_start:
+	fetch 1,mem_shutter_start_adc_flag
+	rtn blank
+	call p_shutter_adc_read_interval
+p_shutter_adc_read_start_next:
+	nrtn positive
+	jam 0,mem_shutter_adc_read_timer
+	jam ADC_CONFIG_HVIN,mem_adc_config_flag
+	call adc_clear_no_power_flag
+	call adc_clear_low_power_flag
+	call p_enable_adc
+	call p_vdd_calculate_by_mode
+	store 2,mem_shutter_vdd_now_vol
+p_shutter_adc_data_process:
+	arg mem_shutter_vdd_calculate_set,rega
+	call p_shutter_bat_percent_lowpower_out
+	fetch 1,mem_adc_power_flag
+	bbit1 1,p_shutter_low_voltage_power_down
+	bbit0 0,p_shutter_adc_no_low_voltage
+	jam 1,mem_shutter_adc_last_low_voltage_flag
+	branch p_shutter_adc_low_voltage
+
+p_shutter_bat_percent_lowpower_out:
+	ifetch 8,rega
+	store 8,mem_pdatatemp
+p_shutter_bat_percent_lowpower_out_battery:
+	call adc_clear_no_power_flag
+	call adc_clear_low_power_flag
+	fetch 2,mem_pdatatemp+6
+	fetcht 2,mem_pdatatemp+2	        //shutdown voltage
+	isub temp,null
+	ncall adc_set_no_power_flag,positive
+
+	fetcht 2,mem_pdatatemp+4		//low voltage
+	isub temp,null
+	ncall adc_set_low_power_flag,positive
+p_shutter_adc_bat_level_set:
+	fetch 2,mem_pdatatemp+6		//now voltage
+	fetcht 2,mem_pdatatemp		//full voltage
+	isub temp,null
+	branch p_shutter_adc_bat_level_100_percent,positive		// now >= full
+	fetcht 2,mem_pdatatemp+2	        //shutdown voltage
+	isub temp,pdata
+	nbranch p_shutter_adc_bat_level_0_percent,positive		// now < shutdown
+	branch p_shutter_adc_bat_level_0_percent,blank			// now = shutdown
+	mul32 pdata,100,rega								// (now - shutdown)*100 /(full - shutdown)
+	fetch 2,mem_pdatatemp
+	fetcht 2,mem_pdatatemp+2
+	isub temp,temp
+	copy rega,pdata
+	idiv temp
+	call get_div_result
+	store 1,mem_shutter_battery_level_percentage
+	rtn
+
+p_shutter_adc_bat_level_100_percent:
+	jam 100,mem_shutter_battery_level_percentage
+	rtn
+p_shutter_adc_bat_level_0_percent:
+	jam 0,mem_shutter_battery_level_percentage
+	rtn
+
+p_shutter_low_voltage_power_down:	//shutterdown
+	jam 1,mem_shutter_enable_power_down_flag
+	jam 1,mem_shutter_power_down_twinkle_flag
+	call app_led_off
+	branch app_enter_hibernate
+
+p_shutter_adc_low_voltage:
+	jam 1,mem_shutter_enable_low_voltage_flag
+	rtn
+
+p_shutter_adc_no_low_voltage:
+	jam 0,mem_shutter_enable_low_voltage_flag
+	fetch 1,mem_shutter_adc_last_low_voltage_flag
+	rtn blank
+	jam 0,mem_shutter_adc_last_low_voltage_flag
+	rtn
+endif
+
+ifdef ADC_1121SB
+
+p_adc_init_data:
+	fetch 8,mem_otp_adc
+	branch adc_init_cal_data_default,blank
+	store 8,mem_reference_inter1p8v_2v_adc_io_data
+	call enable_otp_read
+	call loadcode_check_otp_lock
+	arg OTP_OFFSET_ADC_PARAM_L_C0,pdata
+	iadd regb,regb
+	arg 10,loopcnt
+	arg mem_otp_temp,rega
+	call otp_read_data
+	call disable_otp
+	fetch 8, mem_otp_temp
+	rtn blank
+	store 8,mem_adc_reference3v_gpio1v_ft_data
+	ifetch 2,contr
+	istore 2,contw
+	//call  eut_test_data_init
+	rtn
+
+p_sadc_cal_write:
+	fetch 1,core_sadc_ctrl
+	set1 1,pdata
+	store 1,core_sadc_ctrl
+	fetchr regb,1,mem_spi_write_addr
+	fetch 1,mem_adc_cal_c7
+	store 1,mem_spi_write_addr
+	arg 8,loopcnt	//rg_gpadc_sar_dat_sel c0-c7
+	call sadc_cal_write+4
+	storer regb,1,mem_spi_write_addr
+	fetch 1,core_gpadc_cfg2
+	set0 4,pdata//caliberation write disable
+	store 1,core_gpadc_cfg2
+	rtn
+
+
+
+p_vdd_calculate_by_mode:
+ifdef  ADC_1121SB_1V8_MODE
+	fetch 1,mem_adc_reference_mode
+	beq SADC_REFERENCE_INTER3V,p_vdd_reference_inter3V_calculate
+	beq SADC_REFERENCE_INTER1P8V_DIV2,p_vdd_reference_inter1p8V_calculate
+	branch p_vdd_reference_inter3V_calculate
+endif
+
+p_vdd_reference_inter3V_calculate:
+	fetch 1,mem_adc_config_flag
+	beq ADC_CONFIG_HVIN,p_vdd_reference_inter3V_calculate_by_mode_vdcdc
+	beq ADC_CONFIG_GPIO,p_vdd_reference_inter3V_calculate_by_mode_gpio
+	rtn
+
+p_vdd_reference_inter3V_calculate_by_mode_vdcdc:
+	setarg 1000
+	store 2,mem_reference_voltage
+	fetcht 2,mem_adc_reference3v_vdcdc3p6v_ft_data
+	fetch 2,mem_adc_reference3v_vdcdc4p6v_ft_data
+	arg 3600,regc
+	call vdd_calculate
+	branch p_mul1V_div1V_to_cal
+
+p_vdd_reference_inter3V_calculate_by_mode_gpio:
+	setarg 1000
+	store 2,mem_reference_voltage
+	fetcht 2,mem_adc_reference3v_gpio1v_ft_data
+	fetch 2,mem_adc_reference3v_gpio2v_ft_data
+	arg 1000,regc
+	call vdd_calculate
+p_mul1V_div1V_to_cal:
+	fetcht 2,mem_adc_reference3v_inter1v_ft_data
+	imul32 temp,pdata
+	fetcht 2,mem_adc_reference3v_inter1v_now_data
+	idiv temp
+	branch get_div_result
+
+p_enable_adc_init_config:
+	call p_sadc_cal_write
+	fetch 1,core_gpadc_cfg1
+	set0 7,pdata
+	store 1,core_gpadc_cfg1
+	jam 0x77,core_gpadc_ctrl
+	jam 0xc1,core_gpadc_cfg0
+	jam 0x61,core_vtest_ctrl0
+	jam 0x00,core_gpadc_cfg3
+	rtn
+
+p_enable_adc:
+ifdef  ADC_1121SB_1V8_MODE
+	fetch 1,mem_adc_reference_mode
+	beq SADC_REFERENCE_INTER3V,p_enable_adc_reference_source_inter3V
+	beq SADC_REFERENCE_INTER1P8V_DIV2,p_enable_adc_reference_source_inter1p8V
+	branch p_enable_adc_reference_source_inter3V
+endif
+
+p_enable_adc_reference_source_inter3V:
+	call p_enable_adc_init_config
+	call sadc_channel
+	fetch 1,mem_adc_clkdiv
+	store 1,core_sadc_clkdiv
+	call sadc_read
+	jam 0x60,core_vtest_ctrl0
+	jam 0x00,core_sadc_clkdiv
+//	rtn
+
+p_read_adc_inter1V:
+	call p_enable_adc_init_config
+	fetch 1,mem_adc_clkdiv
+	store 1,core_sadc_clkdiv
+	jam 0x50,core_gpadc_cfg3
+	jam 0xc0,core_vtest_ctrl1//select vref1v
+
+	arg 0xb,regext_index
+	fetchr regext, 2,mem_adc_current_value
+
+	jam 0x03,core_sadc_ctrl
+	call p_sar_adc_read_wait
+	fetcht 2,core_sadc_data
+	storet 2,mem_adc_reference3v_inter1v_now_data
+	call sadc_read_wait+4
+
+	arg 0xb,regext_index
+	storer regext,2,mem_adc_current_value
+
+	jam 0x60,core_vtest_ctrl0
+	jam 0x00,core_sadc_clkdiv
+	jam 0x00,core_sadc_ctrl
+	rtn
+
+p_sar_adc_read_wait:
+	fetch 1,core_perf_status
+	bbit0 SARADC_DONE,p_sar_adc_read_wait
+	rtn
+
+ifdef  ADC_1121SB_1V8_MODE
+p_vdd_reference_inter1p8V_calculate:
+	fetch 1,mem_adc_config_flag
+	beq ADC_CONFIG_HVIN,p_vdd_reference_inter1p8V_calculate_by_mode_vdcdc
+	beq ADC_CONFIG_GPIO,p_vdd_reference_inter1p8V_div2_calculate_by_mode_gpio
+	rtn
+
+p_vdd_reference_inter1p8V_calculate_by_mode_vdcdc:
+	setarg 2000
+	store 2,mem_reference_voltage
+	fetcht 2,mem_reference_inter1p8v_2p6v_adc_vdcdc_data
+	fetch 2,mem_reference_inter1p8v_4p6v_adc_vdcdc_data
+	arg 2600,regc
+	branch vdd_calculate
+
+p_vdd_reference_inter1p8V_div2_calculate_by_mode_gpio:
+	setarg 1000
+	store 2,mem_reference_voltage
+	fetcht 2,mem_reference_inter1p8v_2v_adc_io_data
+	fetch 2,mem_reference_inter1p8v_1v_adc_io_data
+	arg 2000,regc
+	branch p_vdd_calculate00
+
+p_vdd_calculate00:
+	isub temp,rega
+	fetch 2,mem_adc_current_value
+	isub temp,pdata
+	nbranch p_vdd_calculate11,positive
+	fetcht 2,mem_reference_voltage
+	imul32 temp,regb
+	copy regc,pdata
+	imul32 rega,pdata
+	isub regb,pdata
+	nbranch set_pdata_0,positive
+	branch vdd_calculate2
+
+p_vdd_calculate11:
+	copy temp,pdata
+	fetcht 2,mem_adc_current_value
+	isub temp,pdata
+	fetcht 2,mem_reference_voltage
+	imul32 temp,regb
+	copy regc,pdata
+	imul32 rega,pdata
+	iadd regb,pdata
+	branch vdd_calculate2
+
+
+p_enable_adc_reference_source_inter1p8V:
+	fetch 1,mem_adc_config_flag
+	beq ADC_CONFIG_HVIN,p_enable_adc_reference_source_inter1p8V_vdcdc
+p_enable_adc_reference_source_inter1p8V_div2_gpio:
+	call p_sadc_cal_write
+	fetch 1,core_gpadc_cfg1
+	set0 7,pdata
+	store 1,core_gpadc_cfg1
+	jam 0x77,core_gpadc_ctrl
+	jam 0x41,core_gpadc_cfg0
+	jam 0x14,0x8ac6			//div2
+	jam 0x00,core_gpadc_cfg3
+	call sadc_channel
+	fetch 1,mem_adc_clkdiv
+	store 1,core_sadc_clkdiv
+	call sadc_read
+
+	jam 0x00,core_sadc_clkdiv
+	jam 0x00,0x8ac6
+	rtn
+
+p_enable_adc_reference_source_inter1p8V_vdcdc:
+	call p_sadc_cal_write
+	fetch 1,core_gpadc_cfg1
+	set0 7,pdata
+	store 1,core_gpadc_cfg1
+	jam 0x77,core_gpadc_ctrl
+	jam 0x41,core_gpadc_cfg0
+	jam 0x10,0x8ac6			//not div2
+	jam 0x00,core_gpadc_cfg3
+	call sadc_channel
+	fetch 1,mem_adc_clkdiv
+	store 1,core_sadc_clkdiv
+	call  sadc_read
+
+	jam 0x00,core_sadc_clkdiv
+	jam 0x00,0x8ac6
+	rtn
+
+endif
+
+endif
Index: sched/shutter.dat
===================================================================
--- /1121s/branch/shutter/branch/shutter/jxy_project/yc1386s_jxy_114_new/sched/shutter.dat	(revision 5827)
+++ /1121s/branch/shutter/branch/shutter/jxy_project/yc1386s_jxy_114_new/sched/shutter.dat	(working copy)
@@ -15,15 +15,11 @@
 
 mem_shutter_dy_conf:00
 
-# mem_shutter_adc_read_time_init:05
-# mem_shutter_lowpower_gpio:11
-# mem_shutter_lowpower_time:05
-# mem_shutter_vdd_calculate_set:
-# e4 0c	#mem_shutter_vdd_full_vol 3.3v*1000
-# d0 07	#mem_shutter_vdd_empty_vol 2.3v*1000
-# bf 09	#mem_shutter_vdd_low_vol 2.5v*1000
-
-
+mem_shutter_adc_read_time_init:05
+mem_shutter_vdd_calculate_set:
+68 10	#mem_shutter_vdd_full_vol 4.2v*1000
+b8 0b	#mem_shutter_vdd_empty_vol 3.0v*1000
+e4 0c	#mem_shutter_vdd_low_vol 3.3v*1000
 mem_shutter_discovery_time_conf:
 68 17 #discovery_timeout 这里的时间是1770减去回连8s所消耗的时间，也就是未连接的总时间
 70 17 #connect_timeout
