RT1050_FreeRTOS_Hello/source/freertos_hello.c

68 lines
1.6 KiB
C
Raw Permalink Normal View History

2021-02-03 17:44:12 +00:00
/*
* 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 "queue.h"
2021-03-07 18:01:49 +00:00
#include "task.h"
2021-02-03 17:44:12 +00:00
#include "timers.h"
/* Freescale includes. */
2021-03-07 18:01:49 +00:00
#include "board.h"
#include "clock_config.h"
2021-02-03 17:44:12 +00:00
#include "fsl_debug_console.h"
2021-03-07 18:01:49 +00:00
#include "fsl_device_registers.h"
2021-02-08 17:13:48 +00:00
#include "fsl_gpio.h"
2021-02-08 14:37:11 +00:00
#include "peripherals.h"
2021-03-07 18:01:49 +00:00
#include "pin_mux.h"
#include "ff.h"
#include "diskio.h"
#include "user_tasks.h"
2021-02-03 17:44:12 +00:00
/*******************************************************************************
* Definitions
******************************************************************************/
2021-03-07 18:01:49 +00:00
FATFS g_file_system;
2021-02-03 17:44:12 +00:00
/*******************************************************************************
* Prototypes
******************************************************************************/
/*******************************************************************************
* Code
******************************************************************************/
/*!
* @brief Application entry point.
*/
int main(void)
{
/* Init board hardware. */
BOARD_ConfigMPU();
BOARD_InitBootPins();
BOARD_InitBootClocks();
2021-02-08 14:37:11 +00:00
BOARD_InitBootPeripherals();
2021-02-03 17:44:12 +00:00
BOARD_InitDebugConsole();
2021-03-07 18:01:49 +00:00
BaseType_t ret;
ret = xTaskCreate(hello_task, "HELO_TASK", 512, NULL, 4, &g_hello_task_handle);
if(ret != pdPASS) goto err_out;
2021-03-08 15:15:17 +00:00
ret = xTaskCreate(CardDetectTask, "CARD_TASK", 1024, NULL, 4, &g_card_detect_task_handle);
if(ret != pdPASS) goto err_out;
2021-03-07 18:01:49 +00:00
2021-02-03 17:44:12 +00:00
vTaskStartScheduler();
2021-03-07 18:01:49 +00:00
err_out:
2021-03-06 16:48:31 +00:00
for (;;) {
2021-03-07 18:01:49 +00:00
2021-02-03 17:44:12 +00:00
}
2021-03-07 18:01:49 +00:00
}