This commit is contained in:
zhoujie 2026-03-14 10:43:20 +08:00
parent 0ef14a0ecb
commit 63d3d63ad0
2 changed files with 16 additions and 1 deletions

View File

@ -97,7 +97,7 @@
#define configTICK_RATE_HZ ( ( TickType_t ) 500 ) #define configTICK_RATE_HZ ( ( TickType_t ) 500 )
#define configMAX_PRIORITIES ( 15 ) #define configMAX_PRIORITIES ( 15 )
#define configMINIMAL_STACK_SIZE ( ( unsigned short ) 256 ) /* Can be as low as 60 but some of the demo tasks that use this constant require it to be higher. */ #define configMINIMAL_STACK_SIZE ( ( unsigned short ) 256 ) /* Can be as low as 60 but some of the demo tasks that use this constant require it to be higher. */
#define configTOTAL_HEAP_SIZE ( ( size_t ) ( 12 * 1024 ) ) #define configTOTAL_HEAP_SIZE ( ( size_t ) ( 24 * 1024 ) )
#define configMAX_TASK_NAME_LEN ( 16 ) #define configMAX_TASK_NAME_LEN ( 16 )
#define configUSE_TRACE_FACILITY 0 #define configUSE_TRACE_FACILITY 0
#define configUSE_16_BIT_TICKS 0 #define configUSE_16_BIT_TICKS 0

View File

@ -187,6 +187,20 @@ void WCHNET_HandleGlobalInt(void)
} }
} }
/* ============================================================
* RTOS Task: Heartbeat (periodic print for debug)
* ============================================================ */
static void task_heartbeat_entry(void *pvParameters)
{
(void)pvParameters;
uint32_t cnt = 0;
while (1)
{
printf("[HB] %lu tick=%lu\r\n", cnt++, xTaskGetTickCount());
vTaskDelay(pdMS_TO_TICKS(2000));
}
}
/* ============================================================ /* ============================================================
* RTOS Task: WCHNET protocol stack driver (highest priority) * RTOS Task: WCHNET protocol stack driver (highest priority)
* ============================================================ */ * ============================================================ */
@ -291,6 +305,7 @@ int main(void)
xTaskCreate(task_wchnet_entry, "wchnet", 1024, NULL, 6, NULL); xTaskCreate(task_wchnet_entry, "wchnet", 1024, NULL, 6, NULL);
xTaskCreate(task_business_entry, "business", 1024, NULL, 5, NULL); xTaskCreate(task_business_entry, "business", 1024, NULL, 5, NULL);
xTaskCreate(task_heartbeat_entry, "hb", 256, NULL, 3, NULL);
vTaskStartScheduler(); vTaskStartScheduler();
/* Should never reach here */ /* Should never reach here */