✏️ 添加(hello task):添加helloAPP

This commit is contained in:
Alvin Young 2022-09-29 14:25:39 +08:00
parent 3f1fab64dd
commit 6bf1ae00d9
7 changed files with 2813 additions and 3 deletions

1
.gitignore vendored
View File

@ -1,6 +1,7 @@
components/ components/
.vscode/ .vscode/
.devcontainer/ .devcontainer/
build/
*.o *.o
*.d *.d

View File

@ -0,0 +1,42 @@
/**
* @file app_task_hello.c
* @author impressionyang (impressionyang@outlook.com)
* @brief
* @version 0.1
* @date 2022-09-28
* _ _
* (_)_ _ ___ _______ ___ ___ (_)__ ___ __ _____ ____ ___ _
* / / ' \/ _ \/ __/ -_|_-<(_-</ / _ \/ _ \/ // / _ `/ _ \/ _ `/
* /_/_/_/_/ .__/_/ \__/___/___/_/\___/_//_/\_, /\_,_/_//_/\_, /
* /_/ /___/ /___/
* @copyright Copyright (c) 2022 impressionyang
*
* @par :
* <table>
* <tr><th>Date <th>Version <th>Author <th>Description
* <tr><td>2022-09-28 <td>v1.0 <td>impressionyang <td>
* </table>
*/
#include "app_task_hello.h"
#include "freertos/FreeRTOS.h"
#include "freertos/task.h"
static void _app_hello_task_run()
{
uint16_t idx = 0;
while(1) {
printf("hello %d\r\n", idx++);
vTaskDelay(100);
}
}
uint8_t app_hello_task_start()
{
xTaskCreatePinnedToCore(_app_hello_task_run, "hello task", 1024, NULL, 5, NULL, tskNO_AFFINITY);
return 0;
}
uint8_t app_hello_task_stop()
{
return 0;
}

View File

@ -0,0 +1,52 @@
/**
* @file app_hello_task.h
* @author impressionyang (impressionyang@outlook.com)
* @brief
* @version 0.1
* @date 2022-09-28
* _ _
* (_)_ _ ___ _______ ___ ___ (_)__ ___ __ _____ ____ ___ _
* / / ' \/ _ \/ __/ -_|_-<(_-</ / _ \/ _ \/ // / _ `/ _ \/ _ `/
* /_/_/_/_/ .__/_/ \__/___/___/_/\___/_//_/\_, /\_,_/_//_/\_, /
* /_/ /___/ /___/
* @copyright Copyright (c) 2022 impressionyang
*
* @par :
* <table>
* <tr><th>Date <th>Version <th>Author <th>Description
* <tr><td>2022-09-28 <td>v1.0 <td>impressionyang <td>
* </table>
*/
#ifndef __APP_HELLO_TASK_H__
#define __APP_HELLO_TASK_H__
#include <stdint.h>
#ifdef __cplusplus
extern "C" {
#endif
/**
*
* @brief
* @author impressionyang (impressionyang@outlook.com)
* @return uint8_t
*
* @details
*/
uint8_t app_hello_task_start();
/**
*
* @brief
* @author impressionyang (impressionyang@outlook.com)
* @return uint8_t
*
* @details
*/
uint8_t app_hello_task_stop();
#ifdef __cplusplus
}
#endif
#endif//__APP_HELLO_TASK_H__

View File

@ -1,2 +1,8 @@
idf_component_register(SRCS "hello_world_main.c" idf_component_register(
INCLUDE_DIRS "") SRC_DIRS
"."
"APP/app_task_hello"
INCLUDE_DIRS
"."
"APP/app_task_hello"
)

View File

@ -13,9 +13,12 @@
#include "esp_system.h" #include "esp_system.h"
#include "esp_spi_flash.h" #include "esp_spi_flash.h"
#include "app_task_hello.h"
void app_main(void) void app_main(void)
{ {
printf("Hello world!\n"); printf("Hello world!\n");
app_hello_task_start();
/* Print chip information */ /* Print chip information */
esp_chip_info_t chip_info; esp_chip_info_t chip_info;
@ -33,7 +36,7 @@ void app_main(void)
printf("Minimum free heap size: %d bytes\n", esp_get_minimum_free_heap_size()); printf("Minimum free heap size: %d bytes\n", esp_get_minimum_free_heap_size());
for (int i = 10; i >= 0; i--) { for (int i = 10; ; ) {
printf("Restarting in %d seconds...\n", i); printf("Restarting in %d seconds...\n", i);
vTaskDelay(1000 / portTICK_PERIOD_MS); vTaskDelay(1000 / portTICK_PERIOD_MS);
} }

1353
sdkconfig Normal file

File diff suppressed because it is too large Load Diff

1353
sdkconfig.old Normal file

File diff suppressed because it is too large Load Diff