BOARDSRC_CPP (and compatibility issues) pull request
This commit is contained in:
parent
82b669d811
commit
ab6ad0fa0a
|
@ -176,6 +176,7 @@ CPPSRC = $(CHCPPSRC) \
|
||||||
$(DEV_SRC_CPP) \
|
$(DEV_SRC_CPP) \
|
||||||
$(CONTROLLERS_ALGO_SRC_CPP) \
|
$(CONTROLLERS_ALGO_SRC_CPP) \
|
||||||
$(SYSTEMSRC_CPP) \
|
$(SYSTEMSRC_CPP) \
|
||||||
|
$(BOARDSRC_CPP) \
|
||||||
$(ENGINES_SRC_CPP) \
|
$(ENGINES_SRC_CPP) \
|
||||||
$(HW_LAYER_EMS_CPP) \
|
$(HW_LAYER_EMS_CPP) \
|
||||||
$(HW_SENSORS_SRC) \
|
$(HW_SENSORS_SRC) \
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
# List of all the board related files.
|
# List of all the board related files.
|
||||||
BOARDSRC = $(PROJECT_DIR)/config/boards/ST_STM32F4/board.c
|
BOARDSRC = $(PROJECT_DIR)/config/boards/ST_STM32F4/board.c
|
||||||
|
BOARDSRC_CPP =
|
||||||
|
|
||||||
# Required include directories
|
# Required include directories
|
||||||
BOARDINC = $(PROJECT_DIR)/config/boards/ST_STM32F4
|
BOARDINC = $(PROJECT_DIR)/config/boards/ST_STM32F4
|
||||||
|
|
|
@ -18,6 +18,8 @@
|
||||||
|
|
||||||
#define EFI_CONSOLE_UART_DEVICE (&SD1)
|
#define EFI_CONSOLE_UART_DEVICE (&SD1)
|
||||||
|
|
||||||
|
#define TS_SERIAL_UART_DEVICE (&SD3)
|
||||||
|
|
||||||
#define EFI_CONSOLE_TX_PORT GPIOC
|
#define EFI_CONSOLE_TX_PORT GPIOC
|
||||||
#define EFI_CONSOLE_TX_PIN 10
|
#define EFI_CONSOLE_TX_PIN 10
|
||||||
#define EFI_CONSOLE_RX_PORT GPIOC
|
#define EFI_CONSOLE_RX_PORT GPIOC
|
||||||
|
|
|
@ -243,6 +243,10 @@
|
||||||
#define EFI_CONSOLE_UART_DEVICE (&SD3)
|
#define EFI_CONSOLE_UART_DEVICE (&SD3)
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef TS_SERIAL_UART_DEVICE
|
||||||
|
#define TS_SERIAL_UART_DEVICE (&SD3)
|
||||||
|
#endif
|
||||||
|
|
||||||
// todo: start using consoleSerialTxPin? Not sure
|
// todo: start using consoleSerialTxPin? Not sure
|
||||||
#ifndef EFI_CONSOLE_TX_PORT
|
#ifndef EFI_CONSOLE_TX_PORT
|
||||||
#define EFI_CONSOLE_TX_PORT GPIOC
|
#define EFI_CONSOLE_TX_PORT GPIOC
|
||||||
|
|
|
@ -21,10 +21,13 @@ extern LoggingWithStorage tsLogger;
|
||||||
#include "pin_repository.h"
|
#include "pin_repository.h"
|
||||||
#include "usbconsole.h"
|
#include "usbconsole.h"
|
||||||
#include "map_averaging.h"
|
#include "map_averaging.h"
|
||||||
|
|
||||||
|
#if HAL_USE_SERIAL_USB || defined(__DOXYGEN__)
|
||||||
extern SerialUSBDriver SDU1;
|
extern SerialUSBDriver SDU1;
|
||||||
#define CONSOLE_DEVICE &SDU1
|
#define CONSOLE_DEVICE &SDU1
|
||||||
|
#else
|
||||||
#define TS_SERIAL_UART_DEVICE &SD3
|
#define CONSOLE_DEVICE TS_SERIAL_UART_DEVICE
|
||||||
|
#endif
|
||||||
|
|
||||||
static SerialConfig tsSerialConfig = { 0, 0, USART_CR2_STOP1_BITS | USART_CR2_LINEN, 0 };
|
static SerialConfig tsSerialConfig = { 0, 0, USART_CR2_STOP1_BITS | USART_CR2_LINEN, 0 };
|
||||||
|
|
||||||
|
@ -56,10 +59,13 @@ void startTsPort(void) {
|
||||||
|
|
||||||
BaseChannel * getTsSerialDevice(void) {
|
BaseChannel * getTsSerialDevice(void) {
|
||||||
#if EFI_PROD_CODE || defined(__DOXYGEN__)
|
#if EFI_PROD_CODE || defined(__DOXYGEN__)
|
||||||
|
#if EFI_USB_SERIAL || defined(__DOXYGEN__)
|
||||||
if (isCommandLineConsoleOverTTL()) {
|
if (isCommandLineConsoleOverTTL()) {
|
||||||
// if console uses UART then TS uses USB
|
// if console uses UART then TS uses USB
|
||||||
return (BaseChannel *) &SDU1;
|
return (BaseChannel *) CONSOLE_DEVICE;
|
||||||
} else {
|
} else
|
||||||
|
#endif
|
||||||
|
{
|
||||||
return (BaseChannel *) TS_SERIAL_UART_DEVICE;
|
return (BaseChannel *) TS_SERIAL_UART_DEVICE;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -58,6 +58,8 @@ static void extCallback(EXTDriver *extp, expchannel_t channel) {
|
||||||
}
|
}
|
||||||
#if EFI_HD44780_LCD || defined(__DOXYGEN__)
|
#if EFI_HD44780_LCD || defined(__DOXYGEN__)
|
||||||
onJoystick(button);
|
onJoystick(button);
|
||||||
|
#else
|
||||||
|
UNUSED(button);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -41,6 +41,8 @@ static time_t GetTimeUnixSec(void) {
|
||||||
rtcGetTime(&RTCD1, ×pec);
|
rtcGetTime(&RTCD1, ×pec);
|
||||||
rtcConvertDateTimeToStructTm(×pec, &tim, NULL);
|
rtcConvertDateTimeToStructTm(×pec, &tim, NULL);
|
||||||
return mktime(&tim);
|
return mktime(&tim);
|
||||||
|
#else
|
||||||
|
return (time_t)0;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue