• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C++ LCD_DbgLog函数代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C++中LCD_DbgLog函数的典型用法代码示例。如果您正苦于以下问题:C++ LCD_DbgLog函数的具体用法?C++ LCD_DbgLog怎么用?C++ LCD_DbgLog使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。



在下文中一共展示了LCD_DbgLog函数的19个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。

示例1: USBH_CDC_TransmitCallback

/**
  * @brief  CDC data transmit callback.
  * @param  phost: Host handle
  * @retval None
  */
void USBH_CDC_TransmitCallback(USBH_HandleTypeDef *phost)
{
   uint32_t bytesread;
  
  if(use_file == 1)
  {
    if( MyFile.fptr >= MyFile.fsize)
    {
      f_close(&MyFile);
      LCD_DbgLog (">> File sent\n" );
      use_file = 0;
    }
    else
    {
      /* Fill the buffer to Send */
      f_read(&MyFile, CDC_TX_Buffer, TX_BUFF_SIZE, (void *)&bytesread);
      /* Send File */
      USBH_CDC_Transmit(&hUSBHost, CDC_TX_Buffer, bytesread);
    }
  }
  else
  {
    LCD_DbgLog (">> Data sent\n" );
  }
}
开发者ID:EarnestHein89,项目名称:STM32Cube_FW_F4,代码行数:30,代码来源:cdc_send.c


示例2: AUDIO_ShowWavFiles

/**
  * @brief  Shows audio file (*.wav) on the root
  * @param  None
  * @retval None
  */
uint8_t AUDIO_ShowWavFiles(void)
{
  uint8_t i = 0;
  uint8_t line_idx = 0;
  if(AUDIO_StorageInit() == FR_OK)
  {
    if(AUDIO_StorageParse() ==  FR_OK)
    {
      if(FileList.ptr > 0)
      {
        BSP_LCD_SetTextColor(LCD_COLOR_WHITE);
        LCD_UsrLog("audio file(s) [ROOT]:\n\n");
        
        for(i = 0; i < FileList.ptr; i++)
        {
          line_idx++;
          LCD_DbgLog("   |__");
          LCD_DbgLog((char *)FileList.file[i].name);
          LCD_DbgLog("\n");
        }
        BSP_LCD_SetTextColor(LCD_COLOR_WHITE);
        LCD_UsrLog("\nEnd of files list.\n");
        return 0;
      }
      return 1;
    }
    return 2;
  }
  else
  {
    return 3;
  }
}
开发者ID:acrepina,项目名称:STM32F7_serverWEB,代码行数:38,代码来源:explorer.c


示例3: MSC_File_Operations

/**
  * @brief  Files operations: Read/Write and compare
  * @param  None
  * @retval None
  */
void MSC_File_Operations(void)
{
  uint16_t bytesread;
  
  LCD_UsrLog("INFO : FatFs Initialized \n");
  
  if(f_open(&MyFile, "0:USBHost.txt",FA_CREATE_ALWAYS | FA_WRITE) != FR_OK) 
  {
    LCD_ErrLog("Cannot Open 'USBHost.txt' file \n");
  }
  else
  {
    LCD_UsrLog("INFO : 'USBHost.txt' opened for write  \n");
    res= f_write (&MyFile, wtext, sizeof(wtext), (void *)&bytesWritten); 
    f_close(&MyFile);
    
    if((bytesWritten == 0) || (res != FR_OK)) /*EOF or Error*/
    {
      LCD_ErrLog("Cannot Write on the  'USBHost.txt' file \n");
    }
    else
    {
      if(f_open(&MyFile, "0:USBHost.txt", FA_READ) != FR_OK) 
      {
        LCD_ErrLog("Cannot Open 'USBHost.txt' file for read.\n"); 
      }
      else
      {
        LCD_UsrLog("INFO : Text written on the 'USBHost.txt' file \n");
        
        res = f_read(&MyFile, rtext, sizeof(rtext), (void *)&bytesread);
        
        if((bytesread == 0) || (res != FR_OK)) /*EOF or Error*/
        {
          LCD_ErrLog("Cannot Read from the  'USBHost.txt' file \n"); 
        }
        else
        {
          LCD_UsrLog("Read Text : \n"); 
          LCD_DbgLog((char *)rtext); 
          LCD_DbgLog("\n"); 
        }
        f_close(&MyFile);
      }
      /* Compare read data with the expected data */
      if((bytesread == bytesWritten))
      {
        LCD_UsrLog("INFO : FatFs data compare SUCCES");
        LCD_UsrLog("\n"); 
      }
      else
      {
        LCD_ErrLog("FatFs data compare ERROR");
        LCD_ErrLog("\n"); 
      }
    }
  }
}
开发者ID:NjordCZ,项目名称:STM32Cube_FW_F1,代码行数:63,代码来源:file_operations.c


