idfxx 1.0.0
Modern C++23 components for ESP-IDF
Loading...
Searching...
No Matches
CPU Utilities

CPU identification and core affinity types. More...

Namespaces

namespace  idfxx
 

Enumerations

enum class  idfxx::core_id : unsigned int { idfxx::core_id::core_0 = 0 }
 Identifies a specific CPU core. More...
 

Functions

std::string idfxx::to_string (core_id c)
 Returns a string representation of a CPU core identifier.
 

Detailed Description

CPU identification and core affinity types.

Enumeration Type Documentation

◆ core_id

enum class idfxx::core_id : unsigned int
strong

Identifies a specific CPU core.

Use with std::optional<core_id> for core affinity settings, where std::nullopt means "any core".

Note
Only cores available on the target chip are defined. On single-core chips, only core_0 exists.
// Pin task to core 0
.core_affinity = core_id::core_0
// Allow task to run on any core
.core_affinity = std::nullopt
Enumerator
core_0 

Definition at line 39 of file cpu.hpp.

Function Documentation

◆ to_string()

std::string idfxx::to_string ( core_id  c)
inline

Returns a string representation of a CPU core identifier.

Parameters
cThe core identifier to convert.
Returns
"CORE_0", "CORE_1" (on multi-core chips), or "unknown(N)" for unrecognized values.

Definition at line 52 of file cpu.hpp.

References idfxx::core_0.