From 3072795a4b12021a7b82ffbe0dbf81e8b95d2210 Mon Sep 17 00:00:00 2001 From: Rasmus Date: Thu, 10 Sep 2026 16:59:30 +0200 Subject: [PATCH] rfid: use <=15-char task name for xTaskGetHandle to avoid FreeRTOS assert; library task renamed to rc522_poll locally --- main/rfid_manager.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/main/rfid_manager.c b/main/rfid_manager.c index 2756b31..955cdda 100644 --- a/main/rfid_manager.c +++ b/main/rfid_manager.c @@ -16,7 +16,11 @@ static const char *TAG = "rfid"; -#define RC522_TASK_NAME "rc522_polling_task" +/* FreeRTOS task names are truncated to configMAX_TASK_NAME_LEN-1 (15) + * printable chars, and xTaskGetHandle() asserts if the query is 16+. + * Keep this <= 15 chars and in sync with the rc522 library's + * xTaskCreate("rc522_poll", ...). */ +#define RC522_TASK_NAME "rc522_poll" #define RC522_POLL_INTERVAL_MS (100) #define RC522_TASK_STACK_SIZE (6 * 1024) #define RC522_TASK_PRIORITY (4) @@ -155,10 +159,10 @@ esp_err_t rfid_manager_start(void) vTaskCoreAffinitySet(task, (UBaseType_t)(1U << 0)); ESP_LOGI(TAG, "RC522 polling task pinned to Core 0"); } else { - ESP_LOGW(TAG, "rc522_polling_task handle not found, affinity not set"); + ESP_LOGW(TAG, "%s handle not found, affinity not set", RC522_TASK_NAME); } - ESP_LOGI(TAG, "RFID scanner ready (SPI2_HOST, CS=%d, RST=%d)", + ESP_LOGI(TAG, "RFID scanner ready (SPI3_HOST, CS=%d)RST=%d)", HW_RC522_CS_GPIO, HW_RC522_RST_GPIO); return ESP_OK; }