1
0
Fork 0
mirror of https://github.com/betaflight/betaflight.git synced 2025-07-23 16:25:31 +03:00

Fixing FY90Q build. Cleanup of printf support and initialisation.

Remove duplicate inclusion of math.h in board.h.
This commit is contained in:
Dominic Clifton 2014-04-17 17:33:07 +01:00
parent 89612bd881
commit 7e45a0c7e6
9 changed files with 61 additions and 41 deletions

View file

@ -1,5 +1,7 @@
#include "stdbool.h"
#include "stdint.h"
#include "stdlib.h"
#include "stdarg.h"
#include "platform.h"
@ -11,6 +13,12 @@
#include "battery.h"
#include "config.h"
#include "drivers/serial_common.h"
#include "runtime_config.h"
#include "printf.h"
#include "build_config.h"
#if MAX_MOTORS != MAX_SUPPORTED_MOTORS
#error Motor configuration mismatch
#endif
@ -18,3 +26,34 @@
#if MAX_SERVOS != MAX_SUPPORTED_SERVOS
#error Servo configuration mismatch
#endif
#ifdef REQUIRE_CC_ARM_PRINTF_SUPPORT
// gcc/GNU version
static void _putc(void *p, char c)
{
serialWrite(core.mainport, c);
}
void initPrintfSupport(void)
{
init_printf(NULL, _putc);
}
#else
// keil/armcc version
int fputc(int c, FILE *f)
{
// let DMA catch up a bit when using set or dump, we're too fast.
while (!isSerialTransmitBufferEmpty(core.mainport));
serialWrite(core.mainport, c);
return c;
}
void initPrintfSupport(void)
{
// nothing to do
}
#endif