Index: src/HalAdc/halAdc.c
===================================================================
--- /YC3121_SDK/fw/hal/jinghongling/src/HalAdc/halAdc.c	(revision 744)
+++ /YC3121_SDK/fw/hal/jinghongling/src/HalAdc/halAdc.c	(working copy)
@@ -37,7 +37,6 @@
 	ADCInitStruct.ADC_Mode = ADC_HVIN;
 //    halPrintf("ADC_Channel = %d \n",ADCInitStruct.ADC_Channel);
 //    halPrintf("ADC_Mode = %d \n",ADCInitStruct.ADC_Mode);
-    halPrintf("ADC_Init\n");
 	ADC_Init(&ADCInitStruct);
 }
 
@@ -97,7 +96,9 @@
 *******************************************************************************/
 s32 halAdcStart(void)
 {
-	ADC_ENBLE |= 1<<3;
+#if (VERSIONS == NO_BT)
+    ADC_ENBLE = 0x7c;
+#endif
 	return HAL_OK;
 }
 
@@ -215,31 +216,57 @@
 --------------------------------------------------------------------------------
 修改信息: 2019.12.12    jqdeng    创建
 *******************************************************************************/
-u8 halChargeState(void)
-{
-    u8 ucState = HAL_CHARGE_NULL;
-
-    ucState = CHARGE_State();
+ s32 halAdcGetData(E_ADC_MODE eMode, u16 *punValue)
+ {
+	 uint32_t MODE = eMode;
+	 uint16_t Battery = 0;
+	 u8 ucState = HAL_CHARGE_NULL;
+	 switch(MODE)
+	 {
+		 case ADC_BATTERY_VAL:
+					halAdcPhaseSelectt(ADC_PHASE_2, ADC_CH_0);				
+					delay_ms(500);
+					Battery = ADC_GetVoltage(ADC_CHANNEL_0);
+		      return Battery;
+		 case ADC_CHRG_STATUS:
+			    ucState = CHARGE_State();
     switch (ucState)
     {
         case CHARG_CUTOFF:
             ucState = HAL_CHARGE_FULL;
+				return ucState;
             break;
         case CHARG_ACTIVE:
             ucState = HAL_CHARGE_ING;
+				return ucState;				
             break;
         case CHARG_INACTIVE:
             ucState = HAL_CHARGE_NULL;
+				return ucState;
             break;
         default:
             ucState = HAL_CHARGE_NULL;
             break;
     }
-
-    return ucState;
+		break;
+		case ADC_PRN_TEMPERATURE:
+				halAdcPhaseSelectt(ADC_PHASE_0, ADC_CH_1);
+		break;
+		case ADC_TP_INT:
+				halAdcPhaseSelectt(ADC_PHASE_0, ADC_CH_2);
+		break;
+		case ADC_PRN_CHECK_PAPER:
+				halAdcPhaseSelectt(ADC_PHASE_0, ADC_CH_3);
+		break;
+		default:
+			break;
+	 }
+ }
+s32 halAdcReset(void)
+{
+	 return HAL_ERROR;
 }
 
-
 //#############################################################################
 //############################################################## 测试函数
 
@@ -266,7 +293,7 @@
         {
             //halPrintf("get adcData failed\n");
         }
-        halMsDelay(500);
+        delay_ms (500);
     }
 }
 
Index: src/HalApp/main.c
===================================================================
--- /YC3121_SDK/fw/hal/jinghongling/src/HalApp/main.c	(revision 745)
+++ /YC3121_SDK/fw/hal/jinghongling/src/HalApp/main.c	(working copy)
@@ -59,23 +59,38 @@
   	UART_Init(UARTx, &UART_InitStruct);
 }
 
+//  SEC Isr
+#if 0
 void NVIC_Configuration(void)
 {
 	NVIC_EnableIRQ(SEC_IRQn);
 	NVIC_SetPriority(SEC_IRQn, 0);
 }
