Horus internal GPS: settable baudrate, misc fixes, new cmake options, cosmetics, cli
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
set(PCBREV "13" CACHE STRING "PCB Revision")
|
||||
set(INTERNAL_GPS_BAUDRATE "9600" CACHE STRING "Baud rate for internal GPS")
|
||||
option(INTERNAL_GPS_INSTALLED "Internal GPS installed in beta hardware version" NO)
|
||||
option(DISK_CACHE "Enable SD card disk cache" YES)
|
||||
|
||||
set(CPU_TYPE STM32F4)
|
||||
@@ -16,6 +18,7 @@ set(RAMBACKUP YES)
|
||||
|
||||
add_definitions(-DPCBHORUS -DPCBREV=${PCBREV} -DSTM32F429_439xx -DSDRAM -DCOLORLCD -DPPM_PIN_UART -DPPM_PIN_TIMER)
|
||||
add_definitions(-DEEPROM_VARIANT=0 -DAUDIO -DVOICE -DRTCLOCK)
|
||||
add_definitions(-DGPS_USART_BAUDRATE=${INTERNAL_GPS_BAUDRATE})
|
||||
|
||||
include_directories(${RADIO_SRC_DIRECTORY}/fonts/480x272 gui/${GUI_DIR} gui/${GUI_DIR}/layouts)
|
||||
|
||||
@@ -49,6 +52,9 @@ if(DISK_CACHE)
|
||||
set(SRC ${SRC} disk_cache.cpp)
|
||||
add_definitions(-DDISK_CACHE)
|
||||
endif()
|
||||
if(INTERNAL_GPS_INSTALLED)
|
||||
add_definitions(-DINTERNAL_GPS_INSTALLED)
|
||||
endif()
|
||||
set(SERIAL2_DRIVER serial2_driver.cpp)
|
||||
set(TARGET_SRC
|
||||
${TARGET_SRC}
|
||||
|
||||
@@ -168,7 +168,7 @@ void boardInit()
|
||||
lcdInit();
|
||||
backlightInit();
|
||||
// TODO ? backlightEnable(100);
|
||||
|
||||
|
||||
audioInit();
|
||||
init2MhzTimer();
|
||||
init1msTimer();
|
||||
@@ -177,8 +177,8 @@ void boardInit()
|
||||
|
||||
// bt_open();
|
||||
|
||||
gpsInit();
|
||||
|
||||
gpsInit(GPS_USART_BAUDRATE);
|
||||
|
||||
#if defined(DEBUG)
|
||||
DBGMCU_APB1PeriphConfig(DBGMCU_IWDG_STOP|DBGMCU_TIM1_STOP|DBGMCU_TIM2_STOP|DBGMCU_TIM3_STOP|DBGMCU_TIM4_STOP|DBGMCU_TIM5_STOP|DBGMCU_TIM6_STOP|DBGMCU_TIM7_STOP|DBGMCU_TIM8_STOP|DBGMCU_TIM9_STOP|DBGMCU_TIM10_STOP|DBGMCU_TIM11_STOP|DBGMCU_TIM12_STOP|DBGMCU_TIM13_STOP|DBGMCU_TIM14_STOP, ENABLE);
|
||||
#endif
|
||||
|
||||
@@ -389,12 +389,12 @@ void hapticOff(void);
|
||||
void hapticOn(uint32_t pwmPercent);
|
||||
|
||||
// GPS driver
|
||||
#if PCBREV >= 13
|
||||
#if PCBREV >= 13 || defined(INTERNAL_GPS_INSTALLED)
|
||||
#define INTERNAL_GPS 1
|
||||
#else
|
||||
#define INTERNAL_GPS 0
|
||||
#endif
|
||||
void gpsInit(void);
|
||||
void gpsInit(uint32_t baudrate);
|
||||
uint8_t gpsGetByte(uint8_t * byte);
|
||||
|
||||
// Second serial port driver
|
||||
|
||||
@@ -20,9 +20,13 @@
|
||||
|
||||
#include "opentx.h"
|
||||
|
||||
Fifo<uint8_t, 64> gpsRxFifo;
|
||||
#if GPS_USART_BAUDRATE > 9600
|
||||
Fifo<uint8_t, 256> gpsRxFifo;
|
||||
#else
|
||||
Fifo<uint8_t, 64> gpsRxFifo;
|
||||
#endif
|
||||
|
||||
void gpsInit()
|
||||
void gpsInit(uint32_t baudrate)
|
||||
{
|
||||
GPIO_InitTypeDef GPIO_InitStructure;
|
||||
USART_InitTypeDef USART_InitStructure;
|
||||
@@ -39,7 +43,7 @@ void gpsInit()
|
||||
GPIO_Init(GPS_UART_GPIO, &GPIO_InitStructure);
|
||||
|
||||
// UART config
|
||||
USART_InitStructure.USART_BaudRate = GPS_USART_BAUDRATE;
|
||||
USART_InitStructure.USART_BaudRate = baudrate;
|
||||
USART_InitStructure.USART_Parity = USART_Parity_No;
|
||||
USART_InitStructure.USART_StopBits = USART_StopBits_1;
|
||||
USART_InitStructure.USART_WordLength = USART_WordLength_8b;
|
||||
|
||||
@@ -439,6 +439,5 @@
|
||||
#define GPS_RX_GPIO_PIN GPIO_Pin_1 // PA.01
|
||||
#define GPS_TX_GPIO_PinSource GPIO_PinSource0
|
||||
#define GPS_RX_GPIO_PinSource GPIO_PinSource1
|
||||
#define GPS_USART_BAUDRATE 9600
|
||||
|
||||
#endif // _HAL_H_
|
||||
|
||||
Reference in New Issue
Block a user