BOARDSRC_CPP (and compatibility issues) pull request

This commit is contained in:
Andrei 2017-05-02 20:34:01 +03:00
parent 82b669d811
commit ab6ad0fa0a
7 changed files with 22 additions and 4 deletions

View File

@ -176,6 +176,7 @@ CPPSRC = $(CHCPPSRC) \
$(DEV_SRC_CPP) \
$(CONTROLLERS_ALGO_SRC_CPP) \
$(SYSTEMSRC_CPP) \
$(BOARDSRC_CPP) \
$(ENGINES_SRC_CPP) \
$(HW_LAYER_EMS_CPP) \
$(HW_SENSORS_SRC) \

View File

@ -1,5 +1,6 @@
# List of all the board related files.
BOARDSRC = $(PROJECT_DIR)/config/boards/ST_STM32F4/board.c
BOARDSRC_CPP =
# Required include directories
BOARDINC = $(PROJECT_DIR)/config/boards/ST_STM32F4

View File

@ -18,6 +18,8 @@
#define EFI_CONSOLE_UART_DEVICE (&SD1)
#define TS_SERIAL_UART_DEVICE (&SD3)
#define EFI_CONSOLE_TX_PORT GPIOC
#define EFI_CONSOLE_TX_PIN 10
#define EFI_CONSOLE_RX_PORT GPIOC

View File

@ -243,6 +243,10 @@
#define EFI_CONSOLE_UART_DEVICE (&SD3)
#endif
#ifndef TS_SERIAL_UART_DEVICE
#define TS_SERIAL_UART_DEVICE (&SD3)
#endif
// todo: start using consoleSerialTxPin? Not sure
#ifndef EFI_CONSOLE_TX_PORT
#define EFI_CONSOLE_TX_PORT GPIOC

View File

@ -21,10 +21,13 @@ extern LoggingWithStorage tsLogger;
#include "pin_repository.h"
#include "usbconsole.h"
#include "map_averaging.h"
#if HAL_USE_SERIAL_USB || defined(__DOXYGEN__)
extern SerialUSBDriver SDU1;
#define CONSOLE_DEVICE &SDU1
#define TS_SERIAL_UART_DEVICE &SD3
#else
#define CONSOLE_DEVICE TS_SERIAL_UART_DEVICE
#endif
static SerialConfig tsSerialConfig = { 0, 0, USART_CR2_STOP1_BITS | USART_CR2_LINEN, 0 };
@ -56,10 +59,13 @@ void startTsPort(void) {
BaseChannel * getTsSerialDevice(void) {
#if EFI_PROD_CODE || defined(__DOXYGEN__)
#if EFI_USB_SERIAL || defined(__DOXYGEN__)
if (isCommandLineConsoleOverTTL()) {
// if console uses UART then TS uses USB
return (BaseChannel *) &SDU1;
} else {
return (BaseChannel *) CONSOLE_DEVICE;
} else
#endif
{
return (BaseChannel *) TS_SERIAL_UART_DEVICE;
}
#else

View File

@ -58,6 +58,8 @@ static void extCallback(EXTDriver *extp, expchannel_t channel) {
}
#if EFI_HD44780_LCD || defined(__DOXYGEN__)
onJoystick(button);
#else
UNUSED(button);
#endif
}

View File

@ -41,6 +41,8 @@ static time_t GetTimeUnixSec(void) {
rtcGetTime(&RTCD1, &timespec);
rtcConvertDateTimeToStructTm(&timespec, &tim, NULL);
return mktime(&tim);
#else
return (time_t)0;
#endif
}