Create tasks for hcan1 and hcan2
This commit is contained in:
+22
-12
@@ -48,12 +48,19 @@ SD_HandleTypeDef hsd;
|
||||
DMA_HandleTypeDef hdma_sdio_rx;
|
||||
DMA_HandleTypeDef hdma_sdio_tx;
|
||||
|
||||
/* Definitions for defaultTask */
|
||||
osThreadId_t defaultTaskHandle;
|
||||
const osThreadAttr_t defaultTask_attributes = {
|
||||
.name = "defaultTask",
|
||||
/* Definitions for canBus1Listen */
|
||||
osThreadId_t canBus1ListenHandle;
|
||||
const osThreadAttr_t canBus1Listen_attributes = {
|
||||
.name = "canBus1Listen",
|
||||
.stack_size = 128 * 4,
|
||||
.priority = (osPriority_t) osPriorityNormal,
|
||||
.priority = (osPriority_t) osPriorityRealtime1,
|
||||
};
|
||||
/* Definitions for canBus2Listen */
|
||||
osThreadId_t canBus2ListenHandle;
|
||||
const osThreadAttr_t canBus2Listen_attributes = {
|
||||
.name = "canBus2Listen",
|
||||
.stack_size = 128 * 4,
|
||||
.priority = (osPriority_t) osPriorityRealtime,
|
||||
};
|
||||
/* USER CODE BEGIN PV */
|
||||
|
||||
@@ -66,7 +73,7 @@ static void MX_DMA_Init(void);
|
||||
static void MX_CAN1_Init(void);
|
||||
static void MX_CAN2_Init(void);
|
||||
static void MX_SDIO_SD_Init(void);
|
||||
void StartDefaultTask(void *argument);
|
||||
void can_listen(void *argument);
|
||||
|
||||
/* USER CODE BEGIN PFP */
|
||||
|
||||
@@ -134,8 +141,11 @@ int main(void)
|
||||
/* USER CODE END RTOS_QUEUES */
|
||||
|
||||
/* Create the thread(s) */
|
||||
/* creation of defaultTask */
|
||||
defaultTaskHandle = osThreadNew(StartDefaultTask, NULL, &defaultTask_attributes);
|
||||
/* creation of canBus1Listen */
|
||||
canBus1ListenHandle = osThreadNew(can_listen, (void*) &hcan1, &canBus1Listen_attributes);
|
||||
|
||||
/* creation of canBus2Listen */
|
||||
canBus2ListenHandle = osThreadNew(can_listen, (void*) &hcan2, &canBus2Listen_attributes);
|
||||
|
||||
/* USER CODE BEGIN RTOS_THREADS */
|
||||
/* add threads, ... */
|
||||
@@ -412,14 +422,14 @@ static void MX_GPIO_Init(void)
|
||||
|
||||
/* USER CODE END 4 */
|
||||
|
||||
/* USER CODE BEGIN Header_StartDefaultTask */
|
||||
/* USER CODE BEGIN Header_can_listen */
|
||||
/**
|
||||
* @brief Function implementing the defaultTask thread.
|
||||
* @brief Function implementing the canBus0Listen thread.
|
||||
* @param argument: Not used
|
||||
* @retval None
|
||||
*/
|
||||
/* USER CODE END Header_StartDefaultTask */
|
||||
void StartDefaultTask(void *argument)
|
||||
/* USER CODE END Header_can_listen */
|
||||
void can_listen(void *argument)
|
||||
{
|
||||
/* USER CODE BEGIN 5 */
|
||||
/* Infinite loop */
|
||||
|
||||
+3
-2
@@ -47,8 +47,9 @@ Dma.SDIO_TX.1.PeriphDataAlignment=DMA_PDATAALIGN_WORD
|
||||
Dma.SDIO_TX.1.PeriphInc=DMA_PINC_DISABLE
|
||||
Dma.SDIO_TX.1.Priority=DMA_PRIORITY_LOW
|
||||
Dma.SDIO_TX.1.RequestParameters=Instance,Direction,PeriphInc,MemInc,PeriphDataAlignment,MemDataAlignment,Mode,Priority,FIFOMode,FIFOThreshold,MemBurst,PeriphBurst
|
||||
FREERTOS.IPParameters=Tasks01,configUSE_NEWLIB_REENTRANT
|
||||
FREERTOS.Tasks01=defaultTask,24,128,StartDefaultTask,Default,NULL,Dynamic,NULL,NULL
|
||||
FREERTOS.FootprintOK=true
|
||||
FREERTOS.IPParameters=Tasks01,configUSE_NEWLIB_REENTRANT,FootprintOK
|
||||
FREERTOS.Tasks01=canBus1Listen,49,128,can_listen,Default,&hcan1,Dynamic,NULL,NULL;canBus2Listen,48,128,can_listen,Default,&hcan2,Dynamic,NULL,NULL
|
||||
FREERTOS.configUSE_NEWLIB_REENTRANT=1
|
||||
File.Version=6
|
||||
GPIO.groupedBy=
|
||||
|
||||
Reference in New Issue
Block a user