示例4: SD_StorageInit

/**
  * @brief  Initializes the SD Storage.
  * @param  None
  * @retval Status
  */
uint8_t SD_StorageInit(void)
{
  /*Initializes the SD card device*/
  BSP_SD_Init();
  
  /* Check if the SD card is plugged in the slot */
  if(BSP_SD_IsDetected() == SD_PRESENT )
  {
    /* Link the SD Card disk I/O driver */
    if(FATFS_LinkDriver(&SD_Driver, SD_Path) == 0)
    {
      if((f_mount(&SD_FatFs, (TCHAR const*)SD_Path, 0) != FR_OK))
      {
        /* FatFs Initialization Error */
        LCD_ErrLog("Cannot Initialize FatFs! \n");
        return 1;
      }
      else
      {
        LCD_DbgLog ("INFO : FatFs Initialized! \n");
      }
    }  
  }
  else
  {
    LCD_ErrLog("SD card NOT plugged \n");
    return 1;
  }
  return 0;
}
开发者ID:eemei,项目名称:library-stm32f4,代码行数:35,代码来源:audio_explorer.c


示例5: CDC_Handle_Receive_Menu

/**
  * @brief  Handles CDC Receive Menu. 
  * @param  None
  * @retval None
  */
void CDC_Handle_Receive_Menu(void)
{
  switch(CdcDemo.Receive_state)
  {
  case CDC_RECEIVE_IDLE:
    /* Start Reception */
    LCD_LOG_ClearTextZone();
    CdcDemo.Receive_state = CDC_RECEIVE_WAIT;
    USBH_CDC_Stop(&hUSBHost);
    LCD_DbgLog("Receiving data ...\n");
    
    xPos = 0;
    yLinePos = 5;
    
    memset(CDC_RX_Buffer, 0, RX_BUFF_SIZE); 
    USBH_CDC_Receive(&hUSBHost, CDC_RX_Buffer, RX_BUFF_SIZE);
    
    BSP_LCD_ClearStringLine(19);
    BSP_LCD_SetTextColor(LCD_COLOR_GREEN);
    BSP_LCD_DisplayStringAtLine(19, (uint8_t *)"Press User button to start sending data ");
    break;
    
  case CDC_RECEIVE_WAIT:
    if((BSP_PB_GetState(BUTTON_KEY) == SET) && (Appli_state != APPLICATION_DISCONNECT))
    {
      CdcDemo.state =  CDC_DEMO_WAIT;
      CdcDemo.Receive_state = CDC_RECEIVE_IDLE;
    }
    break;
    
  default:
    break;
  }
}
开发者ID:MrZANE42,项目名称:verisure1512,代码行数:39,代码来源:cdc_receive.c


示例6: AUDIO_ShowWavFiles

/**
  * @brief  Shows audio file (*.wav) on the root
  * @param  None
  * @retval None
  */
