added support for FreeRTOS

This commit is contained in:
suiauthon 2016-02-15 11:21:10 +01:00
parent b4f6e1e553
commit ada61ef06b
2 changed files with 10 additions and 4 deletions

View File

@ -873,14 +873,17 @@ uavcan::int16_t CanDriver::select(uavcan::CanSelectMasks& inout_masks,
static void nvicEnableVector(IRQn_Type irq, uint8_t prio)
{
/*NVIC_InitTypeDef NVIC_InitStructure;
#if !defined (USE_HAL_DRIVER)
NVIC_InitTypeDef NVIC_InitStructure;
NVIC_InitStructure.NVIC_IRQChannel = irq;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = prio;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);*/
NVIC_Init(&NVIC_InitStructure);
#else
HAL_NVIC_SetPriority(irq, prio, 0);
HAL_NVIC_EnableIRQ(irq);
#endif
}
#endif

View File

@ -85,14 +85,17 @@ uavcan::uint64_t time_utc = 0;
static void nvicEnableVector(IRQn_Type irq, uint8_t prio)
{
/*NVIC_InitTypeDef NVIC_InitStructure;
#if !defined (USE_HAL_DRIVER)
NVIC_InitTypeDef NVIC_InitStructure;
NVIC_InitStructure.NVIC_IRQChannel = irq;
NVIC_InitStructure.NVIC_IRQChannelPreemptionPriority = prio;
NVIC_InitStructure.NVIC_IRQChannelSubPriority = 0;
NVIC_InitStructure.NVIC_IRQChannelCmd = ENABLE;
NVIC_Init(&NVIC_InitStructure);*/
NVIC_Init(&NVIC_InitStructure);
#else
HAL_NVIC_SetPriority(irq, prio, 0);
HAL_NVIC_EnableIRQ(irq);
#endif
}