GD32F103 — 06-串口printf函数

GD32F103 DRG GD-1 06-串口printf函数 示例

GD32F103 — 06-串口printf函数

来源: DRG GD-1 开发板例程
源文件: GD32/drg_gd_1_gd32f103c8t6-master/06-串口printf函数/test/APP/main.c

子模块

  • Firmware
  • test

关键代码

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
#include "gd32f10x_eval.h"
#include "LED.h"
#include "SYSTICK_DELAY.h"

int main(){
	gd_eval_com_init(EVAL_COM0);
	LED_Init();
	my_systick_config();
	printf("This is a uart prinf function test.\r\n");
	uint8_t i;
	i = 0;
	while(1){
		LED1_Toggle();
		printf("Now i is: %d\r\n", i);
		my_systick_delay_ms(1000);	//delay 1000 ms
		i++;
		if(i>10)i=0;
	}
}
世界是你们
使用 Hugo 构建
主题 StackJimmy 设计