uint8_t AUDIO_ShowWavFiles(void)
{
  uint8_t i = 0;
  uint8_t line_idx = 0;
  if(AUDIO_StorageInit() == FR_OK)
  {
    if(AUDIO_StorageParse() ==  FR_OK)
    {
      if(FileList.ptr > 0)
      {
        BSP_LCD_SetTextColor(LCD_COLOR_WHITE);
        LCD_UsrLog("audio file(s) [ROOT]:\n\n");
        
        for(i = 0; i < FileList.ptr; i++)
        {
          line_idx++;
          if(line_idx > 9)
          {
            line_idx = 0;
            LCD_UsrLog("> Press [Key] To Continue.\n");
            
            /* KEY Button in polling */
            while(BSP_PB_GetState(BUTTON_KEY) != RESET)
            {
              /* Wait for User Input */
            }
          } 
          LCD_DbgLog("   |__");
          LCD_DbgLog((char *)FileList.file[i].name);
          LCD_DbgLog("\n");
        }
        BSP_LCD_SetTextColor(LCD_COLOR_WHITE);
        LCD_UsrLog("\nEnd of files list.\n");
        return 0;
      }
      return 1;
    }
    return 2;
  }
  else
  {
    return 3;
  }
}
开发者ID:nidhiyanandh,项目名称:STM32Cube_FW_F4_V1.5.0_GCC_Makefile,代码行数:49,代码来源:explorer.c


示例7: Audio_ShowWavFiles

/**
  * @brief  Shows audio file (*.wav) on the root
  * @param  None
  * @retval None
  */
static uint8_t Audio_ShowWavFiles(void)
{
  uint8_t i;
  uint8_t line_idx = 0;

  if((FileList.ptr > 0) && (BSP_SD_IsDetected()))
  {
    BSP_LCD_SetTextColor(LCD_COLOR_WHITE);
    LCD_UsrLog("audio file(s) [ROOT]:\n\n");

    for( i = 0; i < FileList.ptr; i++)
    {
      line_idx++;
      if(line_idx > 9)
      {
        line_idx = 0;
        LCD_UsrLog("> Press [Key] To Continue.\n");
        
        /* KEY Button in polling */
        while(BSP_PB_GetState(BUTTON_KEY) != RESET)
        {
          /* Wait for User Input */
        }
      } 
      LCD_DbgLog("   |__");
      LCD_DbgLog((char *)FileList.file[i].name);
      LCD_DbgLog("\n");
    }
    BSP_LCD_SetTextColor(LCD_COLOR_WHITE);
    LCD_UsrLog("\nEnd of files list.\n");
    return 0;
  }
  else
  {
    return 1;
  }
}
开发者ID:ClintHaerinck,项目名称:STM32Cube_FW_F4,代码行数:42,代码来源:audio_menu.c


示例8: AUDIO_StorageInit

/**
  * @brief  Initializes the USB KEY Storage.
  * @param  None
  * @retval Status
  */
uint8_t AUDIO_StorageInit(void)
{
  /* Link the USB Key disk I/O driver */
  if((f_mount(&USBH_FatFs, (TCHAR const*)USBKey_Path, 0) != FR_OK))
  {
    /* FatFs Initialization Error */
    LCD_ErrLog("Cannot Initialize FatFs! \n");
    return 1;
  }
  else
  {
    LCD_DbgLog ("INFO : FatFs Initialized! \n");
    return 0;
  }
}
开发者ID:acrepina,项目名称:STM32F7_serverWEB,代码行数:20,代码来源:explorer.c


示例9: USR_MOUSE_ProcessData

/**
* @brief  USR_MOUSE_ProcessData
*         Process Mouse data
* @param  data : Mouse data to be displayed
* @retval None
*/
void USR_MOUSE_ProcessData(HID_MOUSE_Data_TypeDef *data)
{
  
  uint8_t idx = 1;   
  static uint8_t b_state[3] = { 0, 0 , 0};
  char temp[20];

  if(DEMO_HID_ShowData == 0)
  {  
  if ((data->x != 0) && (data->y != 0))
  {
    HID_MOUSE_UpdatePosition(data->x , data->y);
  }
  
  for ( idx = 0 ; idx < 3 ; idx ++)
  {
    
    if(data->button & 1 << idx) 
    {
      if(b_state[idx] == 0)
      {
        HID_MOUSE_ButtonPressed (idx);
        b_state[idx] = 1;
      }
    }
    else
    {
      if(b_state[idx] == 1)
      {
        HID_MOUSE_ButtonReleased (idx);
        b_state[idx] = 0;
      }
    }
  }
  }
  else
  {
    sprintf(temp ,"> %02xh %02xh %02xh %02xh\n" , HID_Machine.buff[0],  
                                         HID_Machine.buff[1],  
                                         HID_Machine.buff[2],  
                                         HID_Machine.buff[3]);
    LCD_DbgLog(temp);
    
  }
  
  
}
开发者ID:Ghanyy,项目名称:PTM-STM32F4,代码行数:53,代码来源:usbh_hid_usr.c


