互芯平臺系統時間修改

1.tm_time.c文件

UINT32 TM_PowerOnPatch()
  if(!nTimeValidFlag)
  {
    TM_SYSTEMTIME nSystemTime;
    HAL_TIM_RTC_TIME_T RtcTime;
    nSystemTime.uSecond  = RtcTime.sec   = 0;
    nSystemTime.uMinute  = RtcTime.min   = 0;
    nSystemTime.uHour    = RtcTime.hour  = 10;
    nSystemTime.uDay     = RtcTime.day   = 1;
    nSystemTime.uMonth   = RtcTime.month = 6;
    nSystemTime.uDayOfWeek = RtcTime.wDay  = 5; // It's a Friday.
    RtcTime.year  = 12; //Change default year is 2012.
    nSystemTime.uYear = 2012;   

BOOL TM_GetSystemTime(TM_SYSTEMTIME * pSystemTime)

      pSystemTime->uSecond  = RtcTime.sec   = 0;
      pSystemTime->uMinute  = RtcTime.min   = 0;
      pSystemTime->uHour    = RtcTime.hour  = 10;
      pSystemTime->uDay     = RtcTime.day   = 1;
      pSystemTime->uMonth   = RtcTime.month = 6;
      pSystemTime->uDayOfWeek = RtcTime.wDay  = 5; // It's a Friday.
      RtcTime.year  = 12; //Change default year is 2012.
      pSystemTime->uYear = 2012;     


2.tm_alarm.c

BOOL TM_PowerOn()
    if((rtcProgram = hal_TimRtcNotProgrammed()))
    {
        // FIXME Give a default valid value to the RTC calendar: 0:0:0 - 1/1/2000
        RtcTime.sec = 0;
        RtcTime.min = 0;
        RtcTime.hour = 10;
        RtcTime.day = 1;
        RtcTime.month = 6;
        RtcTime.year = 12; //Change default year is 2012.
        RtcTime.wDay = 5; // It's a Friday.
        hal_TimRtcSetTime(&RtcTime);
        dm_SendArlarmMessage(&ev);//告訴MMI重設時間
        CSW_TRACE(DEBUG_PRINT_SWITCH,"TM_PowerOn()==SET THE TIME PLEASE==\n");
    }


發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章