1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2024-12-01 09:24:10 +01:00

OP-1477 - some cleanup

This commit is contained in:
Alessio Morale 2014-09-07 22:37:03 +02:00
parent 7e55d6ff41
commit 71af403c9d
8 changed files with 184 additions and 184 deletions

View File

@ -58,7 +58,7 @@ static const struct pios_gpio pios_leds_gpsp[] = {
.init = { .init = {
.GPIO_Pin = GPIO_Pin_4, .GPIO_Pin = GPIO_Pin_4,
.GPIO_Mode = GPIO_Mode_OUT, .GPIO_Mode = GPIO_Mode_OUT,
.GPIO_OType = GPIO_OType_OD, .GPIO_OType = GPIO_OType_OD,
.GPIO_Speed = GPIO_Speed_Level_1, .GPIO_Speed = GPIO_Speed_Level_1,
}, },
}, },
@ -89,19 +89,19 @@ void DMA1_Channel2_3_IRQHandler() __attribute__((alias("PIOS_SPI_mag_flash_irq_h
static uint32_t pios_spi_mag_flash_id; static uint32_t pios_spi_mag_flash_id;
static const struct pios_spi_cfg pios_spi_mag_flash_cfg = { static const struct pios_spi_cfg pios_spi_mag_flash_cfg = {
.remap = GPIO_AF_0, .remap = GPIO_AF_0,
.regs = SPI1, .regs = SPI1,
.init = { .init = {
.SPI_Mode = SPI_Mode_Master, .SPI_Mode = SPI_Mode_Master,
.SPI_Direction = SPI_Direction_2Lines_FullDuplex, .SPI_Direction = SPI_Direction_2Lines_FullDuplex,
.SPI_DataSize = SPI_DataSize_8b, .SPI_DataSize = SPI_DataSize_8b,
.SPI_NSS = SPI_NSS_Soft, .SPI_NSS = SPI_NSS_Soft,
.SPI_FirstBit = SPI_FirstBit_MSB, .SPI_FirstBit = SPI_FirstBit_MSB,
.SPI_CRCPolynomial = 7, .SPI_CRCPolynomial = 7,
.SPI_CPOL = SPI_CPOL_High, .SPI_CPOL = SPI_CPOL_High,
.SPI_CPHA = SPI_CPHA_2Edge, .SPI_CPHA = SPI_CPHA_2Edge,
.SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_8, .SPI_BaudRatePrescaler = SPI_BaudRatePrescaler_8,
}, },
.dma = { .dma = {
.ahb_clk = RCC_AHBPeriph_DMA1, .ahb_clk = RCC_AHBPeriph_DMA1,
.irq = { .irq = {
@ -113,37 +113,37 @@ static const struct pios_spi_cfg pios_spi_mag_flash_cfg = {
}, },
}, },
.rx = { .rx = {
.channel = DMA1_Channel2, .channel = DMA1_Channel2,
.init = { .init = {
.DMA_PeripheralBaseAddr = (uint32_t)&(SPI1->DR), .DMA_PeripheralBaseAddr = (uint32_t)&(SPI1->DR),
.DMA_DIR = DMA_DIR_PeripheralSRC, .DMA_DIR = DMA_DIR_PeripheralSRC,
.DMA_PeripheralInc = DMA_PeripheralInc_Disable, .DMA_PeripheralInc = DMA_PeripheralInc_Disable,
.DMA_MemoryInc = DMA_MemoryInc_Enable, .DMA_MemoryInc = DMA_MemoryInc_Enable,
.DMA_PeripheralDataSize = DMA_PeripheralDataSize_Byte, .DMA_PeripheralDataSize = DMA_PeripheralDataSize_Byte,
.DMA_MemoryDataSize = DMA_MemoryDataSize_Byte, .DMA_MemoryDataSize = DMA_MemoryDataSize_Byte,
.DMA_Mode = DMA_Mode_Normal, .DMA_Mode = DMA_Mode_Normal,
.DMA_Priority = DMA_Priority_Medium, .DMA_Priority = DMA_Priority_Medium,
.DMA_M2M = DMA_M2M_Disable, .DMA_M2M = DMA_M2M_Disable,
}, },
}, },
.tx = { .tx = {
.channel = DMA1_Channel3, .channel = DMA1_Channel3,
.init = { .init = {
.DMA_PeripheralBaseAddr = (uint32_t)&(SPI1->DR), .DMA_PeripheralBaseAddr = (uint32_t)&(SPI1->DR),
.DMA_DIR = DMA_DIR_PeripheralDST, .DMA_DIR = DMA_DIR_PeripheralDST,
.DMA_PeripheralInc = DMA_PeripheralInc_Disable, .DMA_PeripheralInc = DMA_PeripheralInc_Disable,
.DMA_MemoryInc = DMA_MemoryInc_Enable, .DMA_MemoryInc = DMA_MemoryInc_Enable,
.DMA_PeripheralDataSize = DMA_PeripheralDataSize_Byte, .DMA_PeripheralDataSize = DMA_PeripheralDataSize_Byte,
.DMA_MemoryDataSize = DMA_MemoryDataSize_Byte, .DMA_MemoryDataSize = DMA_MemoryDataSize_Byte,
.DMA_Mode = DMA_Mode_Normal, .DMA_Mode = DMA_Mode_Normal,
.DMA_Priority = DMA_Priority_Medium, .DMA_Priority = DMA_Priority_Medium,
.DMA_M2M = DMA_M2M_Disable, .DMA_M2M = DMA_M2M_Disable,
}, },
}, },
}, },
.use_crc = false, .use_crc = false,
.sclk = { .sclk = {
.gpio = GPIOA, .gpio = GPIOA,
.init = { .init = {
.GPIO_Pin = GPIO_Pin_5, .GPIO_Pin = GPIO_Pin_5,
@ -152,7 +152,7 @@ static const struct pios_spi_cfg pios_spi_mag_flash_cfg = {
.GPIO_OType = GPIO_OType_PP, .GPIO_OType = GPIO_OType_PP,
}, },
}, },
.miso = { .miso = {
.gpio = GPIOA, .gpio = GPIOA,
.init = { .init = {
.GPIO_Pin = GPIO_Pin_6, .GPIO_Pin = GPIO_Pin_6,
@ -161,7 +161,7 @@ static const struct pios_spi_cfg pios_spi_mag_flash_cfg = {
.GPIO_OType = GPIO_OType_OD, .GPIO_OType = GPIO_OType_OD,
}, },
}, },
.mosi = { .mosi = {
.gpio = GPIOA, .gpio = GPIOA,
.init = { .init = {
.GPIO_Pin = GPIO_Pin_7, .GPIO_Pin = GPIO_Pin_7,
@ -170,8 +170,8 @@ static const struct pios_spi_cfg pios_spi_mag_flash_cfg = {
.GPIO_OType = GPIO_OType_PP, .GPIO_OType = GPIO_OType_PP,
}, },
}, },
.slave_count = 2, .slave_count = 2,
.ssel = { .ssel = {
{ {
.gpio = GPIOA, .gpio = GPIOA,
.init = { .init = {
@ -233,7 +233,7 @@ static const struct pios_exti_cfg pios_exti_mag_cfg __exti_config = {
}, },
}, },
}; };
#endif #endif /* ifdef PIOS_HMC5x83_HAS_GPIOS */
static const struct pios_hmc5x83_cfg pios_mag_cfg = { static const struct pios_hmc5x83_cfg pios_mag_cfg = {
#ifdef PIOS_HMC5x83_HAS_GPIOS #ifdef PIOS_HMC5x83_HAS_GPIOS
@ -241,9 +241,9 @@ static const struct pios_hmc5x83_cfg pios_mag_cfg = {
#endif #endif
.M_ODR = PIOS_HMC5x83_ODR_75, .M_ODR = PIOS_HMC5x83_ODR_75,
.Meas_Conf = PIOS_HMC5x83_MEASCONF_NORMAL, .Meas_Conf = PIOS_HMC5x83_MEASCONF_NORMAL,
.Gain = PIOS_HMC5x83_GAIN_1_9, .Gain = PIOS_HMC5x83_GAIN_1_9,
.Mode = PIOS_HMC5x83_MODE_CONTINUOUS, .Mode = PIOS_HMC5x83_MODE_CONTINUOUS,
.Driver = &PIOS_HMC5x83_SPI_DRIVER, .Driver = &PIOS_HMC5x83_SPI_DRIVER,
}; };
#endif /* PIOS_INCLUDE_HMC5883 */ #endif /* PIOS_INCLUDE_HMC5883 */
@ -255,24 +255,24 @@ static const struct pios_hmc5x83_cfg pios_mag_cfg = {
#include "pios_usart_priv.h" #include "pios_usart_priv.h"
static const struct pios_usart_cfg pios_usart_generic_main_cfg = { static const struct pios_usart_cfg pios_usart_generic_main_cfg = {
.regs = USART1, .regs = USART1,
.remap = GPIO_AF_1, .remap = GPIO_AF_1,
.init = { .init = {
.USART_BaudRate = 115200, .USART_BaudRate = 115200,
.USART_WordLength = USART_WordLength_8b, .USART_WordLength = USART_WordLength_8b,
.USART_Parity = USART_Parity_No, .USART_Parity = USART_Parity_No,
.USART_StopBits = USART_StopBits_1, .USART_StopBits = USART_StopBits_1,
.USART_HardwareFlowControl = USART_HardwareFlowControl_None, .USART_HardwareFlowControl = USART_HardwareFlowControl_None,
.USART_Mode = USART_Mode_Rx | USART_Mode_Tx, .USART_Mode = USART_Mode_Rx | USART_Mode_Tx,
}, },
.irq = { .irq = {
.init = { .init = {
.NVIC_IRQChannel = USART1_IRQn, .NVIC_IRQChannel = USART1_IRQn,
.NVIC_IRQChannelPriority = PIOS_IRQ_PRIO_MID, .NVIC_IRQChannelPriority = PIOS_IRQ_PRIO_MID,
.NVIC_IRQChannelCmd = ENABLE, .NVIC_IRQChannelCmd = ENABLE,
}, },
}, },
.rx = { .rx = {
.gpio = GPIOA, .gpio = GPIOA,
.init = { .init = {
.GPIO_Pin = GPIO_Pin_10, .GPIO_Pin = GPIO_Pin_10,
@ -281,7 +281,7 @@ static const struct pios_usart_cfg pios_usart_generic_main_cfg = {
.GPIO_Mode = GPIO_Mode_AF, .GPIO_Mode = GPIO_Mode_AF,
}, },
}, },
.tx = { .tx = {
.gpio = GPIOA, .gpio = GPIOA,
.init = { .init = {
.GPIO_Pin = GPIO_Pin_9, .GPIO_Pin = GPIO_Pin_9,
@ -311,8 +311,8 @@ void RTC_IRQHandler() __attribute__((alias("PIOS_RTC_IRQ_Handler")));
static const struct pios_rtc_cfg pios_rtc_main_cfg = { static const struct pios_rtc_cfg pios_rtc_main_cfg = {
.clksrc = RCC_RTCCLKSource_LSI, .clksrc = RCC_RTCCLKSource_LSI,
.prescaler = 100, .prescaler = 100,
.irq = { .irq = {
.init = { .init = {
.NVIC_IRQChannel = RTC_IRQn, .NVIC_IRQChannel = RTC_IRQn,
.NVIC_IRQChannelPriority = PIOS_IRQ_PRIO_MID, .NVIC_IRQChannelPriority = PIOS_IRQ_PRIO_MID,
.NVIC_IRQChannelCmd = ENABLE, .NVIC_IRQChannelCmd = ENABLE,
@ -336,52 +336,56 @@ void PIOS_RTC_IRQ_Handler(void)
*/ */
void PIOS_I2C_gps_irq_handler(void); void PIOS_I2C_gps_irq_handler(void);
void I2C2_IRQHandler() __attribute__((alias("PIOS_I2C_gps_irq_handler"))); void I2C1_IRQHandler() __attribute__((alias("PIOS_I2C_gps_irq_handler")));
static const struct pios_i2c_adapter_cfg pios_i2c_gps_cfg = { static const struct pios_i2c_adapter_cfg pios_i2c_gps_cfg = {
.regs = I2C2, .remap = GPIO_AF_1,
.init = { .regs = I2C1,
.I2C_Mode = I2C_Mode_I2C, .init = {
.I2C_OwnAddress1 = 0, .I2C_Mode = I2C_Mode_I2C,
.I2C_Ack = I2C_Ack_Enable, .I2C_AnalogFilter = I2C_AnalogFilter_Enable,
.I2C_AcknowledgedAddress = I2C_AcknowledgedAddress_7bit, .I2C_DigitalFilter = 0x00,
/* (3) Timing register value is computed with the AN4235 xls file, .I2C_OwnAddress1 = 0x00,
fast Mode @400kHz with I2CCLK = 48MHz, rise time = 140ns, .I2C_Ack = I2C_Ack_Enable,
fall time = 40ns */ .I2C_AcknowledgedAddress = I2C_AcknowledgedAddress_7bit,
.I2C_Timing = (uint32_t)0x00B01A4B, .I2C_Timing = (uint32_t)0x00210507,
}, },
.transfer_timeout_ms = 50, .transfer_timeout_ms = 50,
.scl = { .scl = {
.gpio = GPIOB, .gpio = GPIOB,
.init = { .init = {
.GPIO_Pin = GPIO_Pin_6,
.GPIO_Speed = GPIO_Speed_2MHz, .GPIO_Speed = GPIO_Speed_2MHz,
.GPIO_OType = GPIO_OType_OD, .GPIO_OType = GPIO_OType_OD,
.GPIO_PuPd = GPIO_PuPd_NOPULL,
.GPIO_Mode = GPIO_Mode_AF, .GPIO_Mode = GPIO_Mode_AF,
.GPIO_Pin = GPIO_Pin_10,
}, },
.pin_source = GPIO_PinSource6,
}, },
.sda = { .sda = {
.gpio = GPIOB, .gpio = GPIOB,
.init = { .init = {
.GPIO_Pin = GPIO_Pin_11, .GPIO_Pin = GPIO_Pin_7,
.GPIO_Speed = GPIO_Speed_2MHz, .GPIO_Speed = GPIO_Speed_2MHz,
.GPIO_OType = GPIO_OType_OD, .GPIO_OType = GPIO_OType_OD,
.GPIO_PuPd = GPIO_PuPd_NOPULL,
.GPIO_Mode = GPIO_Mode_AF, .GPIO_Mode = GPIO_Mode_AF,
}, },
.pin_source = GPIO_PinSource7,
}, },
.event = { .event = {
.flags = 0, /* FIXME: check this */ .flags = 0,
.init = { .init = {
.NVIC_IRQChannel = I2C2_IRQn, .NVIC_IRQChannel = I2C1_IRQn,
.NVIC_IRQChannelPriority = PIOS_IRQ_PRIO_HIGHEST, .NVIC_IRQChannelPriority = PIOS_IRQ_PRIO_HIGH,
.NVIC_IRQChannelCmd = ENABLE, .NVIC_IRQChannelCmd = ENABLE,
}, },
}, },
.error = { .error = {
.flags = 0, /* FIXME: check this */ .flags = 0,
.init = { .init = {
.NVIC_IRQChannel = I2C2_IRQn, .NVIC_IRQChannel = I2C1_IRQn,
.NVIC_IRQChannelPriority = PIOS_IRQ_PRIO_HIGHEST, .NVIC_IRQChannelPriority = PIOS_IRQ_PRIO_HIGH,
.NVIC_IRQChannelCmd = ENABLE, .NVIC_IRQChannelCmd = ENABLE,
}, },
}, },
@ -395,7 +399,6 @@ void PIOS_I2C_gps_irq_handler(void)
} }
#endif /* PIOS_INCLUDE_I2C */ #endif /* PIOS_INCLUDE_I2C */
#if defined(PIOS_INCLUDE_COM_MSG) #if defined(PIOS_INCLUDE_COM_MSG)

View File

@ -59,9 +59,9 @@ uint8_t tempcount = 0;
/* Extern variables ----------------------------------------------------------*/ /* Extern variables ----------------------------------------------------------*/
DFUStates DeviceState; DFUStates DeviceState;
int16_t status = 0; int16_t status = 0;
bool JumpToApp = false; bool JumpToApp = false;
bool GO_dfu = false; bool GO_dfu = false;
bool User_DFU_request = false; bool User_DFU_request = false;
static uint8_t mReceive_Buffer[63]; static uint8_t mReceive_Buffer[63];
/* Private function prototypes -----------------------------------------------*/ /* Private function prototypes -----------------------------------------------*/

View File

@ -67,12 +67,14 @@ void PIOS_Board_Init(void)
board_init_complete = true; board_init_complete = true;
} }
void setupCom(){ void setupCom()
{
uint32_t pios_usart_generic_id; uint32_t pios_usart_generic_id;
if (PIOS_USART_Init(&pios_usart_generic_id, &pios_usart_generic_main_cfg)) { if (PIOS_USART_Init(&pios_usart_generic_id, &pios_usart_generic_main_cfg)) {
PIOS_Assert(0); PIOS_Assert(0);
} }
if (PIOS_COM_MSG_Init(&PIOS_COM_TELEM_USB, &pios_usart_com_driver, pios_usart_generic_id)) { if (PIOS_COM_MSG_Init(&PIOS_COM_TELEM_USB, &pios_usart_com_driver, pios_usart_generic_id)) {
PIOS_Assert(0); PIOS_Assert(0);
} }
} }

View File

@ -51,8 +51,8 @@ SRC += $(CMSIS_DEVICEDIR)/system_stm32f0xx.c
SRC += $(OPSYSTEM)/gpsp.c SRC += $(OPSYSTEM)/gpsp.c
SRC += $(OPSYSTEM)/pios_board.c SRC += $(OPSYSTEM)/pios_board.c
#SRC += $(FLIGHTLIB)/alarms.c #SRC += $(FLIGHTLIB)/alarms.c
SRC += $(OPUAVOBJ)/uavobjectmanager.c #SRC += $(OPUAVOBJ)/uavobjectmanager.c
SRC += $(OPUAVOBJ)/eventdispatcher.c #SRC += $(OPUAVOBJ)/eventdispatcher.c
SRC += $(PIOSCOMMON)/pios_hmc5x83.c SRC += $(PIOSCOMMON)/pios_hmc5x83.c

View File

@ -1,22 +1,22 @@
/* /*
FreeRTOS V8.0.0 - Copyright (C) 2014 Real Time Engineers Ltd. FreeRTOS V8.0.0 - Copyright (C) 2014 Real Time Engineers Ltd.
All rights reserved All rights reserved
VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION. VISIT http://www.FreeRTOS.org TO ENSURE YOU ARE USING THE LATEST VERSION.
*************************************************************************** ***************************************************************************
* * * *
* FreeRTOS provides completely free yet professionally developed, * * FreeRTOS provides completely free yet professionally developed, *
* robust, strictly quality controlled, supported, and cross * * robust, strictly quality controlled, supported, and cross *
* platform software that has become a de facto standard. * * platform software that has become a de facto standard. *
* * * *
* Help yourself get started quickly and support the FreeRTOS * * Help yourself get started quickly and support the FreeRTOS *
* project by purchasing a FreeRTOS tutorial book, reference * * project by purchasing a FreeRTOS tutorial book, reference *
* manual, or both from: http://www.FreeRTOS.org/Documentation * * manual, or both from: http://www.FreeRTOS.org/Documentation *
* * * *
* Thank you! * * Thank you! *
* * * *
*************************************************************************** ***************************************************************************
This file is part of the FreeRTOS distribution. This file is part of the FreeRTOS distribution.
@ -36,14 +36,14 @@
1 tab == 4 spaces! 1 tab == 4 spaces!
*************************************************************************** ***************************************************************************
* * * *
* Having a problem? Start by reading the FAQ "My application does * * Having a problem? Start by reading the FAQ "My application does *
* not run, what could be wrong?" * * not run, what could be wrong?" *
* * * *
* http://www.FreeRTOS.org/FAQHelp.html * * http://www.FreeRTOS.org/FAQHelp.html *
* * * *
*************************************************************************** ***************************************************************************
http://www.FreeRTOS.org - Documentation, books, training, latest versions, http://www.FreeRTOS.org - Documentation, books, training, latest versions,
license and Real Time Engineers Ltd. contact details. license and Real Time Engineers Ltd. contact details.
@ -61,23 +61,23 @@
mission critical applications that require provable dependability. mission critical applications that require provable dependability.
1 tab == 4 spaces! 1 tab == 4 spaces!
*/ */
#ifndef FREERTOS_CONFIG_H #ifndef FREERTOS_CONFIG_H
#define FREERTOS_CONFIG_H #define FREERTOS_CONFIG_H
/*----------------------------------------------------------- /*-----------------------------------------------------------
* Application specific definitions. * Application specific definitions.
* *
* These definitions should be adjusted for your particular hardware and * These definitions should be adjusted for your particular hardware and
* application requirements. * application requirements.
* *
* THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE * THESE PARAMETERS ARE DESCRIBED WITHIN THE 'CONFIGURATION' SECTION OF THE
* FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE. * FreeRTOS API DOCUMENTATION AVAILABLE ON THE FreeRTOS.org WEB SITE.
* *
* See http://www.freertos.org/a00110.html. * See http://www.freertos.org/a00110.html.
*----------------------------------------------------------*/ *----------------------------------------------------------*/
/** /**
* @addtogroup PIOS PIOS * @addtogroup PIOS PIOS
@ -90,33 +90,33 @@
#define configUSE_PREEMPTION 1 #define configUSE_PREEMPTION 1
#define configUSE_IDLE_HOOK 1 #define configUSE_IDLE_HOOK 1
#define configUSE_TICK_HOOK 0 #define configUSE_TICK_HOOK 0
#define configCPU_CLOCK_HZ ( 48000000 ) #define configCPU_CLOCK_HZ (48000000)
#define configTICK_RATE_HZ ( ( TickType_t ) 1000 ) #define configTICK_RATE_HZ ((TickType_t)1000)
#define configMAX_PRIORITIES ( 5 ) #define configMAX_PRIORITIES (5)
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 60 ) #define configMINIMAL_STACK_SIZE ((unsigned short)40)
#define configTOTAL_HEAP_SIZE ((size_t)(2048)) #define configTOTAL_HEAP_SIZE ((size_t)(2048))
#define configMAX_TASK_NAME_LEN ( 5 ) #define configMAX_TASK_NAME_LEN (5)
#define configUSE_TRACE_FACILITY 0 #define configUSE_TRACE_FACILITY 0
#define configUSE_16_BIT_TICKS 0 #define configUSE_16_BIT_TICKS 0
#define configIDLE_SHOULD_YIELD 1 #define configIDLE_SHOULD_YIELD 1
#define configUSE_MUTEXES 1 #define configUSE_MUTEXES 1
#define configQUEUE_REGISTRY_SIZE 4 #define configQUEUE_REGISTRY_SIZE 0
#define configCHECK_FOR_STACK_OVERFLOW 2 #define configCHECK_FOR_STACK_OVERFLOW 2
#define configUSE_RECURSIVE_MUTEXES 1 #define configUSE_RECURSIVE_MUTEXES 1
#define configUSE_MALLOC_FAILED_HOOK 1 #define configUSE_MALLOC_FAILED_HOOK 1
#define configUSE_APPLICATION_TASK_TAG 0 #define configUSE_APPLICATION_TASK_TAG 0
#define configUSE_COUNTING_SEMAPHORES 1 #define configUSE_COUNTING_SEMAPHORES 1
#define configGENERATE_RUN_TIME_STATS 0 #define configGENERATE_RUN_TIME_STATS 0
/* Co-routine definitions. */ /* Co-routine definitions. */
#define configUSE_CO_ROUTINES 0 #define configUSE_CO_ROUTINES 0
#define configMAX_CO_ROUTINE_PRIORITIES ( 2 ) #define configMAX_CO_ROUTINE_PRIORITIES (2)
/* Software timer definitions. */ /* Software timer definitions. */
#define configUSE_TIMERS 1 #define configUSE_TIMERS 0
#define configTIMER_TASK_PRIORITY ( 2 ) #define configTIMER_TASK_PRIORITY (2)
#define configTIMER_QUEUE_LENGTH 5 #define configTIMER_QUEUE_LENGTH 5
#define configTIMER_TASK_STACK_DEPTH ( 80 ) #define configTIMER_TASK_STACK_DEPTH (80)
/* Set the following definitions to 1 to include the API function, or zero /* Set the following definitions to 1 to include the API function, or zero
to exclude the API function. */ to exclude the API function. */
@ -135,7 +135,7 @@
/* This is the raw value as per the Cortex-M3 NVIC. Values can be 255 /* This is the raw value as per the Cortex-M3 NVIC. Values can be 255
(lowest) to 1 (highest maskable) to 0 (highest non-maskable). */ (lowest) to 1 (highest maskable) to 0 (highest non-maskable). */
#define configKERNEL_INTERRUPT_PRIORITY 15 << 4 /* equivalent to NVIC priority 15 */ #define configKERNEL_INTERRUPT_PRIORITY 15 << 4 /* equivalent to NVIC priority 15 */
#define configMAX_SYSCALL_INTERRUPT_PRIORITY 3 << 4 /* equivalent to NVIC priority 3 */ #define configMAX_SYSCALL_INTERRUPT_PRIORITY 3 << 4 /* equivalent to NVIC priority 3 */
/* This is the value being used as per the ST library which permits 16 /* This is the value being used as per the ST library which permits 16
priority values, 0 to 15. This must correspond to the priority values, 0 to 15. This must correspond to the
@ -145,20 +145,21 @@
/* Enable run time stats collection */ /* Enable run time stats collection */
#define configGENERATE_RUN_TIME_STATS 0 #define configGENERATE_RUN_TIME_STATS 0
#define INCLUDE_uxTaskGetRunTime 0 #define INCLUDE_uxTaskGetRunTime 0
#define INCLUDE_xTaskGetIdleTaskHandle 1 #define INCLUDE_xTaskGetIdleTaskHandle 1
/* Normal assert() semantics without relying on the provision of an assert.h /* Normal assert() semantics without relying on the provision of an assert.h
header file. */ header file. */
#define configASSERT( x ) if( ( x ) == 0 ) { taskDISABLE_INTERRUPTS(); for( ;; ); } #define configASSERT(x) \
if ((x) == 0) { taskDISABLE_INTERRUPTS(); for (;;) {; } \
}
/* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS /* Definitions that map the FreeRTOS port interrupt handlers to their CMSIS
standard names - or at least those used in the unmodified vector table. */ standard names - or at least those used in the unmodified vector table. */
#define vPortSVCHandler SVC_Handler #define vPortSVCHandler SVC_Handler
#define xPortPendSVHandler PendSV_Handler #define xPortPendSVHandler PendSV_Handler
#define xPortSysTickHandler SysTick_Handler #define xPortSysTickHandler SysTick_Handler
/** /**
@ -166,4 +167,3 @@ standard names - or at least those used in the unmodified vector table. */
*/ */
#endif /* FREERTOS_CONFIG_H */ #endif /* FREERTOS_CONFIG_H */

View File

@ -45,7 +45,7 @@
/* PIOS CallbackScheduler support */ /* PIOS CallbackScheduler support */
#define PIOS_INCLUDE_CALLBACKSCHEDULER // #define PIOS_INCLUDE_CALLBACKSCHEDULER
/* PIOS bootloader helper */ /* PIOS bootloader helper */
#define PIOS_INCLUDE_BL_HELPER #define PIOS_INCLUDE_BL_HELPER
@ -55,32 +55,32 @@
#define PIOS_INCLUDE_DELAY #define PIOS_INCLUDE_DELAY
#define PIOS_INCLUDE_INITCALL #define PIOS_INCLUDE_INITCALL
#define PIOS_INCLUDE_SYS #define PIOS_INCLUDE_SYS
#define PIOS_INCLUDE_TASK_MONITOR // #define PIOS_INCLUDE_TASK_MONITOR
/* PIOS hardware peripherals */ /* PIOS hardware peripherals */
#define PIOS_INCLUDE_IRQ #define PIOS_INCLUDE_IRQ
#define PIOS_INCLUDE_RTC #define PIOS_INCLUDE_RTC
//#define PIOS_INCLUDE_TIM // #define PIOS_INCLUDE_TIM
#define PIOS_INCLUDE_USART #define PIOS_INCLUDE_USART
//#define PIOS_INCLUDE_ADC // #define PIOS_INCLUDE_ADC
//#define PIOS_INCLUDE_I2C #define PIOS_INCLUDE_I2C
#define PIOS_INCLUDE_SPI #define PIOS_INCLUDE_SPI
#define PIOS_INCLUDE_GPIO #define PIOS_INCLUDE_GPIO
#define PIOS_INCLUDE_EXTI #define PIOS_INCLUDE_EXTI
//#define PIOS_INCLUDE_WDG // #define PIOS_INCLUDE_WDG
/* PIOS USB functions */ /* PIOS USB functions */
//#define PIOS_INCLUDE_USB // #define PIOS_INCLUDE_USB
//#define PIOS_INCLUDE_USB_HID // #define PIOS_INCLUDE_USB_HID
//#define PIOS_INCLUDE_USB_CDC // #define PIOS_INCLUDE_USB_CDC
//#define PIOS_INCLUDE_USB_RCTX // #define PIOS_INCLUDE_USB_RCTX
/* PIOS sensor interfaces */ /* PIOS sensor interfaces */
//#define PIOS_INCLUDE_ADXL345 // #define PIOS_INCLUDE_ADXL345
/* #define PIOS_INCLUDE_BMA180 */ /* #define PIOS_INCLUDE_BMA180 */
/* #define PIOS_INCLUDE_L3GD20 */ /* #define PIOS_INCLUDE_L3GD20 */
//#define PIOS_INCLUDE_MPU6000 // #define PIOS_INCLUDE_MPU6000
//#define PIOS_MPU6000_ACCEL // #define PIOS_MPU6000_ACCEL
/* #define PIOS_INCLUDE_HMC5843 */ /* #define PIOS_INCLUDE_HMC5843 */
/* #define PIOS_INCLUDE_HMC5883 */ /* #define PIOS_INCLUDE_HMC5883 */
#define PIOS_INCLUDE_HMC5X83 #define PIOS_INCLUDE_HMC5X83
@ -92,28 +92,28 @@
/* #define PIOS_INCLUDE_HCSR04 */ /* #define PIOS_INCLUDE_HCSR04 */
/* PIOS receiver drivers */ /* PIOS receiver drivers */
//#define PIOS_INCLUDE_PWM // #define PIOS_INCLUDE_PWM
//#define PIOS_INCLUDE_PPM // #define PIOS_INCLUDE_PPM
//#define PIOS_INCLUDE_PPM_FLEXI // #define PIOS_INCLUDE_PPM_FLEXI
//#define PIOS_INCLUDE_DSM // #define PIOS_INCLUDE_DSM
//#define PIOS_INCLUDE_SBUS // #define PIOS_INCLUDE_SBUS
//#define PIOS_INCLUDE_GCSRCVR // #define PIOS_INCLUDE_GCSRCVR
//#define PIOS_INCLUDE_OPLINKRCVR // #define PIOS_INCLUDE_OPLINKRCVR
/* PIOS abstract receiver interface */ /* PIOS abstract receiver interface */
//#define PIOS_INCLUDE_RCVR // #define PIOS_INCLUDE_RCVR
/* PIOS common peripherals */ /* PIOS common peripherals */
#define PIOS_INCLUDE_LED #define PIOS_INCLUDE_LED
#define PIOS_INCLUDE_IAP #define PIOS_INCLUDE_IAP
//#define PIOS_INCLUDE_SERVO // #define PIOS_INCLUDE_SERVO
/* #define PIOS_INCLUDE_I2C_ESC */ /* #define PIOS_INCLUDE_I2C_ESC */
/* #define PIOS_INCLUDE_OVERO */ /* #define PIOS_INCLUDE_OVERO */
/* #define PIOS_OVERO_SPI */ /* #define PIOS_OVERO_SPI */
/* #define PIOS_INCLUDE_SDCARD */ /* #define PIOS_INCLUDE_SDCARD */
/* #define LOG_FILENAME "startup.log" */ /* #define LOG_FILENAME "startup.log" */
//#define PIOS_INCLUDE_FLASH // #define PIOS_INCLUDE_FLASH
//#define PIOS_INCLUDE_FLASH_LOGFS_SETTINGS // #define PIOS_INCLUDE_FLASH_LOGFS_SETTINGS
/* #define FLASH_FREERTOS */ /* #define FLASH_FREERTOS */
/* #define PIOS_INCLUDE_FLASH_EEPROM */ /* #define PIOS_INCLUDE_FLASH_EEPROM */
/* #define PIOS_INCLUDE_FLASH_INTERNAL */ /* #define PIOS_INCLUDE_FLASH_INTERNAL */
@ -133,41 +133,41 @@
#define PIOS_INCLUDE_COM #define PIOS_INCLUDE_COM
#define PIOS_INCLUDE_DEBUG_CONSOLE #define PIOS_INCLUDE_DEBUG_CONSOLE
/* #define PIOS_INCLUDE_COM_MSG */ /* #define PIOS_INCLUDE_COM_MSG */
//#define PIOS_INCLUDE_TELEMETRY_RF // #define PIOS_INCLUDE_TELEMETRY_RF
/* #define PIOS_INCLUDE_COM_TELEM */ /* #define PIOS_INCLUDE_COM_TELEM */
/* #define PIOS_INCLUDE_COM_FLEXI */ /* #define PIOS_INCLUDE_COM_FLEXI */
/* #define PIOS_INCLUDE_COM_AUX */ /* #define PIOS_INCLUDE_COM_AUX */
/* #define PIOS_TELEM_PRIORITY_QUEUE */ /* #define PIOS_TELEM_PRIORITY_QUEUE */
//#define PIOS_INCLUDE_GPS // #define PIOS_INCLUDE_GPS
//#define PIOS_GPS_MINIMAL // #define PIOS_GPS_MINIMAL
//#define PIOS_INCLUDE_GPS_NMEA_PARSER // #define PIOS_INCLUDE_GPS_NMEA_PARSER
//#define PIOS_INCLUDE_GPS_UBX_PARSER // #define PIOS_INCLUDE_GPS_UBX_PARSER
/* #define PIOS_GPS_SETS_HOMELOCATION */ /* #define PIOS_GPS_SETS_HOMELOCATION */
/* Stabilization options */ /* Stabilization options */
/* #define PIOS_QUATERNION_STABILIZATION */ /* #define PIOS_QUATERNION_STABILIZATION */
/* Alarm Thresholds */ /* Alarm Thresholds */
#define HEAP_LIMIT_WARNING 220 #define HEAP_LIMIT_WARNING 220
#define HEAP_LIMIT_CRITICAL 40 #define HEAP_LIMIT_CRITICAL 40
#define IRQSTACK_LIMIT_WARNING 100 #define IRQSTACK_LIMIT_WARNING 100
#define IRQSTACK_LIMIT_CRITICAL 60 #define IRQSTACK_LIMIT_CRITICAL 60
#define CPULOAD_LIMIT_WARNING 85 #define CPULOAD_LIMIT_WARNING 85
#define CPULOAD_LIMIT_CRITICAL 95 #define CPULOAD_LIMIT_CRITICAL 95
/* Task stack sizes */ /* Task stack sizes */
//#define PIOS_ACTUATOR_STACK_SIZE 1020 // #define PIOS_ACTUATOR_STACK_SIZE 1020
//#define PIOS_MANUAL_STACK_SIZE 850 // #define PIOS_MANUAL_STACK_SIZE 850
//#ifdef DIAG_TASKS // #ifdef DIAG_TASKS
//#define PIOS_SYSTEM_STACK_SIZE 720 // #define PIOS_SYSTEM_STACK_SIZE 720
//#else // #else
//#define PIOS_SYSTEM_STACK_SIZE 660 // #define PIOS_SYSTEM_STACK_SIZE 660
//#endif // #endif
//#define PIOS_TELEM_STACK_SIZE 540 // #define PIOS_TELEM_STACK_SIZE 540
//#define PIOS_EVENTDISPATCHER_STACK_SIZE 160 // #define PIOS_EVENTDISPATCHER_STACK_SIZE 160
/* This can't be too high to stop eventdispatcher thread overflowing */ /* This can't be too high to stop eventdispatcher thread overflowing */
//#define PIOS_EVENTDISAPTCHER_QUEUE 10 // #define PIOS_EVENTDISAPTCHER_QUEUE 10
/* Revolution series */ /* Revolution series */
/* #define REVOLUTION */ /* #define REVOLUTION */

View File

@ -43,12 +43,11 @@
*/ */
#include "../board_hw_defs.c" #include "../board_hw_defs.c"
#define PIOS_COM_MAIN_RX_BUF_LEN 16 #define PIOS_COM_MAIN_RX_BUF_LEN 16
#define PIOS_COM_MAIN_TX_BUF_LEN 255 #define PIOS_COM_MAIN_TX_BUF_LEN 128
uint32_t pios_com_main_id; uint32_t pios_com_main_id;
/** /**
* PIOS_Board_Init() * PIOS_Board_Init()
* initializes all the core subsystems on this specific hardware * initializes all the core subsystems on this specific hardware
@ -80,10 +79,7 @@ void PIOS_Board_Init(void)
#endif #endif
#endif #endif
/* Initialize the task monitor */
if (PIOS_TASK_MONITOR_Initialize(3)) {
PIOS_Assert(0);
}
#if defined(PIOS_INCLUDE_RTC) #if defined(PIOS_INCLUDE_RTC)
/* Initialize the real-time clock and its associated tick */ /* Initialize the real-time clock and its associated tick */
PIOS_RTC_Init(&pios_rtc_main_cfg); PIOS_RTC_Init(&pios_rtc_main_cfg);
@ -127,7 +123,6 @@ if (PIOS_TASK_MONITOR_Initialize(3)) {
} }
} }
#endif /* PIOS_INCLUDE_I2C */ #endif /* PIOS_INCLUDE_I2C */
} }
/** /**

View File

@ -98,8 +98,8 @@
// See also pios_board.c // See also pios_board.c
// ------------------------ // ------------------------
#define PIOS_I2C_MAX_DEVS 1 #define PIOS_I2C_MAX_DEVS 1
extern uint32_t pios_i2c_gps_adapter_id; extern uint32_t pios_i2c_gps_id;
#define PIOS_I2C_GPS (pios_i2c_gps_adapter_id) #define PIOS_I2C_GPS (pios_i2c_gps_id)
// ------------------------- // -------------------------
// SPI // SPI