示例10: MTP_ExploreWavFile

/**
  * @brief  Explores Wav Files. 
  * @param  None
  * @retval Returns 0 if OK, otherwise 1.
  */
uint8_t MTP_ExploreWavFile(void)
{
  uint8_t ret = 1;
  uint32_t index;
  MTP_ObjectInfoTypedef objectinfo;
  
  MTP_Init();
  
  if(USBH_MTP_IsReady(&hUSBHost) > 0)
  {
    LCD_UsrLog("\nAvailable wav files:\n");
 
    /* Get Available WAV files number */
    if((NumObs = MTP_GetWavObjectNumber()) > 0)
    {
      /* Get objects handlers */
      if(MTP_GetWavObjectHandles() == 0)
      {
        ret = 0; 
        
        for (index = 0; index < NumObs; index ++)
        {
          if( USBH_MTP_GetObjectInfo (&hUSBHost, 
                                      WavHandles.Handler[index], 
                                      &objectinfo) == USBH_OK)
            
          {
            LCD_DbgLog(" %lu- %s\n", index, objectinfo.Filename);
          }
          else
          {
            ret = 1; 
          }
        }
      }
    }
  }
  else
  {
    LCD_ErrLog("MTP Device Not yet ready...\n");
  }
  
  return ret;
}
开发者ID:z80,项目名称:stm32f429,代码行数:49,代码来源:mtp.c


示例11: CDC_Handle_Send_Menu

/**
  * @brief  Handles CDC Send Menu. 
  * @param  None
  * @retval None
*/
void CDC_Handle_Send_Menu(void)
{
  switch(CdcDemo.Send_state)
  {
  case CDC_SEND_IDLE:
    CdcDemo.Send_state = CDC_SEND_WAIT;
    CDC_SendState = 0;
    USBH_CDC_Stop(&hUSBHost);
    memset(CDC_TX_Buffer, 0x5A, TX_BUFF_SIZE);
    LCD_LOG_ClearTextZone();
    LCD_DbgLog("Sending data ...\n"); 
    USBH_CDC_Transmit(&hUSBHost, CDC_TX_Buffer, TX_BUFF_SIZE);
    break;
  
  case CDC_SEND_WAIT:
    if(CDC_SendState == 1) /* Data sent */
    {
      BSP_LCD_ClearStringLine(19);
      BSP_LCD_SetTextColor(LCD_COLOR_GREEN);
      BSP_LCD_DisplayStringAtLine(19, (uint8_t *)"Press User button to start receiving data ");
      
      /* Wait for User Input */
      while((BSP_PB_GetState(BUTTON_KEY) != SET) && (Appli_state != APPLICATION_DISCONNECT))
      {
      }
      HAL_Delay(400);
      
      CdcDemo.state = CDC_DEMO_RECEIVE;
      CdcDemo.Send_state = CDC_SEND_IDLE;
    }
    break;
    
  default:
    break;
  }
}
开发者ID:MrZANE42,项目名称:verisure1512,代码行数:41,代码来源:cdc_send.c


示例12: CDC_Handle_Send_Menu

/**
  * @brief  Handles CDC Send Menu. 
  * @param  None
  * @retval None
  */
