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

OP-240 OP-176 Flight: Setting the priority group back to 4 (anything higher

priority preempts) and adjusting the priorities around to be more sensible.

git-svn-id: svn://svn.openpilot.org/OpenPilot/trunk@2355 ebee16cc-31ac-478f-84a7-5cbb03baadba
This commit is contained in:
peabody124 2011-01-09 20:49:26 +00:00 committed by peabody124
parent 79f72bda47
commit 0f07d7f671
7 changed files with 17 additions and 20 deletions

View File

@ -301,8 +301,7 @@ const struct pios_i2c_adapter_cfg pios_i2c_main_adapter_cfg = {
.flags = 0, /* FIXME: check this */ .flags = 0, /* FIXME: check this */
.init = { .init = {
.NVIC_IRQChannel = I2C1_EV_IRQn, .NVIC_IRQChannel = I2C1_EV_IRQn,
//.NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_HIGHEST, .NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_HIGHEST,
.NVIC_IRQChannelPreemptionPriority = 2,
.NVIC_IRQChannelSubPriority = 0, .NVIC_IRQChannelSubPriority = 0,
.NVIC_IRQChannelCmd = ENABLE, .NVIC_IRQChannelCmd = ENABLE,
}, },
@ -312,8 +311,7 @@ const struct pios_i2c_adapter_cfg pios_i2c_main_adapter_cfg = {
.flags = 0, /* FIXME: check this */ .flags = 0, /* FIXME: check this */
.init = { .init = {
.NVIC_IRQChannel = I2C1_ER_IRQn, .NVIC_IRQChannel = I2C1_ER_IRQn,
//.NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_HIGHEST, .NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_HIGHEST,
.NVIC_IRQChannelPreemptionPriority = 2,
.NVIC_IRQChannelSubPriority = 0, .NVIC_IRQChannelSubPriority = 0,
.NVIC_IRQChannelCmd = ENABLE, .NVIC_IRQChannelCmd = ENABLE,
}, },

View File

@ -331,7 +331,7 @@ const struct pios_usart_cfg pios_usart_telem_cfg = {
.handler = PIOS_USART_telem_irq_handler, .handler = PIOS_USART_telem_irq_handler,
.init = { .init = {
.NVIC_IRQChannel = USART2_IRQn, .NVIC_IRQChannel = USART2_IRQn,
.NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_HIGH, .NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_MID,
.NVIC_IRQChannelSubPriority = 0, .NVIC_IRQChannelSubPriority = 0,
.NVIC_IRQChannelCmd = ENABLE, .NVIC_IRQChannelCmd = ENABLE,
}, },
@ -378,7 +378,7 @@ const struct pios_usart_cfg pios_usart_gps_cfg = {
.handler = PIOS_USART_gps_irq_handler, .handler = PIOS_USART_gps_irq_handler,
.init = { .init = {
.NVIC_IRQChannel = USART3_IRQn, .NVIC_IRQChannel = USART3_IRQn,
.NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_HIGH, .NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_MID,
.NVIC_IRQChannelSubPriority = 0, .NVIC_IRQChannelSubPriority = 0,
.NVIC_IRQChannelCmd = ENABLE, .NVIC_IRQChannelCmd = ENABLE,
}, },
@ -426,7 +426,7 @@ const struct pios_usart_cfg pios_usart_aux_cfg = {
.handler = PIOS_USART_aux_irq_handler, .handler = PIOS_USART_aux_irq_handler,
.init = { .init = {
.NVIC_IRQChannel = USART1_IRQn, .NVIC_IRQChannel = USART1_IRQn,
.NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_HIGH, .NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_MID,
.NVIC_IRQChannelSubPriority = 0, .NVIC_IRQChannelSubPriority = 0,
.NVIC_IRQChannelCmd = ENABLE, .NVIC_IRQChannelCmd = ENABLE,
}, },

View File

@ -116,7 +116,7 @@ TIM8 | Servo 5 | Servo 6 | Servo 7 | Servo 8
#define PIOS_BMP085_EOC_CLK RCC_APB2Periph_GPIOC #define PIOS_BMP085_EOC_CLK RCC_APB2Periph_GPIOC
#define PIOS_BMP085_EOC_EXTI_LINE EXTI_Line15 #define PIOS_BMP085_EOC_EXTI_LINE EXTI_Line15
#define PIOS_BMP085_EOC_IRQn EXTI15_10_IRQn #define PIOS_BMP085_EOC_IRQn EXTI15_10_IRQn
#define PIOS_BMP085_EOC_PRIO PIOS_IRQ_PRIO_HIGH #define PIOS_BMP085_EOC_PRIO PIOS_IRQ_PRIO_LOW
//#define PIOS_BMP085_OVERSAMPLING 2 //#define PIOS_BMP085_OVERSAMPLING 2
#define PIOS_BMP085_OVERSAMPLING 3 #define PIOS_BMP085_OVERSAMPLING 3
@ -353,7 +353,7 @@ TIM8 | Servo 5 | Servo 6 | Servo 7 | Servo 8
/* With an ADCCLK = 14 MHz and a sampling time of 293.5 cycles: */ /* With an ADCCLK = 14 MHz and a sampling time of 293.5 cycles: */
/* Tconv = 239.5 + 12.5 = 252 cycles = 18?s */ /* Tconv = 239.5 + 12.5 = 252 cycles = 18?s */
/* (1 / (ADCCLK / CYCLES)) = Sample Time (?S) */ /* (1 / (ADCCLK / CYCLES)) = Sample Time (?S) */
#define PIOS_ADC_IRQ_PRIO PIOS_IRQ_PRIO_HIGH #define PIOS_ADC_IRQ_PRIO PIOS_IRQ_PRIO_MID
//------------------------- //-------------------------
// GPIO // GPIO

View File

@ -68,8 +68,8 @@ void PIOS_PPM_Init(void)
/* Enable timer interrupts */ /* Enable timer interrupts */
NVIC_InitTypeDef NVIC_InitStructure; NVIC_InitTypeDef NVIC_InitStructure;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0; NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_MID;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 1; NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_InitStructure.NVIC_IRQChannel = PIOS_PPM_TIM_IRQ; NVIC_InitStructure.NVIC_IRQChannel = PIOS_PPM_TIM_IRQ;
NVIC_Init(&NVIC_InitStructure); NVIC_Init(&NVIC_InitStructure);
@ -120,8 +120,8 @@ void PIOS_PPM_Init(void)
/* Configure interrupts */ /* Configure interrupts */
NVIC_InitStructure.NVIC_IRQChannel = PIOS_PPM_SUPV_IRQ_CHANNEL; NVIC_InitStructure.NVIC_IRQChannel = PIOS_PPM_SUPV_IRQ_CHANNEL;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0; NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_MID;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 1; NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure); NVIC_Init(&NVIC_InitStructure);

View File

@ -79,8 +79,8 @@ void PIOS_PWM_Init(void)
/* Enable timer interrupts */ /* Enable timer interrupts */
NVIC_InitTypeDef NVIC_InitStructure; NVIC_InitTypeDef NVIC_InitStructure;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0; NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_MID;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 1; NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
for (i = 0; i < PIOS_PWM_NUM_TIMS; i++) { for (i = 0; i < PIOS_PWM_NUM_TIMS; i++) {
NVIC_InitStructure.NVIC_IRQChannel = PIOS_PWM_TIM_IRQ[i]; NVIC_InitStructure.NVIC_IRQChannel = PIOS_PWM_TIM_IRQ[i];
@ -144,8 +144,8 @@ void PIOS_PWM_Init(void)
/* Configure interrupts */ /* Configure interrupts */
NVIC_InitStructure.NVIC_IRQChannel = PIOS_PWM_SUPV_IRQ_CHANNEL; NVIC_InitStructure.NVIC_IRQChannel = PIOS_PWM_SUPV_IRQ_CHANNEL;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0; NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_MID;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 1; NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure); NVIC_Init(&NVIC_InitStructure);

View File

@ -66,8 +66,8 @@ void PIOS_SPEKTRUM_Init(void)
/* Configure interrupts */ /* Configure interrupts */
NVIC_InitStructure.NVIC_IRQChannel = PIOS_SPEKTRUM_SUPV_IRQ_CHANNEL; NVIC_InitStructure.NVIC_IRQChannel = PIOS_SPEKTRUM_SUPV_IRQ_CHANNEL;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = 0; NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_MID;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 1; NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE; NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure); NVIC_Init(&NVIC_InitStructure);

View File

@ -96,7 +96,6 @@ int32_t PIOS_USB_HID_Init(uint32_t mode)
/* Enable the USB Interrupts */ /* Enable the USB Interrupts */
/* 2 bit for pre-emption priority, 2 bits for subpriority */ /* 2 bit for pre-emption priority, 2 bits for subpriority */
NVIC_InitTypeDef NVIC_InitStructure; NVIC_InitTypeDef NVIC_InitStructure;
NVIC_PriorityGroupConfig(NVIC_PriorityGroup_2);
NVIC_InitStructure.NVIC_IRQChannel = USB_LP_CAN1_RX0_IRQn; NVIC_InitStructure.NVIC_IRQChannel = USB_LP_CAN1_RX0_IRQn;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_LOW; NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = PIOS_IRQ_PRIO_LOW;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0; NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;