mirror of
https://gitea.osmocom.org/sim-card/simtrace2.git
synced 2026-03-27 02:38:33 +03:00
Uart_console: remove custom printf
This commit is contained in:
@@ -33,8 +33,6 @@
|
|||||||
|
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
extern int printf(const char *, ...);
|
|
||||||
|
|
||||||
extern void UART_Configure( uint32_t dwBaudrate, uint32_t dwMasterClock ) ;
|
extern void UART_Configure( uint32_t dwBaudrate, uint32_t dwMasterClock ) ;
|
||||||
extern void UART_PutChar( uint8_t uc ) ;
|
extern void UART_PutChar( uint8_t uc ) ;
|
||||||
extern uint32_t UART_GetChar( void ) ;
|
extern uint32_t UART_GetChar( void ) ;
|
||||||
|
|||||||
@@ -63,32 +63,6 @@
|
|||||||
/** Is Console Initialized. */
|
/** Is Console Initialized. */
|
||||||
static uint8_t _ucIsConsoleInitialized=0 ;
|
static uint8_t _ucIsConsoleInitialized=0 ;
|
||||||
|
|
||||||
extern void UART_PutString(const char *str, int len) {
|
|
||||||
int i;
|
|
||||||
for (i=0; i<len; i++) {
|
|
||||||
UART_PutChar(*str++);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
extern int printf(const char *fmt, ...)
|
|
||||||
{
|
|
||||||
char *cmdp;
|
|
||||||
size_t ret = 0;
|
|
||||||
|
|
||||||
va_list va;
|
|
||||||
va_start(va, fmt);
|
|
||||||
ret = vasprintf(&cmdp, fmt, va);
|
|
||||||
va_end(va);
|
|
||||||
|
|
||||||
if (ret == strlen(cmdp)) {
|
|
||||||
UART_PutString(cmdp, strlen(cmdp));
|
|
||||||
free(cmdp);
|
|
||||||
} else {
|
|
||||||
return -1;
|
|
||||||
}
|
|
||||||
return ret;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* \brief Configures an USART peripheral with the specified parameters.
|
* \brief Configures an USART peripheral with the specified parameters.
|
||||||
*
|
*
|
||||||
|
|||||||
Reference in New Issue
Block a user