void CDC_Handle_Send_Menu(void)
{ 
  if(CdcSelectMode == CDC_SELECT_MENU)
  {
    switch(CdcDemo.Send_state)
    {
    case CDC_SEND_IDLE:
      CdcDemo.Send_state = CDC_SEND_WAIT;
      CDC_SelectItem (DEMO_SEND_menu, 0);
      CdcDemo.select = 0; 

      PrevPos = 0;
      USBH_CDC_Stop(&hUSBHost);
      break;
      
    case CDC_SEND_WAIT:
      if(CdcDemo.select != PrevSelect)
      {
        PrevSelect = CdcDemo.select;
        CDC_SelectItem (DEMO_SEND_menu, CdcDemo.select & 0x7F);
        
        /* Handle select item */
        if(CdcDemo.select & 0x80)
        {
          switch(CdcDemo.select & 0x7F)
          {
          case 0:
            memset(CDC_TX_Buffer, 0x5A, TX_BUFF_SIZE);
            LCD_DbgLog("Sending data ...\n"); 
            USBH_CDC_Transmit(&hUSBHost, CDC_TX_Buffer, TX_BUFF_SIZE);
            use_file = 0;
            break;
            
          case 1:
            if(FileList.ptr > 0)
            {
              SendFileMenu_Init();
              if(FilePos >= 9)
              {
                CDC_ShowFiles(FileOffset, 9);
              }
              
              else
              {
                CDC_ShowFiles(FileOffset, FilePos);
              }
              CdcDemo.Send_state = CDC_SEND_SELECT_FILE;
            }
            else
            {
             LCD_ErrLog("No file on the microSD\n"); 
            }
            break;
            
          case 2: /* Return */
            ReturnFromSendMenu();
            break;
          default:
            break;
          }
        }
      }
      break; 

    default:
      break;
    }
  }
  else if(CdcSelectMode == CDC_SELECT_FILE)
  {
    switch(CdcDemo.Send_state)
    {
    case  CDC_SEND_SELECT_FILE: 
      if(CdcDemo.select & 0x80)
      {
        CdcDemo.select &= 0x7F;
        CdcDemo.Send_state = CDC_SEND_TRANSMIT_FILE;        
      }
      break;
      
    case CDC_SEND_TRANSMIT_FILE: 
      LCD_DbgLog("Sending file ...\n"); 
      use_file = 1;
      CDC_SendFile(FilePos);
      CDC_ChangeSelectMode(CDC_SELECT_MENU);
      LCD_LOG_UpdateDisplay();
      CdcDemo.Send_state = CDC_SEND_WAIT;
      break;
      
    default:
      break;      
    }
    
    if(FilePos != PrevPos)
    {
//.........这里部分代码省略.........
开发者ID:EarnestHein89,项目名称:STM32Cube_FW_F4,代码行数:101,代码来源:cdc_send.c


示例13: USBH_CDC_TransmitCallback

/**
  * @brief  CDC data transmit callback.
  * @param  phost: Host handle
  * @retval None
  */
void USBH_CDC_TransmitCallback(USBH_HandleTypeDef *phost)
{
  LCD_DbgLog (">> Data sent\n" );
  CDC_SendState = 1;
}
开发者ID:MrZANE42,项目名称:verisure1512,代码行数:10,代码来源:cdc_send.c


示例14: USBH_CDC_LineCodingChanged

/**
  * @brief  Informs user that Settings have been changed.
  * @param  phost: Host handle
  * @retval None
  */
void USBH_CDC_LineCodingChanged(USBH_HandleTypeDef *phost)
{
  LCD_DbgLog("New CDC Settings applied!\n"); 
}
开发者ID:451506709,项目名称:automated_machine,代码行数:9,代码来源:cdc_configuration.c


示例15: DUAL_MenuProcess

/**
  * @brief  Manages DUAL Menu Process.
  * @param  None
  * @retval None
  */
void DUAL_MenuProcess(void)
{
  switch(demo.state)
  {
  case DEMO_IDLE:
    Demo_SelectItem(DEMO_main_menu, 0); 
    LCD_UsrLog("Select an operation to continue.\n");
    demo.state = DEMO_WAIT;
    demo.select = 0;
    break;    
  case DEMO_WAIT:
    
    if(demo.select != prev_select)
    {
      prev_select = demo.select;
      Demo_SelectItem(DEMO_main_menu, demo.select & 0x7F);
      
      /* Handle select item */
      if(demo.select & 0x80)
      {
        demo.select &= 0x7F;
        
        switch(demo.select)
        {
        case 0:
          demo.state = DEMO_MSC_START;  
          break;
          
        case 1:
          demo.state = DEMO_HID_START;  
          break;
          
        case 2:
          demo.state = DEMO_MSC_REENUMERATE;
          break;
          
        case 3:
          demo.state = DEMO_HID_REENUMERATE;
          break;
          
        default:
          break;
        }
      }
    }
    break;
    
  case DEMO_MSC_START:
    if(Appli_HS_state == APPLICATION_HS_READY) 
    {
      /* If HS device connected*/
      demo.state = DEMO_MSC; 
      demo.msc_state = APPLI_MSC_IDLE;
    }
    else
    {
      LCD_ErrLog("No Mass storage device connected.\n");
      demo.state = DEMO_WAIT; 
    }
    break;
    
  case DEMO_HID_START:
    if(Appli_FS_state == APPLICATION_FS_READY)
    {
      /*if FS device connected*/
      demo.state = DEMO_HID; 
      demo.hid_state = APPLI_HID_IDLE;
    }
    else
    {
      LCD_ErrLog("No HID device connected.\n");
      demo.state = DEMO_WAIT; 
    }
    break;
    
  case DEMO_MSC: 
    MSC_MenuProcess();
    break;
    
  case DEMO_HID:
    HID_MenuProcess();
    break;
    
  case DEMO_MSC_REENUMERATE: /* Re-Enumeration MSC */
    LCD_DbgLog("Starting Enumeration MSC...."); 
    LCD_DbgLog("\n");
    USBH_ReEnumerate(&hUSBHost_HS); 
    demo.state = DEMO_WAIT;
    break;
    
  case DEMO_HID_REENUMERATE: /* Re-Enumeration HID */
    LCD_DbgLog("Starting Enumeration HID...."); 
    LCD_DbgLog("\n");
    USBH_ReEnumerate(&hUSBHost_FS);
    demo.state = DEMO_WAIT;
//.........这里部分代码省略.........
开发者ID:PaxInstruments,项目名称:STM32CubeF4,代码行数:101,代码来源:dual_menu.c


示例16: USR_KEYBRD_ProcessData

/**
* @brief  USR_KEYBRD_ProcessData
*         Process Keyboard data
* @param  data : Keyboard data to be displayed
* @retval None
*/
void  USR_KEYBRD_ProcessData (uint8_t data)
{
 
  char temp[20];
    
  if(DEMO_HID_ShowData == 0)
  {
  LCD_SetTextColor(LCD_COLOR_GREEN);
  
  if(data == '\n')
  {
    

    Ypos = KYBRD_FIRST_COLUMN;
    
    /*Increment char X position*/
    Xpos+=SMALL_FONT_LINE_WIDTH;
    
  }
  else if (data == '\r')
  {
    /* Manage deletion of character and update cursor location*/
    if( Ypos == KYBRD_FIRST_COLUMN) 
    {
      /*First character of first line to be deleted*/
      if(Xpos == KYBRD_FIRST_LINE)
      {  
        Ypos =KYBRD_FIRST_COLUMN; 
      }
      else
      {
        Xpos-=SMALL_FONT_LINE_WIDTH;
        Ypos =(KYBRD_LAST_COLUMN+SMALL_FONT_COLUMN_WIDTH); 
      }
    }
    else
    {
      Ypos +=SMALL_FONT_COLUMN_WIDTH;                  
      
    } 
    LCD_DisplayChar(Xpos,Ypos, ' '); 
  }
  else
  {
    LCD_DisplayChar(Xpos,Ypos, data);    
    /* Update the cursor position on LCD */
    
    /*Increment char Y position*/
    Ypos -=SMALL_FONT_COLUMN_WIDTH;
    
    /*Check if the Y position has reached the last column*/
    if(Ypos == KYBRD_LAST_COLUMN)
    {
      
      Ypos = KYBRD_FIRST_COLUMN;
      
      /*Increment char X position*/
      
      
      Xpos+=SMALL_FONT_LINE_WIDTH;
      
            
      if( Xpos > KYBRD_LAST_LINE) 
      {
        Xpos =KYBRD_FIRST_LINE;
      }
      
    }
  }
  }
  else
  {
    sprintf(temp ,"> %02xh %02xh %02xh %02xh\n" , HID_Machine.buff[0],  
                                         HID_Machine.buff[1],  
                                         HID_Machine.buff[2],  
                                         HID_Machine.buff[3]);
    LCD_DbgLog(temp);
  }
}
开发者ID:Ghanyy,项目名称:PTM-STM32F4,代码行数:85,代码来源:usbh_hid_usr.c


示例17: Explore_Disk

/**
  * @brief  Displays disk content
  * @param  path: pointer to root path
  * @param  recu_level: explorer level
  * @retval None
  */
static uint8_t Explore_Disk(char* path , uint8_t recu_level)
{
  FRESULT res;
  FILINFO fno;
  DIR dir;
  char *fn;
  char tmp[14];
  
  res = f_opendir(&dir, path);
  
  if (res == FR_OK) 
  {
    /* USER Button in polling */
    LCD_UsrLog("To see the disk root content:\n" );
    LCD_UsrLog("Press Key...\n");
    while((BSP_PB_GetState (BUTTON_KEY) != SET))          
    {
      Toggle_Leds();
    }
    while((BSP_PB_GetState (BUTTON_KEY) != RESET))          
    {
      Toggle_Leds();
    }
    while(Appli_state == APPLICATION_START) 
    {
      res = f_readdir(&dir, &fno);
      if (res != FR_OK || fno.fname[0] == 0) 
      {
        break;
      }
      if (fno.fname[0] == '.')
      {
        continue;
      }
      
      fn = fno.fname;
      strcpy(tmp, fn); 
      
      line_idx++;
      if(line_idx > 12)
      {
        line_idx = 0;
        LCD_UsrLog("Press Key to continue...\n");
        
        /* USER Button in polling */
        while((Appli_state == APPLICATION_START) && \
          (BSP_PB_GetState (BUTTON_KEY) != SET))
        {
          Toggle_Leds();
        }
      } 
      if(recu_level == 1)
      {
        LCD_DbgLog("   |__");
      }
      else if(recu_level == 2)
      {
        LCD_DbgLog("   |   |__");
      }
      if((fno.fattrib & AM_MASK) == AM_DIR)
      {
        strcat(tmp, "\n"); 
        LCD_UsrLog((void *)tmp);
      }
      else
      {
        strcat(tmp, "\n"); 
        LCD_DbgLog((void *)tmp);
      }
      
      if(((fno.fattrib & AM_MASK) == AM_DIR)&&(recu_level == 1))
      {
        Explore_Disk(fn, 2);
      }
    }
  }
  f_closedir(&dir);
  return res;
}
开发者ID:eemei,项目名称:library-stm32f4,代码行数:85,代码来源:main.c


示例18: Explore_Disk

/**
  * @brief  Displays disk content.
  * @param  path: Pointer to root path
  * @param  recu_level: Disk content level 
  * @retval Operation result
  */
FRESULT Explore_Disk(char *path, uint8_t recu_level)
{
  FRESULT res = FR_OK;
  FILINFO fno;
  DIR dir;
  char *fn;
  char tmp[14];
  uint8_t line_idx = 0;
  
#if _USE_LFN
  static char lfn[_MAX_LFN + 1];   /* Buffer to store the LFN */
  fno.lfname = lfn;
  fno.lfsize = sizeof lfn;
#endif
  
  res = f_opendir(&dir, path);
  if(res == FR_OK) 
  {
    while(USBH_MSC_IsReady(&hUSBHost))
    {
      res = f_readdir(&dir, &fno);
      if(res != FR_OK || fno.fname[0] == 0) 
      {
        break;
      }
      if(fno.fname[0] == '.')
      {
        continue;
      }
      
#if _USE_LFN
      fn = *fno.lfname ? fno.lfname : fno.fname;
#else
      fn = fno.fname;
#endif
      strcpy(tmp, fn); 
      
      line_idx++;
      if(line_idx > 9)
      {
        line_idx = 0;
        LCD_UsrLog("> Press [Key] To Continue.\n");
        
        /* KEY Button in polling */
        while(BSP_PB_GetState(BUTTON_KEY) != RESET)
        {
          /* Wait for User Input */
        }
      } 
      
      if(recu_level == 1)
      {
        LCD_DbgLog("   |__");
      }
      else if(recu_level == 2)
      {
        LCD_DbgLog("   |   |__");
      }
      if((fno.fattrib & AM_MASK) == AM_DIR)
      {
        strcat(tmp, "\n"); 
        LCD_UsrLog((void *)tmp);
        Explore_Disk(fn, 2);
      }
      else
      {
        strcat(tmp, "\n"); 
        LCD_DbgLog((void *)tmp);
      }
      
      if(((fno.fattrib & AM_MASK) == AM_DIR)&&(recu_level == 2))
      {
        Explore_Disk(fn, 2);
      }
    }
    f_closedir(&dir);
	LCD_UsrLog("> Select an operation to Continue.\n" );
  }
  return res;
}
开发者ID:Lembed,项目名称:STM32CubeF1-mirrors,代码行数:86,代码来源:explorer.c


示例19: Explore_Disk

/**
* @brief  Explore_Disk 
*         Displays disk content
* @param  path: pointer to root path
* @retval None
*/
static uint8_t Explore_Disk (char* path , uint8_t recu_level)
{

  FRESULT res;
  FILINFO fno;
  DIR dir;
  char *fn;
  char tmp[14];
  
  res = f_opendir(&dir, path);
  if (res == FR_OK) {
    while(HCD_IsDeviceConnected(&USB_OTG_Core)) 
    {
      res = f_readdir(&dir, &fno);
      if (res != FR_OK || fno.fname[0] == 0) 
      {
        break;
      }
      if (fno.fname[0] == '.') {
        continue;
      }

      fn = fno.fname;
      strcpy(tmp, fn); 

      line_idx++;
      if (line_idx > 9) {
        line_idx = 0;
        LCD_SetTextColor(Green);
        LCD_DisplayStringLine( LCD_PIXEL_HEIGHT - 42, "                                              ");
        LCD_DisplayStringLine( LCD_PIXEL_HEIGHT - 30, "Press Key to continue...");
        LCD_SetTextColor(LCD_LOG_DEFAULT_COLOR); 
        
        /*Key B3 in polling*/
        while((HCD_IsDeviceConnected(&USB_OTG_Core)) && \
          (STM_EVAL_PBGetState (BUTTON_USER) == RESET)) {
          Toggle_Leds();
          
        }
      } 
      
      if (recu_level == 1) {
        LCD_DbgLog("   |__");
      } else if(recu_level == 2) {
        LCD_DbgLog("   |   |__");
      }
      if ((fno.fattrib & AM_MASK) == AM_DIR) {
        strcat(tmp, "\n"); 
        LCD_UsrLog((void *)tmp);
      } else {
        strcat(tmp, "\n"); 
        LCD_DbgLog((void *)tmp);
      }

      if (((fno.fattrib & AM_MASK) == AM_DIR)&&(recu_level == 1)) {
        Explore_Disk(fn, 2);
      }
    }
  }
  return res;
}
开发者ID:nhaberla,项目名称:stm32f4,代码行数:67,代码来源:usbh_usr_lcd.c



注:本文中的LCD_DbgLog函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ LCD_DisplayString函数代码示例发布时间:2022-05-30
下一篇:
C++ LCD_DataWrite函数代码示例发布时间:2022-05-30
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap