Added espstrutils
This commit is contained in:
@ -1,6 +1,7 @@
|
|||||||
set(headers
|
set(headers
|
||||||
src/espcrc32builder.h
|
src/espcrc32builder.h
|
||||||
src/esprandom.h
|
src/esprandom.h
|
||||||
|
src/espstrutils.h
|
||||||
src/lockhelper.h
|
src/lockhelper.h
|
||||||
src/lockingqueue.h
|
src/lockingqueue.h
|
||||||
src/recursivelockhelper.h
|
src/recursivelockhelper.h
|
||||||
@ -18,6 +19,7 @@ set(headers
|
|||||||
|
|
||||||
set(sources
|
set(sources
|
||||||
src/espchrono_impl.cpp
|
src/espchrono_impl.cpp
|
||||||
|
src/espstrutils.cpp
|
||||||
src/taskutils.cpp
|
src/taskutils.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
|
16
src/espstrutils.cpp
Normal file
16
src/espstrutils.cpp
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
#include "espstrutils.h"
|
||||||
|
|
||||||
|
namespace espcpputils {
|
||||||
|
|
||||||
|
std::string toString(sntp_sync_mode_t val)
|
||||||
|
{
|
||||||
|
switch (val)
|
||||||
|
{
|
||||||
|
case SNTP_SYNC_MODE_IMMED: return "SNTP_SYNC_MODE_IMMED";
|
||||||
|
case SNTP_SYNC_MODE_SMOOTH: return "SNTP_SYNC_MODE_SMOOTH";
|
||||||
|
}
|
||||||
|
|
||||||
|
return std::string{"Unknown sntp_sync_mode_t("} + std::to_string(int(val)) + ')';
|
||||||
|
}
|
||||||
|
|
||||||
|
} // namespace espcpputils
|
13
src/espstrutils.h
Normal file
13
src/espstrutils.h
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
#pragma once
|
||||||
|
|
||||||
|
// system includes
|
||||||
|
#include <string>
|
||||||
|
|
||||||
|
// esp-idf includes
|
||||||
|
#include <esp_sntp.h>
|
||||||
|
|
||||||
|
namespace espcpputils {
|
||||||
|
|
||||||
|
std::string toString(sntp_sync_mode_t val);
|
||||||
|
|
||||||
|
} // namespace espcpputils
|
Reference in New Issue
Block a user