Browse Source

Fixed issue #15, new uart building under gcc toolchain, thanks!

git-svn-id: https://afrodevices.googlecode.com/svn/trunk/baseflight@383 7c89a4a9-59b9-e629-4cfe-3a2d53b20e61
master
timecop@gmail.com 11 years ago
parent
commit
1441d46323
  1. 3
      src/drv_uart.h
  2. 2
      src/main.c
  3. 5
      src/printf.c

3
src/drv_uart.h

@ -38,9 +38,6 @@ typedef struct {
portmode_t mode;
} serialPort_t;
extern serialPort_t serialPort1;
extern serialPort_t serialPort2;
serialPort_t *uartOpen(USART_TypeDef *USARTx, uartReceiveCallbackPtr callback, uint32_t baudRate, portmode_t mode);
void uartChangeBaud(serialPort_t *s, uint32_t baudRate);
bool isUartAvailable(serialPort_t *s);

2
src/main.c

@ -13,7 +13,7 @@ extern uint16_t spektrumReadRawRC(uint8_t chan);
// gcc/GNU version
static void _putc(void *p, char c)
{
uartWrite(c);
uartWrite(core.mainport, c);
}
#else
// keil/armcc version

5
src/printf.c

@ -30,6 +30,7 @@
*/
#include "board.h"
#include "mw.h"
#ifdef USE_LAME_PRINTF
#define PRINTF_LONG_SUPPORT
@ -227,7 +228,7 @@ void tfp_printf(char *fmt, ...)
va_start(va, fmt);
tfp_format(stdout_putp, stdout_putf, fmt, va);
va_end(va);
while (!isUartTransmitEmpty());
while (!isUartTransmitEmpty(core.mainport));
}
static void putcp(void *p, char c)
@ -235,8 +236,6 @@ static void putcp(void *p, char c)
*(*((char **) p))++ = c;
}
void tfp_sprintf(char *s, char *fmt, ...)
{
va_list va;

Loading…
Cancel
Save