Ejemplo n.º 1
0
void SetAutoPwrONdata(void)
{

	MYTIME currTime;
	MYTIME incTime;
	MYTIME ResultTime;
	DTGetRTCTime(&currTime);
	memset(&incTime, 0, sizeof(incTime));
	incTime.nMin= 1;
	incTime.nSec= 20;
	ResultTime = IncrementTime(currTime,incTime);
		/* fill the SPOFList structure depending on the selected values */
		g_spof_cntx.SPOFList[0].Status = SPOF_ENABLE;
		g_spof_cntx.SPOFList[0].Type = SPOF_POWERON;
		g_spof_cntx.SPOFList[0].Hour = ResultTime.nHour;
		g_spof_cntx.SPOFList[0].Min = ResultTime.nMin;

		/*save the alarm in the nvram*/
		SpofWritetoNvram();

		AlmCancelAlarm((U8)(ALM_SPOF_START));
		AlmSetAlarm((U8)(ALM_SPON_START));


}
Ejemplo n.º 2
0
void SFSystem_GetCurrentDataTime(SFDateTime*pDataTime)
{
	MYTIME mt;
	DTGetRTCTime(&mt);
	pDataTime->nYear=(U16)mt.nYear;
	pDataTime->nMonth=(U8)mt.nMonth;
	pDataTime->nDay=(U8)mt.nDay;
	pDataTime->nHour=(U8)mt.nHour;
	pDataTime->nMinute=(U8)mt.nMin;
	pDataTime->nSecond=(U8)mt.nSec;
	kal_get_time(&pDataTime->nMill);
}