+#endif 
+
+//WDT Isr
+#if 0  
+void NVIC_Configuration(void)
+{
+	NVIC_EnableIRQ(WDT_IRQn);
+	NVIC_SetPriority(WDT_IRQn, 0);
+}
+
+#endif 
 int main(void)
 {
   u32 i = 0;
 	halSysClkInit();//1ms
 	SYSCTRL_AHBPeriphClockCmd(SYSCTRL_AHBPeriph_UART,ENABLE);
-	NVIC_Configuration();
+//	NVIC_Configuration();
 	printf_uart_init(UART0);
 	//testUart();
   //halUsbInit(0);
 	//testTrng();	
-	testRtc();
+	//testRtc();
 	//testEncrypt();
+	//testCommon();
+	testBt_jhl();
 	while (1)
 	{
 		//MyPrintf("-------< YC3121_HAL_V0.028>------ \n");
@@ -110,3 +125,18 @@
 	rtcIrqHandler();
 }
 
+void WDT_IRQHandler(void)
+{
+    //halPrintf("WDT_IRQHandler\n");
+	  MyPrintf("WDT_IRQHandler\n");
+		WDT_ClearITPendingBit();
+}
+
+//void BT_IRQHandler(void)
+//{
+//    MyPrintf("BT_IRQHandler\n");
+//		// 清中断
+//		BT_CONFIG &= (~(1<<BT_INIT_FLAG));
+//    //btIntIsr();
+//}
+
Index: src/HalCommon/halCommon.c
===================================================================
--- /YC3121_SDK/fw/hal/jinghongling/src/HalCommon/halCommon.c	(revision 744)
+++ /YC3121_SDK/fw/hal/jinghongling/src/HalCommon/halCommon.c	(working copy)
@@ -15,7 +15,11 @@
 #include "halCommon.h"
 #include "halUart.h"
 #include "yc3121.h"
-
+#include "yc_timer.h"
+#include "yc_sysctrl.h"
+#include "yc_otp.h"
+#include "yc_systick.h"
+#include "yc_wdt.h"
 //#############################################################################
 //############################################################## 外部函数
 
@@ -111,11 +115,11 @@
 *******************************************************************************/
 void halMsDelay(u32 uiMs)
 {
-#if 1
+#if 0
     u32 uiCurTick = halGetSysTick();
     while((halGetSysTick()-uiCurTick) < uiMs);
 #else
-	delay_us(uiMs*1000);
+	delay_ms(uiMs);
 #endif
 }
 
@@ -146,8 +150,11 @@
 *******************************************************************************/
 void halClkCoreFreqSet(u32 uiFreq)
 {
-	u32 HCLK_Div = (CRYSTAL_CLK)/ uiFreq-2;
-	SYSCTRL_HCLKConfig(HCLK_Div);
+	//u32 HCLK_Div = (CRYSTAL_CLK)/ uiFreq-2;
+	if((uiFreq == SYSCTRL_HCLK_Div_None) ||(uiFreq==SYSCTRL_HCLK_Div2)||(uiFreq ==SYSCTRL_HCLK_Div4)||(uiFreq ==SYSCTRL_HCLK_Div8 ))
+	{
+		SYSCTRL_HCLKConfig(uiFreq);
+	}
 }
 
 /*******************************************************************************
@@ -230,6 +237,22 @@
 }
 
 /*******************************************************************************
+函数功能: 清除待处理中断
+输入参数: uiID 
+输出参数: None
+返回值  : None
+--------------------------------------------------------------------------------
+备注    :
+--------------------------------------------------------------------------------
+修改信息: 2019.11.19 jqdeng 创建
+*******************************************************************************/
+void halClearPendingIrq(u32 uiID)
+{
+		/////////////////////////////
+		/////////////////////////////
+}
+
+/*******************************************************************************
 函数功能: 检测开机键是否按下
 输入参数: 无
 输出参数: 无
@@ -363,6 +386,29 @@
     }
 }
 
+s32 halWdtOpen(u32 uiLoadVal)
+{
+	WDT_SetReload(uiLoadVal);
+	WDT_ModeConfig(WDT_Interrupt);
+	WDT_Enable();
+	return HAL_OK;
+}
+s32 halWdtIsr(void)
+{
+	WDT_ModeConfig(WDT_Interrupt);
+	return HAL_OK;
+}
+s32 halWdtClose(void)
+{
+	 WD_CONFIG &= 0xBF;
+	 return  HAL_OK;
+}
+s32 halWdtFeed(u32 uiLoadVal)
+{
+	WDT_SetReload(uiLoadVal);
+	return HAL_OK;
+}
+
 //#############################################################################
 //############################################################## 测试函数
 
@@ -372,29 +418,32 @@
     u8 ucucMcdID[32] = {0};
 
     halPrintf("<testCommon start>\n");
-
+		 MyPrintf("<testCommon start>\n");
     // get mcu id
 #if 0
     halGetMcuID(ucucMcdID);
     halPrintfWithTitle(ucucMcdID, 32, "ucucMcdID:");
+		 printv(ucucMcdID, 32, "ucucMcdID:");
 #endif
 
     // pwr control
-#if 1
+#if 0
     while (1)
     {
-        halMsDelay(800);
-        if (HAL_ON == halGetPwrKeyState())
+        //halMsDelay(800);
+        halUsDelay(800000);
+				if (HAL_ON == halGetPwrKeyState())
         {
-            halPrintf("pwr key pressed\n");
+            MyPrintf("pwr key pressed\n");
             //break;
         }
         else
         {
-            halPrintf("pwr key unpressed\n");
+            MyPrintf("pwr key unpressed\n");
         }
     }
-    halPrintf(">>> halSysReset\n");
+		MyPrintf(">>> halSysReset\n");
+    //halPrintf(">>> halSysReset\n");
     halSysReset();
     while (1);
 
@@ -409,7 +458,24 @@
     }
     */
 #endif
+		
+		//WDT  
+#if 1
+   // u32 i = 15;
+		halWdtOpen(15);
+		halWdtIsr();
+	//	MyPrintf("<testCommon start>\n");
+		while(1)
+		{
+			/* 验证中断时屏蔽喂狗函数*/		
+			WDT_ReloadCounter();
+		}
 
-    halPrintf("<testCommon end>\n");
+#endif
+    MyPrintf("<testCommon end>\n");
 }
 
