rfid: use <=15-char task name for xTaskGetHandle to avoid FreeRTOS assert; library task renamed to rc522_poll locally

This commit is contained in:
2026-09-10 16:59:30 +02:00
parent 71b0085ced
commit 3072795a4b

View File

@@ -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;
}