text: /**
    ******************************************************************************
    * File Name          : RTC.c
    * Description        : This file provides code for the configuration
    *                      of the RTC instances.
    ******************************************************************************
    *
    *
    ******************************************************************************
    */
  
  /* Includes ------------------------------------------------------------------*/
  #include "rtc.h"
  #include "lcd.h"
  #include "error.h"
  
  /* USER CODE BEGIN 0 */
  
  /* USER CODE END 0 */
  
  RTC_HandleTypeDef hrtc;
  
  /* RTC init function */
  void MX_RTC_Init(void)
  {
  //  RTC_TimeTypeDef sTime;
  //  RTC_DateTypeDef DateToUpdate;
  
      /**Initialize RTC and set the Time and Date 
      */
    hrtc.Instance = RTC;
    hrtc.Init.AsynchPrediv = RTC_AUTO_1_SECOND;
    hrtc.Init.OutPut = RTC_OUTPUTSOURCE_NONE;
    ErrorBuf[ERROR_RTC_INIT] = HAL_RTC_Init(&hrtc);
  
  //  sTime.Hours = 0x0;
  //  sTime.Minutes = 0x0;
  //  sTime.Seconds = 0x0;
  //
  //  HAL_RTC_SetTime(&hrtc, &sTime, FORMAT_BCD);
  
  
  }
  
  void HAL_RTC_MspInit(RTC_HandleTypeDef* hrtc)
  {
  
    if(hrtc->Instance==RTC)
    {
    /* USER CODE BEGIN RTC_MspInit 0 */
  
    /* USER CODE END RTC_MspInit 0 */
      HAL_PWR_EnableBkUpAccess();
      /* Enable BKP CLK enable for backup registers */
      __HAL_RCC_BKP_CLK_ENABLE();
      /* Peripheral clock enable */
      __HAL_RCC_RTC_ENABLE();
  		
    }
  }
  
  void HAL_RTC_MspDeInit(RTC_HandleTypeDef* hrtc)
  {
  
    if(hrtc->Instance==RTC)
    {
    /* USER CODE BEGIN RTC_MspDeInit 0 */
  
    /* USER CODE END RTC_MspDeInit 0 */
      /* Peripheral clock disable */
      __HAL_RCC_RTC_DISABLE();
    }
    /* USER CODE BEGIN RTC_MspDeInit 1 */
  
    /* USER CODE END RTC_MspDeInit 1 */
  } 
  
  /* USER CODE BEGIN 1 */
  
  /* USER CODE END 1 */
  
  /**
    * @}
    */
  
  /**
    * @}
    */
  
  /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
  