+
+
+
+
Index: src/HalRtc/halRtc.c
===================================================================
--- /YC3121_SDK/fw/hal/jinghongling/src/HalRtc/halRtc.c	(revision 745)
+++ /YC3121_SDK/fw/hal/jinghongling/src/HalRtc/halRtc.c	(working copy)
@@ -65,6 +65,37 @@
 		cTimeStr[3] = pTime->tm_hour;
 		cTimeStr[4] = pTime->tm_min;
 		cTimeStr[5] = pTime->tm_sec; 
+	
+		//计算星期几
+		u8 iWeekDay = -1;
+		u8 iM = cTimeStr[1];
+		u8 iY = cTimeStr[0]+2000;
+		u8 iD = 	cTimeStr[2];
+		if(iM == 1 || iM == 2)
+		{
+				iM += 12;
+				iY--;				
+		}
+		iWeekDay = (iD + 2 + 2 * iM + 3 * (iM + 1) / 5 + iY + iY / 4 - iY / 100 + iY / 400) % 7;
+		switch(iWeekDay)
+    {   
+        case 0 :  MyPrintf("Sunday\n");  
+							break;
+        case 1 : 	MyPrintf("Monday\n");
+							break;
+        case 2 :  MyPrintf("Tuesday\n");
+							break;
+        case 3 :  MyPrintf("Wednesday\n");
+							break;
+        case 4 :  MyPrintf("Thursday\n");
+							break;
+        case 5 :  MyPrintf("Friday\n");
+							break;                                                             
+        case 6 :  MyPrintf("Saturday\n");
+							break;
+        default : 
+							return HAL_RTC_FAILED; 
+    }  
 		return HAL_RTC_OK ;
 }
 void halRtcAlarmClose(void)
@@ -136,7 +167,7 @@
 {
 	u8 ucMIN = 0;
 	u8 ucSEC = 10;
-	s8 cTimeStr[6] = {20,1,1,1,1,0};   //年，月，日，时，分，秒
+	s8 cTimeStr[6] = {20,10,8,23,59,40};   //年，月，日，时，分，秒
 	RTC_Get_SexMax();
 	RTC_Calibration();
 	RTC_SetRefRegister(0);
