Skip to content

Commit ab05c94

Browse files
authored
Merge pull request cnlohr#698 from maxgerhardt/patch-7
Fix undeclared printf function usart_dma_rx_circular.c
2 parents 29705a3 + c38c635 commit ab05c94

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

examples/usart_dma_rx_circular/usart_dma_rx_circular.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
// Using any terminal, send "toggle\r\n" to control the LED connected to PC7.
33

44
#include "ch32fun.h"
5+
#include <stdio.h>
56

67
#define RX_BUF_LEN 16 // size of receive circular buffer
78

@@ -10,7 +11,7 @@ u8 cmd_buf[RX_BUF_LEN] = {0}; // buffer for complete command strings
1011

1112
void process_cmd(u8* buf)
1213
{
13-
if ( strncmp(buf, "toggle\r\n", 9) == 0) {
14+
if ( strncmp((char*)buf, "toggle\r\n", 9) == 0) {
1415
GPIOC->OUTDR ^= (1<<7);
1516
printf("Horay!\r\n");
1617
} else {

0 commit comments

Comments
 (0)