add stm32g070

This commit is contained in:
graduateDesign 2021-09-06 17:40:27 +08:00
parent 14bf07d742
commit 7267aacd48
3 changed files with 28 additions and 5 deletions

View File

@ -24,7 +24,7 @@
/* Private includes ----------------------------------------------------------*/
/* USER CODE BEGIN Includes */
#include "pikaScript.h"
/* USER CODE END Includes */
/* Private typedef -----------------------------------------------------------*/
@ -88,7 +88,7 @@ int main(void)
MX_GPIO_Init();
MX_USART1_UART_Init();
/* USER CODE BEGIN 2 */
PikaObj *pikaMain = pikaScriptInit();
/* USER CODE END 2 */
/* Infinite loop */

View File

@ -21,7 +21,7 @@
#include "usart.h"
/* USER CODE BEGIN 0 */
#include <stdio.h>
/* USER CODE END 0 */
UART_HandleTypeDef huart1;
@ -125,7 +125,30 @@ void HAL_UART_MspDeInit(UART_HandleTypeDef* uartHandle)
}
/* USER CODE BEGIN 1 */
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <EFBFBD>ض<EFBFBD><EFBFBD><EFBFBD>c<EFBFBD><EFBFBD><EFBFBD>printf<EFBFBD><EFBFBD>DEBUG_USARTx
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <EFBFBD><EFBFBD>
* <EFBFBD><EFBFBD> <EFBFBD><EFBFBD> ֵ: <EFBFBD><EFBFBD>
* ˵ <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*/
int fputc(int ch, FILE *f)
{
HAL_UART_Transmit(&huart1, (uint8_t *)&ch, 1, 0xffff);
return ch;
}
/**
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <EFBFBD>ض<EFBFBD><EFBFBD><EFBFBD>c<EFBFBD><EFBFBD><EFBFBD>getchar,scanf<EFBFBD><EFBFBD>DEBUG_USARTx
* <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>: <EFBFBD><EFBFBD>
* <EFBFBD><EFBFBD> <EFBFBD><EFBFBD> ֵ: <EFBFBD><EFBFBD>
* ˵ <EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
*/
int fgetc(FILE *f)
{
uint8_t ch = 0;
HAL_UART_Receive(&huart1, &ch, 1, 0xffff);
return ch;
}
/* USER CODE END 1 */
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -313,7 +313,7 @@
</ArmAdsMisc>
<Cads>
<interw>1</interw>
<Optim>2</Optim>
<Optim>4</Optim>
<oTime>0</oTime>
<SplitLS>0</SplitLS>
<OneElfS>1</OneElfS>