/*
* Copyright (c) 2015, Freescale Semiconductor, Inc.
* Copyright 2016-2017 NXP
* All rights reserved.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
/* FreeRTOS kernel includes. */
#include "FreeRTOS.h"
#include "task.h"
#include "queue.h"
#include "timers.h"
/* Freescale includes. */
#include "fsl_device_registers.h"
#include "fsl_debug_console.h"
#include "pin_mux.h"
#include "board.h"
#include <stdbool.h>
/*******************************************************************************
* Definitions
******************************************************************************/
/* Task priorities. */
#define hello_task_PRIORITY (configMAX_PRIORITIES - 1)
/*******************************************************************************
* Prototypes
******************************************************************************/
static void task1(void *pvParameters);
static void task2(void *pvParameters);
static void task3(void *pvParameters);
static void task4(void *pvParameters);
static void task5(void *pvParameters);
static void task6(void *pvParameters);
static void task7(void *pvParameters);
/*******************************************************************************
* Code
******************************************************************************/
/*!
* @brief Application entry point.
*/
int main(void)
{
/* Init board hardware. */
/* attach 12 MHz clock to FLEXCOMM0 (debug console) */
CLOCK_AttachClk(BOARD_DEBUG_UART_CLK_ATTACH);
BOARD_InitBootPins();
BOARD_InitBootClocks();
BOARD_InitDebugConsole();
if (xTaskCreate(task1, "task1", configMINIMAL_STACK_SIZE + 50, NULL, hello_task_PRIORITY, NULL) !=
pdPASS)
{
PRINTF("Task creation failed!.\r\n");
while (1)
;
}
if (xTaskCreate(task2, "task2", configMINIMAL_STACK_SIZE + 100, NULL, hello_task_PRIORITY, NULL) !=
pdPASS)
{
PRINTF("Task creation failed!.\r\n");
while (1)
;
}
if (xTaskCreate(task3, "task3", configMINIMAL_STACK_SIZE + 160, NULL, hello_task_PRIORITY, NULL) !=
pdPASS)
{
PRINTF("Task creation failed!.\r\n");
while (1)
;
}
if (xTaskCreate(task4, "task4", configMINIMAL_STACK_SIZE + 161, NULL, hello_task_PRIORITY, NULL) !=
pdPASS)
{
PRINTF("Task creation failed!.\r\n");
while (1)
;
}
if (xTaskCreate(task5, "task5", configMINIMAL_STACK_SIZE + 170, NULL, hello_task_PRIORITY, NULL) !=
pdPASS)
{
PRINTF("Task creation failed!.\r\n");
while (1)
;
}
if (xTaskCreate(task6, "task6", configMINIMAL_STACK_SIZE + 200, NULL, hello_task_PRIORITY, NULL) !=
pdPASS)
{
PRINTF("Task creation failed!.\r\n");
while (1)
;
}
if (xTaskCreate(task7, "task7", configMINIMAL_STACK_SIZE + 300, NULL, hello_task_PRIORITY, NULL) !=
pdPASS)
{
PRINTF("Task creation failed!.\r\n");
while (1)
;
}
vTaskStartScheduler();
for (;;)
;
}
/*!
* @brief Task responsible for printing of "Hello world." message.
*/
static void task1(void *pvParameters)
{
for (;;)
{
PRINTF("Hello world.\r\n");
vTaskSuspend(NULL);
}
}
static void task2(void *pvParameters)
{
for (;;)
{
PRINTF("H\r\n");
vTaskSuspend(NULL);
}
}
static void task3(void *pvParameters)
{
for (;;)
{
PRINTF("H\r\n");
vTaskSuspend(NULL);
}
}
static void task4(void *pvParameters)
{
for (;;)
{
PRINTF("H\r\n");
vTaskSuspend(NULL);
}
}
static void task5(void *pvParameters)
{
for (;;)
{
PRINTF("H\r\n");
vTaskSuspend(NULL);
}
}
static void task6(void *pvParameters)
{
for (;;)
{
PRINTF("H\r\n");
vTaskSuspend(NULL);
}
}
static void task7(void *pvParameters)
{
for (;;)
{
PRINTF("H\r\n");
vTaskSuspend(NULL);
}
}