利用cubemx生成的模拟IO代码驱动5110屏幕 速度很慢

2019-03-23 18:10发布

利用cubemx生成的模拟IO代码驱动5110屏幕 速度很慢 ,20分钟才显示完整三个字符。找不到问题在哪。
代码如下。
5110.c文件
  1. #include "Header_File.h"


  2. /**********************************************************************
  3. *函数名称: OLED_WriteData(uint8_t dat)
  4. *函数功能: OLED些数据
  5. *入口参数: dat 数据   
  6. *出口参数: void
  7. *示    例: OLED_WriteData(0x21)
  8. **********************************************************************/
  9. void OLED_WriteData( uint8_t dat)       
  10. {
  11.         uint8_t i;
  12.   HAL_GPIO_WritePin(DC_GPIO_Port,DC_Pin,GPIO_PIN_SET);
  13.         for(i=0;i<8;i++)
  14.         {
  15.                 if((dat << i) & 0x80)
  16.                 {
  17.                         HAL_GPIO_WritePin(DI_GPIO_Port,DI_Pin,GPIO_PIN_SET);
  18.                 }
  19.                 else
  20.                         HAL_GPIO_WritePin(DI_GPIO_Port,DI_Pin,GPIO_PIN_RESET);
  21.                 HAL_GPIO_WritePin(DO_GPIO_Port,DO_Pin,GPIO_PIN_RESET);
  22.                 HAL_GPIO_WritePin(DO_GPIO_Port,DO_Pin,GPIO_PIN_SET);
  23.         }
  24. }


  25. /**********************************************************************
  26. *函数名称: OLED_WriteCmd(uint8_t cmd)
  27. *函数功能: OLED写命令
  28. *入口参数: cmd 命令   
  29. *出口参数: void
  30. *示    例: OLED_WriteCmd(0x21)
  31. **********************************************************************/
  32. void OLED_WriteCmd(uint8_t cmd)       
  33. {
  34.         uint8_t i;
  35.   HAL_GPIO_WritePin(DC_GPIO_Port,DC_Pin,GPIO_PIN_RESET);
  36.         for(i=0;i<8;i++)
  37.         {
  38.                 if((cmd << i) & 0x80)
  39.                 {
  40.                         HAL_GPIO_WritePin(DI_GPIO_Port,DI_Pin,GPIO_PIN_SET);
  41.                 }
  42.                 else
  43.                         HAL_GPIO_WritePin(DI_GPIO_Port,DI_Pin,GPIO_PIN_RESET);
  44.                 HAL_GPIO_WritePin(DO_GPIO_Port,DO_Pin,GPIO_PIN_RESET);
  45.                 HAL_GPIO_WritePin(DO_GPIO_Port,DO_Pin,GPIO_PIN_SET);
  46.         }
  47. }


  48. /**********************************************************************
  49. *函数名称: OLED_SetPos(uint8_t x, uint8_t y)
  50. *函数功能: OLED写坐标
  51. *入口参数: X 横坐标  Y纵坐标  
  52. *出口参数: void
  53. *示    例: OLED_SetPos(2,1)
  54. **********************************************************************/
  55. void OLED_SetPos(uint8_t x, uint8_t y)
  56. {
  57.   OLED_WriteCmd(0xb0+y);
  58.   OLED_WriteCmd(((x&0xf0)>>4)|0x10);
  59.   OLED_WriteCmd((x&0x0f)|0x01);
  60. }


  61. /**********************************************************************
  62. *函数名称: void OLED_Fill(uint8_t bmp_dat)
  63. *函数功能: 满屏写数据
  64. *入口参数: bmp_dat数据
  65. *出口参数: void
  66. *示    例: OLED_Fill(0) 清屏函数
  67. **********************************************************************/
  68. void OLED_Fill(uint8_t bmp_dat)
  69. {
  70.   uint8_t y,x;
  71.   for(y=0;y<8;y++)
  72.   {
  73.     OLED_WriteCmd(0xb0+y);
  74.     OLED_WriteCmd(0x01);
  75.     OLED_WriteCmd(0x10);
  76.     for(x=0;x<128;x++)
  77.     OLED_WriteData(bmp_dat);
  78.   }
  79. }


  80. /**********************************************************************
  81. *函数名称: OLED_Init(void)
  82. *函数功能: OLED初始化函数
  83. *入口参数: void
  84. *出口参数: void
  85. *示    例: OLED_Init( )
  86. **********************************************************************/
  87. void OLED_Init(void)     
  88. {
  89.         HAL_GPIO_WritePin(RES_GPIO_Port,RES_Pin,GPIO_PIN_SET);
  90.   HAL_Delay(100);
  91.   HAL_GPIO_WritePin(RES_GPIO_Port,RES_Pin,GPIO_PIN_RESET);
  92.   HAL_Delay(100);
  93.   HAL_GPIO_WritePin(RES_GPIO_Port,RES_Pin,GPIO_PIN_SET);
  94.   HAL_GPIO_WritePin(CS_GPIO_Port,CS_Pin,GPIO_PIN_SET);
  95.   HAL_Delay(500);
  96.   HAL_GPIO_WritePin(CS_GPIO_Port,CS_Pin,GPIO_PIN_RESET);
  97.   OLED_WriteCmd(0xae);//--turn off oled panel
  98.   OLED_WriteCmd(0x00);//---set low column address
  99.   OLED_WriteCmd(0x10);//---set high column address
  100.   OLED_WriteCmd(0x40);//--set start line address  Set Mapping RAM Display Start Line (0x00~0x3F)
  101.   OLED_WriteCmd(0x81);//--set contrast control register
  102.   OLED_WriteCmd(0xcf); // Set SEG Output Current Brightness
  103.   OLED_WriteCmd(0xa1);//--Set SEG/Column Mapping     0xa0???? 0xa1??
  104.   OLED_WriteCmd(0xc8);//Set COM/Row Scan Direction   0xc0???? 0xc8??
  105.   OLED_WriteCmd(0xa6);//--set normal display
  106.   OLED_WriteCmd(0xa8);//--set multiplex ratio(1 to 64)
  107.   OLED_WriteCmd(0x3f);//--1/64 duty
  108.   OLED_WriteCmd(0xd3);//-set display offset        Shift Mapping RAM Counter (0x00~0x3F)
  109.   OLED_WriteCmd(0x00);//-not offset
  110.   OLED_WriteCmd(0xd5);//--set display clock divide ratio/oscillator frequency
  111.   OLED_WriteCmd(0x80);//--set divide ratio, Set Clock as 100 Frames/Sec
  112.   OLED_WriteCmd(0xd9);//--set pre-charge period
  113.   OLED_WriteCmd(0xf1);//Set Pre-Charge as 15 Clocks & Discharge as 1 Clock
  114.   OLED_WriteCmd(0xda);//--set com pins hardware configuration
  115.   OLED_WriteCmd(0x12);
  116.   OLED_WriteCmd(0xdb);//--set vcomh
  117.   OLED_WriteCmd(0x40);//Set VCOM Deselect Level
  118.   OLED_WriteCmd(0x20);//-Set Page Addressing Mode (0x00/0x01/0x02)
  119.   OLED_WriteCmd(0x02);//
  120.   OLED_WriteCmd(0x8d);//--set Charge Pump enable/disable
  121.   OLED_WriteCmd(0x14);//--set(0x10) disable
  122.   OLED_WriteCmd(0xa4);// Disable Entire Display On (0xa4/0xa5)
  123.   OLED_WriteCmd(0xa6);// Disable Inverse Display On (0xa6/a7)
  124.   OLED_WriteCmd(0xaf);//--turn on oled panel
  125.   OLED_Fill(0x00);    //清屏
  126.   OLED_SetPos(0,0);
  127. }


  128. /**********************************************************************
  129. *函数名称: LCD_PrintfChinese16x16( uint8_t IndexY , uint8_t IndexX ,const  uint8_t pString[] ,uint8_t mode )
  130. *函数功能: 显示16x16字符
  131. *入口参数: IndexX页地址   IndexY列地址 pString[]显示的字符  mode显示模式
  132. *出口参数: void
  133. *示    例: LCD_PrintfChinese16x16( 0 , 0 ,"显示16x16字符" ,normal )
  134. **********************************************************************/
  135. void  LCD_PrintfChinese16x16( uint8_t IndexY , uint8_t IndexX ,const  uint8_t pString[] ,uint8_t mode )
  136. {
  137.    
  138.     uint8_t temp1, temp2,i;
  139.     uint16_t Code_Address;
  140.    
  141.     IndexY <<= 1;
  142.    
  143.     temp1 = 0;
  144.    
  145.     while(pString[temp1] != '')
  146.     {
  147.         temp2 = 0;
  148.         Code_Address = 1;
  149.         
  150.         while( INDEX_CHINESE_16x16[temp2] > 127 )
  151.         {//扫描字库中的文字
  152.         
  153.             if(INDEX_CHINESE_16x16[temp2] == pString[temp1])
  154.             {
  155.             
  156.                 if(INDEX_CHINESE_16x16[temp2 + 1] == pString[temp1 + 1])
  157.                 {
  158.                
  159.                     Code_Address = temp2 * 16;
  160.                     break;
  161.                 }
  162.             }
  163.             temp2 += 2; //每个字占2个字符         
  164.         }
  165.                
  166.         if(Code_Address != 1)
  167.         {//显示上半部汉字
  168.             OLED_SetPos(IndexX, IndexY);
  169.             for(i = 0; i < 16; i++)
  170.             {               
  171.             
  172.               if(mode==0)
  173.               {
  174.                 OLED_WriteData(CODETAB_CHINESE_16x16[Code_Address]);
  175.               }
  176.               else
  177.               {
  178.                 OLED_WriteData(~CODETAB_CHINESE_16x16[Code_Address]);
  179.               }
  180.                   
  181.                 Code_Address++;
  182.             }
  183.             //显示下半部分
  184.             OLED_SetPos(IndexX,IndexY + 1);
  185.             for(i = 0;i < 16;i++)
  186.             {         
  187.             
  188.               if(mode==0)
  189.               {
  190.                 OLED_WriteData(CODETAB_CHINESE_16x16[Code_Address]);
  191.               }
  192.               else
  193.               {
  194.                 OLED_WriteData(~CODETAB_CHINESE_16x16[Code_Address]);
  195.               }
  196.                 Code_Address++;
  197.             }
  198.             
  199.             temp1 += 2;        
  200.         
  201.         }
  202.         else
  203.         {              //显示空白部分      
  204.         
  205.             OLED_SetPos(IndexX, IndexY);
  206.             for(i = 0;i < 16;i++)
  207.             {
  208.             
  209.                 OLED_WriteData(0);
  210.             }
  211.             
  212.             OLED_SetPos(IndexX,IndexY + 1);
  213.             for(i = 0;i < 16;i++)
  214.             {
  215.                        
  216.                 OLED_WriteData(0);   
  217.             }
  218.             
  219.             temp1+=1;
  220.         }
  221.         
  222.         IndexX += 16;//更新下一个字符
  223.     }
  224.     return;  
  225. }


  226. /**********************************************************************
  227. *函数名称: LCD_PrintfChineseMix16x16( uint8_t IndexX , uint8_t IndexY , const uint8_t pString[] , uint8_t mode)
  228. *函数功能: 显示16x16字符、汉字
  229. *入口参数: IndexX页地址   IndexY列地址 pString[]显示的字符  mode显示模式
  230. *出口参数: void
  231. *示    例: LCD_PrintfChineseMix16x16( 0 , 0 ,"显示16x16字符ABC" ,abnormal )
  232. **********************************************************************/
  233. void LCD_PrintfChineseMix16x16( uint8_t IndexX , uint8_t IndexY , const uint8_t pString[] , uint8_t mode)
  234. {
  235.     uint8_t tempStr[3];
  236.     uint8_t i = 0;   
  237.    
  238.     while(pString[i] != '')
  239.     {
  240.         if(pString[i] > 127)
  241.         {
  242.             tempStr[0] = pString[i];
  243.             tempStr[1] = pString[i + 1];
  244.             tempStr[2] = '';          //空格
  245.             LCD_PrintfChinese16x16(IndexX , IndexY , tempStr , mode);
  246.             IndexY += 16;
  247.             i += 2;
  248.         }
  249.         else
  250.         {
  251.             LCD_PrintfChar8x16(IndexY, IndexX, pString[i] , mode);  //显示字母
  252.             IndexY += 8;
  253.             i += 1;
  254.         }
  255.     }
  256.   
  257. }


  258. /**********************************************************************
  259. *函数名称: LCD_PrintfChar8x16( uint8_t IndexX , uint8_t IndexY , uint8_t pData , uint8_t mode)
  260. *函数功能: 显示8x16字幕
  261. *入口参数: IndexX页地址   IndexY列地址 pData显示的字符  mode显示模式
  262. *出口参数: void
  263. *示例    :LCD_PrintfChar8x16( 0 , 0 ,"ABCDE" ,abnormal )
  264. **********************************************************************/
  265. void LCD_PrintfChar8x16( uint8_t IndexX , uint8_t IndexY , uint8_t pData , uint8_t mode)
  266. {
  267.   
  268.   uint8_t i;
  269.   
  270.   IndexY <<= 1;
  271.   
  272.     if(IndexX > 120)
  273.     {
  274.         IndexX = 0;
  275.         IndexY+=2;
  276.     }
  277.     pData = (pData-32);
  278.    
  279.     OLED_SetPos(IndexX, IndexY);
  280.     for(i = 0; i < 8; i++)
  281.     {     
  282.       if(mode==0)
  283.       {
  284.         OLED_WriteData((Tab_Ascii_8x16[(pData << 4) + i]));
  285.       }
  286.       else
  287.       {
  288.         OLED_WriteData((~Tab_Ascii_8x16[(pData << 4) + i]));
  289.       }
  290.     }
  291.     OLED_SetPos(IndexX, IndexY+1);
  292.     for(i = 0; i < 8; i++)
  293.     {     
  294.       if(mode==0)
  295.       {
  296.         OLED_WriteData((Tab_Ascii_8x16[(pData << 4) + i + 8 ]));
  297.       }
  298.       else
  299.       {
  300.         OLED_WriteData((~Tab_Ascii_8x16[(pData << 4) + i + 8 ]));
  301.       }
  302.     }
  303. }
