From 37e87ffb863647545305760c59ca782cef3a02e7 Mon Sep 17 00:00:00 2001 From: craig duffy <c-duffy@uwe.ac.uk> Date: Wed, 9 Feb 2022 14:36:05 +0000 Subject: [PATCH] changed outbyte to __io_putchar --- worksheet4/com_port.h | 2 +- worksheet4/main.c | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/worksheet4/com_port.h b/worksheet4/com_port.h index 8be54d3..982ec41 100644 --- a/worksheet4/com_port.h +++ b/worksheet4/com_port.h @@ -30,7 +30,7 @@ void COMPortInit( void ); /* * Send a character to the COM port. */ -extern int outbyte(int c); +extern int __io_putchar(int c); /* * Receive a character from the COM port. diff --git a/worksheet4/main.c b/worksheet4/main.c index 394974e..043085c 100644 --- a/worksheet4/main.c +++ b/worksheet4/main.c @@ -23,7 +23,7 @@ #include <stm32f10x_gpio.h> #include <stm32f10x_usart.h> -int outbyte(int c) { +int __io_putchar(int c) { /* Wait until ready to send */ while (USART_GetFlagStatus(USART2, USART_FLAG_TXE) == RESET) @@ -81,17 +81,17 @@ int main(void) COMPortInit(); for ( i=0; i != 10; i++) { - outbyte('h'); - outbyte('e'); - outbyte('l'); - outbyte('l'); - outbyte('o'); + __io_putchar('h'); + __io_putchar('e'); + __io_putchar('l'); + __io_putchar('l'); + __io_putchar('o'); } - outbyte('\n'); - outbyte('b'); - outbyte('y'); - outbyte('e'); + __io_putchar('\n'); + __io_putchar('b'); + __io_putchar('y'); + __io_putchar('e'); } #ifdef USE_FULL_ASSERT -- GitLab