From b39a731b4a53667ec997a22b00893e012c534a27 Mon Sep 17 00:00:00 2001 From: rusEfi Date: Thu, 8 Jan 2015 11:03:39 -0600 Subject: [PATCH] auto-sync --- firmware/.cproject | 2 +- firmware/config/stm32f1egt/chconf.h | 5 +++- firmware/config/stm32f1egt/efifeatures.h | 4 +-- firmware/config/stm32f1egt/halconf.h | 2 +- firmware/config/stm32f1egt/mcuconf.h | 2 +- firmware/console/console_io.c | 34 +++++++++++++----------- 6 files changed, 27 insertions(+), 22 deletions(-) diff --git a/firmware/.cproject b/firmware/.cproject index b27ed18760..659748441c 100644 --- a/firmware/.cproject +++ b/firmware/.cproject @@ -588,7 +588,7 @@ - + diff --git a/firmware/config/stm32f1egt/chconf.h b/firmware/config/stm32f1egt/chconf.h index f4682cb9d8..a8a240f307 100644 --- a/firmware/config/stm32f1egt/chconf.h +++ b/firmware/config/stm32f1egt/chconf.h @@ -28,6 +28,9 @@ #ifndef _CHCONF_H_ #define _CHCONF_H_ + #define ON_LOCK_HOOK + #define ON_UNLOCK_HOOK + /*===========================================================================*/ /** * @name Kernel parameters and options @@ -357,7 +360,7 @@ * @note The default is @p FALSE. */ #if !defined(CH_DBG_SYSTEM_STATE_CHECK) || defined(__DOXYGEN__) -#define CH_DBG_SYSTEM_STATE_CHECK FALSE +#define CH_DBG_SYSTEM_STATE_CHECK TRUE #endif /** diff --git a/firmware/config/stm32f1egt/efifeatures.h b/firmware/config/stm32f1egt/efifeatures.h index 1848771499..e652b6f377 100644 --- a/firmware/config/stm32f1egt/efifeatures.h +++ b/firmware/config/stm32f1egt/efifeatures.h @@ -16,9 +16,7 @@ #define hal_lld_get_counter_value() DWT_CYCCNT -#define EFI_USE_UART_FOR_CONSOLE TRUE - -#define EFI_CONSOLE_UART_DEVICE (&SD1) +#define EFI_USE_UART_FOR_CONSOLE FALSE #define EFI_CONSOLE_TX_PORT GPIOC #define EFI_CONSOLE_TX_PIN 10 diff --git a/firmware/config/stm32f1egt/halconf.h b/firmware/config/stm32f1egt/halconf.h index f41266a11a..b39288c3a8 100644 --- a/firmware/config/stm32f1egt/halconf.h +++ b/firmware/config/stm32f1egt/halconf.h @@ -139,7 +139,7 @@ * @brief Enables the SPI subsystem. */ #if !defined(HAL_USE_SPI) || defined(__DOXYGEN__) -#define HAL_USE_SPI FALSE +#define HAL_USE_SPI TRUE #endif /** diff --git a/firmware/config/stm32f1egt/mcuconf.h b/firmware/config/stm32f1egt/mcuconf.h index 0dc788ea08..d7ef8372a1 100644 --- a/firmware/config/stm32f1egt/mcuconf.h +++ b/firmware/config/stm32f1egt/mcuconf.h @@ -164,7 +164,7 @@ /* * SPI driver system settings. */ -#define STM32_SPI_USE_SPI1 FALSE +#define STM32_SPI_USE_SPI1 TRUE #define STM32_SPI_USE_SPI2 FALSE #define STM32_SPI_USE_SPI3 FALSE #define STM32_SPI_SPI1_DMA_PRIORITY 1 diff --git a/firmware/console/console_io.c b/firmware/console/console_io.c index 13cb6c1005..552e8f5b68 100644 --- a/firmware/console/console_io.c +++ b/firmware/console/console_io.c @@ -20,16 +20,14 @@ #include "main.h" #include "console_io.h" - -#if EFI_PROD_CODE -#if HAL_USE_SERIAL_USB || defined(__DOXYGEN__) -extern SerialUSBDriver SDU1; -#endif -#include "usbcfg.h" -#include "usbconsole.h" -#endif #include "rfiutil.h" +#if HAL_USE_SERIAL_USB || defined(__DOXYGEN__) + #include "usbcfg.h" + #include "usbconsole.h" + extern SerialUSBDriver SDU1; +#endif + int lastWriteSize; int lastWriteActual; @@ -122,19 +120,23 @@ bool isSerialOverUart(void) { return is_serial_over_uart; } -#if EFI_PROD_CODE || EFI_EGT - +#if EFI_USE_UART_FOR_CONSOLE || defined(__DOXYGEN__) static SerialConfig serialConfig = { SERIAL_SPEED, 0, USART_CR2_STOP1_BITS | USART_CR2_LINEN, 0 }; +#endif + +#if EFI_PROD_CODE || EFI_EGT || defined(__DOXYGEN__) SerialDriver * getConsoleChannel(void) { -#if HAL_USE_SERIAL_USB || defined(__DOXYGEN__) +#if defined(EFI_CONSOLE_UART_DEVICE) || defined(__DOXYGEN__) if (isSerialOverUart()) { return (SerialDriver *) EFI_CONSOLE_UART_DEVICE; - } else { - return (SerialDriver *) &SDU1; } +#endif /* EFI_CONSOLE_UART_DEVICE */ + +#if HAL_USE_SERIAL_USB || defined(__DOXYGEN__) + return (SerialDriver *) &SDU1; #else - return (SerialDriver *) EFI_CONSOLE_UART_DEVICE; + return NULL; #endif } @@ -201,7 +203,7 @@ void consoleOutputBuffer(const uint8_t *buf, int size) { void startConsole(void (*console_line_callback_p)(char *)) { console_line_callback = console_line_callback_p; -#if EFI_PROD_CODE +#if EFI_USE_UART_FOR_CONSOLE palSetPadMode(CONSOLE_MODE_SWITCH_PORT, CONSOLE_MODE_SWITCH_PIN, PAL_MODE_INPUT_PULLUP); @@ -222,6 +224,8 @@ void startConsole(void (*console_line_callback_p)(char *)) { chEvtRegisterMask((EventSource *) chnGetEventSource(EFI_CONSOLE_UART_DEVICE), &consoleEventListener, 1); } +#else + is_serial_over_uart = false; #endif /* EFI_PROD_CODE */ chThdCreateStatic(consoleThreadStack, sizeof(consoleThreadStack), NORMALPRIO, consoleThreadThreadEntryPoint, NULL);