From 4d99d22e10a3cb2a421da1618c127128816613c9 Mon Sep 17 00:00:00 2001 From: jacqueline Date: Tue, 26 Sep 2023 13:36:07 +1000 Subject: std::string -> std::pmr::string in psram --- src/tasks/CMakeLists.txt | 2 +- src/tasks/tasks.cpp | 18 ++++++++++-------- src/tasks/tasks.hpp | 4 ++-- 3 files changed, 13 insertions(+), 11 deletions(-) (limited to 'src/tasks') diff --git a/src/tasks/CMakeLists.txt b/src/tasks/CMakeLists.txt index 473684b9..0fdacf78 100644 --- a/src/tasks/CMakeLists.txt +++ b/src/tasks/CMakeLists.txt @@ -1,5 +1,5 @@ # Copyright 2023 jacqueline # # SPDX-License-Identifier: GPL-3.0-only -idf_component_register(SRCS "tasks.cpp" INCLUDE_DIRS "." REQUIRES "span") +idf_component_register(SRCS "tasks.cpp" INCLUDE_DIRS "." REQUIRES "span" "memory") target_compile_options(${COMPONENT_LIB} PRIVATE ${EXTRA_WARNINGS}) diff --git a/src/tasks/tasks.cpp b/src/tasks/tasks.cpp index 8dc2f204..dfcead06 100644 --- a/src/tasks/tasks.cpp +++ b/src/tasks/tasks.cpp @@ -12,33 +12,35 @@ #include "freertos/FreeRTOS.h" #include "freertos/portmacro.h" +#include "memory_resource.hpp" + namespace tasks { template -auto Name() -> std::string; +auto Name() -> std::pmr::string; template <> -auto Name() -> std::string { +auto Name() -> std::pmr::string { return "ui"; } template <> -auto Name() -> std::string { +auto Name() -> std::pmr::string { return "audio_dec"; } template <> -auto Name() -> std::string { +auto Name() -> std::pmr::string { return "audio_conv"; } template <> -auto Name() -> std::string { +auto Name() -> std::pmr::string { return "db_fg"; } template <> -auto Name() -> std::string { +auto Name() -> std::pmr::string { return "db_bg"; } template <> -auto Name() -> std::string { +auto Name() -> std::pmr::string { return "nvs"; } @@ -185,7 +187,7 @@ auto Worker::Main(void* instance) { } } -Worker::Worker(const std::string& name, +Worker::Worker(const std::pmr::string& name, cpp::span stack, std::size_t queue_size, UBaseType_t priority) diff --git a/src/tasks/tasks.hpp b/src/tasks/tasks.hpp index 2e43b01a..b87c7fa2 100644 --- a/src/tasks/tasks.hpp +++ b/src/tasks/tasks.hpp @@ -45,7 +45,7 @@ enum class Type { }; template -auto Name() -> std::string; +auto Name() -> std::pmr::string; template auto AllocateStack() -> cpp::span; template @@ -76,7 +76,7 @@ auto StartPersistent(BaseType_t core, const std::function& fn) class Worker { private: - Worker(const std::string& name, + Worker(const std::pmr::string& name, cpp::span stack, std::size_t queue_size, UBaseType_t priority); -- cgit v1.2.3