/* SD_Detection checks detection and writes msg on display.  */
void SD_Detection(void)
/* SD_Detection checks detection and writes msg on display.  */
void SD_Detection(void)
{
  static uint8_t prev_status = 2;
  if(BSP_SD_IsDetected() != SD_PRESENT)
  {
    if(prev_status != SD_NOT_PRESENT)
    {
      prev_status = SD_NOT_PRESENT;
      BSP_LCD_SetTextColor(LCD_COLOR_RED);
      BSP_LCD_DisplayStringAt(5, BSP_LCD_GetYSize()-15, (uint8_t *)"SD Not Connected", LEFT_MODE);
    }
  }
  else if (prev_status != SD_PRESENT)
  {
    prev_status = SD_PRESENT;
    BSP_LCD_SetTextColor(LCD_COLOR_GREEN);
    BSP_LCD_DisplayStringAt(5, BSP_LCD_GetYSize()-15, (uint8_t *)"SD Connected    ", LEFT_MODE);
  }
}