复制代码下面是main.c
  1. /**
  2.   ******************************************************************************
  3.   * File Name          : main.c
  4.   * Description        : Main program body
  5.   ******************************************************************************
  6.   *
  7.   * COPYRIGHT(c) 2016 STMicroelectronics
  8.   *
  9.   * Redistribution and use in source and binary forms, with or without modification,
  10.   * are permitted provided that the following conditions are met:
  11.   *   1. Redistributions of source code must retain the above copyright notice,
  12.   *      this list of conditions and the following disclaimer.
  13.   *   2. Redistributions in binary form must reproduce the above copyright notice,
  14.   *      this list of conditions and the following disclaimer in the documentation
  15.   *      and/or other materials provided with the distribution.
  16.   *   3. Neither the name of STMicroelectronics nor the names of its contributors
  17.   *      may be used to endorse or promote products derived from this software
  18.   *      without specific prior written permission.
  19.   *
  20.   * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
  21.   * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
  22.   * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
  23.   * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
  24.   * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
  25.   * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  26.   * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  27.   * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
  28.   * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
  29.   * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  30.   *
  31.   ******************************************************************************
  32.   */
  33. /* Includes ------------------------------------------------------------------*/
  34. #include "stm32f1xx_hal.h"

  35. /* USER CODE BEGIN Includes */
  36. #include "Header_File.h"
  37. /* USER CODE END Includes */

  38. /* Private variables ---------------------------------------------------------*/
  39. UART_HandleTypeDef huart1;

  40. /* USER CODE BEGIN PV */
  41. /* Private variables ---------------------------------------------------------*/

  42. /* USER CODE END PV */

  43. /* Private function prototypes -----------------------------------------------*/
  44. void SystemClock_Config(void);
  45. static void MX_GPIO_Init(void);
  46. static void MX_USART1_UART_Init(void);

  47. /* USER CODE BEGIN PFP */
  48. /* Private function prototypes -----------------------------------------------*/

  49. /* USER CODE END PFP */

  50. /* USER CODE BEGIN 0 */

  51. /* USER CODE END 0 */

  52. int main(void)
  53. {

  54.   /* USER CODE BEGIN 1 */

  55.   /* USER CODE END 1 */

  56.   /* MCU Configuration----------------------------------------------------------*/

  57.   /* Reset of all peripherals, Initializes the Flash interface and the Systick. */
  58.   HAL_Init();

  59.   /* Configure the system clock */
  60.   SystemClock_Config();

  61.   /* Initialize all configured peripherals */
  62.   MX_GPIO_Init();
  63.   MX_USART1_UART_Init();

  64.   /* USER CODE BEGIN 2 */
  65.         OLED_Init();
  66.         HAL_Delay(1000);
  67.         LCD_PrintfChineseMix16x16(2,3,"ϵBCDEFGHIJKLMN",0);
  68.   /* USER CODE END 2 */

  69.   /* Infinite loop */
  70.   /* USER CODE BEGIN WHILE */
  71.   while (1)
  72.   {
  73.   /* USER CODE END WHILE */

  74.   /* USER CODE BEGIN 3 */
  75. //                HAL_Delay(1000);
  76.                 for(uint8_t i=0;i<0xf;i++)
  77.                 {
  78.                         uint32_t j=100000;
  79.                         while(j--);
  80.                 }

  81.                 HAL_GPIO_TogglePin(LED_GPIO_Port,LED_Pin);
  82. //                LCD_clear();
  83.   }
  84.   /* USER CODE END 3 */

  85. }

  86. /** System Clock Configuration
  87. */
  88. void SystemClock_Config(void)
  89. {

  90.   RCC_OscInitTypeDef RCC_OscInitStruct;
  91.   RCC_ClkInitTypeDef RCC_ClkInitStruct;

  92.   RCC_OscInitStruct.OscillatorType = RCC_OSCILLATORTYPE_HSE;
  93.   RCC_OscInitStruct.HSEState = RCC_HSE_ON;
  94.   RCC_OscInitStruct.HSEPredivValue = RCC_HSE_PREDIV_DIV1;
  95.   RCC_OscInitStruct.PLL.PLLState = RCC_PLL_ON;
  96.   RCC_OscInitStruct.PLL.PLLSource = RCC_PLLSOURCE_HSE;
  97.   RCC_OscInitStruct.PLL.PLLMUL = RCC_PLL_MUL9;
  98.   HAL_RCC_OscConfig(&RCC_OscInitStruct);

  99.   RCC_ClkInitStruct.ClockType = RCC_CLOCKTYPE_HCLK|RCC_CLOCKTYPE_SYSCLK
  100.                               |RCC_CLOCKTYPE_PCLK1|RCC_CLOCKTYPE_PCLK2;
  101.   RCC_ClkInitStruct.SYSCLKSource = RCC_SYSCLKSOURCE_PLLCLK;
  102.   RCC_ClkInitStruct.AHBCLKDivider = RCC_SYSCLK_DIV1;
  103.   RCC_ClkInitStruct.APB1CLKDivider = RCC_HCLK_DIV2;
  104.   RCC_ClkInitStruct.APB2CLKDivider = RCC_HCLK_DIV1;
  105.   HAL_RCC_ClockConfig(&RCC_ClkInitStruct, FLASH_LATENCY_2);

  106.   HAL_SYSTICK_Config(HAL_RCC_GetHCLKFreq()/8000);

  107.   HAL_SYSTICK_CLKSourceConfig(SYSTICK_CLKSOURCE_HCLK_DIV8);

  108.   /* SysTick_IRQn interrupt configuration */
  109.   HAL_NVIC_SetPriority(SysTick_IRQn, 0, 0);
  110. }

  111. /* USART1 init function */
  112. void MX_USART1_UART_Init(void)
  113. {

  114.   huart1.Instance = USART1;
  115.   huart1.Init.BaudRate = 115200;
  116.   huart1.Init.WordLength = UART_WORDLENGTH_8B;
  117.   huart1.Init.StopBits = UART_STOPBITS_1;
  118.   huart1.Init.Parity = UART_PARITY_NONE;
  119.   huart1.Init.Mode = UART_MODE_TX_RX;
  120.   huart1.Init.HwFlowCtl = UART_HWCONTROL_NONE;
  121.   huart1.Init.OverSampling = UART_OVERSAMPLING_16;
  122.   HAL_UART_Init(&huart1);

  123. }

  124. /** Configure pins as
  125.         * Analog
  126.         * Input
  127.         * Output
  128.         * EVENT_OUT
  129.         * EXTI
  130. */
  131. void MX_GPIO_Init(void)
  132. {

  133.   GPIO_InitTypeDef GPIO_InitStruct;

  134.   /* GPIO Ports Clock Enable */
  135.   __HAL_RCC_GPIOE_CLK_ENABLE();
  136.   __HAL_RCC_GPIOD_CLK_ENABLE();
  137.   __HAL_RCC_GPIOA_CLK_ENABLE();

  138.   /*Configure GPIO pin Output Level */
  139.   HAL_GPIO_WritePin(GPIOE, RES_Pin|DI_Pin|DO_Pin|CS_Pin
  140.                           |DC_Pin, GPIO_PIN_RESET);

  141.   /*Configure GPIO pin Output Level */
  142.   HAL_GPIO_WritePin(LED_GPIO_Port, LED_Pin, GPIO_PIN_RESET);

  143.   /*Configure GPIO pins : RES_Pin DI_Pin DO_Pin CS_Pin
  144.                            DC_Pin */
  145.   GPIO_InitStruct.Pin = RES_Pin|DI_Pin|DO_Pin|CS_Pin
  146.                           |DC_Pin;
  147.   GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
  148.   GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_HIGH;
  149.   HAL_GPIO_Init(GPIOE, &GPIO_InitStruct);

  150.   /*Configure GPIO pin : LED_Pin */
  151.   GPIO_InitStruct.Pin = LED_Pin;
  152.   GPIO_InitStruct.Mode = GPIO_MODE_OUTPUT_PP;
  153.   GPIO_InitStruct.Speed = GPIO_SPEED_FREQ_LOW;
  154.   HAL_GPIO_Init(LED_GPIO_Port, &GPIO_InitStruct);

  155. }

  156. /* USER CODE BEGIN 4 */

  157. /* USER CODE END 4 */

  158. #ifdef USE_FULL_ASSERT

  159. /**
  160.    * [url=home.php?mod=space&uid=159083]@brief[/url] Reports the name of the source file and the source line number
  161.    * where the assert_param error has occurred.
  162.    * @param file: pointer to the source file name
  163.    * @param line: assert_param error line source number
  164.    * @retval None
  165.    */
  166. void assert_failed(uint8_t* file, uint32_t line)
  167. {
  168.   /* USER CODE BEGIN 6 */
  169.   /* User can add his own implementation to report the file name and line number,
  170.     ex: printf("Wrong parameters value: file %s on line %d ", file, line) */
  171.   /* USER CODE END 6 */

  172. }

  173. #endif

  174. /**
  175.   * @}
  176.   */

  177. /**
  178.   * @}
  179. */

  180. /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
复制代码哪位大侠能看出问题在哪
此帖出自小平头技术问答
友情提示: 此问题已得到解决,问题已经关闭,关闭后问题禁止继续编辑,回答。
该问题目前已经被作者或者管理员关闭, 无法添加新回复
3条回答
pbabca
1楼-- · 2019-03-24 02:23
/ while(1)里面的
  /* USER CODE BEGIN 3 */
//                HAL_Delay(1000);

这个想法去掉,你加这种死等的延时,不慢才怪
wanyisq
2楼-- · 2019-03-24 05:25
 精彩回答 2  元偷偷看……
cl17726
3楼-- · 2019-03-24 06:39
IO操作就bitband或者传统方法寄存器就好,官方证明了HAL API比较低效率,不过据说在做高效率的LL API,L4上已经有了,当然!LL API会比STD API高效率,但是STD API比HAL API高效率.

一周热门 更多>