diff --git a/esp32_component/esp-idf/components/pip/CMakeLists.txt b/esp32_component/esp-idf/components/pip/CMakeLists.txt index baf734e3..b84b10b6 100644 --- a/esp32_component/esp-idf/components/pip/CMakeLists.txt +++ b/esp32_component/esp-idf/components/pip/CMakeLists.txt @@ -14,8 +14,9 @@ list(APPEND COMPONENT_ADD_INCLUDEDIRS "pip/src_main/opencl") list(APPEND COMPONENT_ADD_INCLUDEDIRS "pip/src_main/resources") list(APPEND COMPONENT_ADD_INCLUDEDIRS "pip/src_main/system") list(APPEND COMPONENT_ADD_INCLUDEDIRS "pip/src_main/thread") +list(APPEND COMPONENT_ADD_INCLUDEDIRS "pip/src_main/introspection") set(COMPONENT_PRIV_REQUIRES pthread lwip freertos vfs spiffs) -set(COMPONENT_ADD_LDFRAGMENTS linker.lf) +#set(COMPONENT_ADD_LDFRAGMENTS linker.lf) register_component() set(PIP_FREERTOS ON) set(LIB OFF) @@ -25,7 +26,7 @@ list(APPEND INCLUDE_DIRS "../newlib/include") list(APPEND INCLUDE_DIRS "../libsodium/libsodium/src/libsodium/include") list(APPEND INCLUDE_DIRS "../libsodium/port_include") list(APPEND INCLUDE_DIRS "../heap/include") -list(APPEND INCLUDE_DIRS "../esp32/include") +list(APPEND INCLUDE_DIRS "../esp_rom/include/esp32") list(APPEND INCLUDE_DIRS "../driver/include") list(APPEND INCLUDE_DIRS "../spi_flash/include") list(APPEND INCLUDE_DIRS "../spiffs/include") @@ -36,6 +37,7 @@ list(APPEND INCLUDE_DIRS "../lwip/lwip/src/include") list(APPEND INCLUDE_DIRS "../lwip/port/esp32/include") list(APPEND INCLUDE_DIRS "../vfs/include") include_directories(${INCLUDE_DIRS}) +include_directories(${CMAKE_CURRENT_BINARY_DIR}) #message("IDF_COMPILE_DEFINITIONS = ${IDF_COMPILE_DEFINITIONS}") #message("IDF_INCLUDE_DIRECTORIES = ${IDF_INCLUDE_DIRECTORIES}") add_compile_options(${IDF_COMPILE_OPTIONS}) diff --git a/src_io_utils/pistreampacker.cpp b/src_io_utils/pistreampacker.cpp index 60500cc0..8f9c69c6 100644 --- a/src_io_utils/pistreampacker.cpp +++ b/src_io_utils/pistreampacker.cpp @@ -99,7 +99,13 @@ void PIStreamPacker::send(const PIByteArray & data) { } -void PIStreamPacker::received(const PIByteArray & data) { +void PIStreamPacker::received(uchar * readed, int size) { + PIByteArray ba(readed, size); + receivedBA(ba); +} + + +void PIStreamPacker::receivedBA(const PIByteArray & data) { stream.append(data); //piCout << "rec" << data.size(); while (stream.size_s() >= 4) { diff --git a/src_main/core/picout.cpp b/src_main/core/picout.cpp index 60cd2185..841b9b53 100644 --- a/src_main/core/picout.cpp +++ b/src_main/core/picout.cpp @@ -118,6 +118,9 @@ PICout::PICout(PIFlags controls): fo_(true), cc_(false), fc_(fals init(); } +PICout::PICout(PICoutControl control): fo_(true), cc_(false), fc_(false), act_(true), cnb_(10), co_(control) { + init(); +} PICout::PICout(bool active): fo_(true), cc_(false), fc_(false), act_(active), cnb_(10), co_(PICoutManipulators::DefaultControls) { if (act_) diff --git a/src_main/core/picout.h b/src_main/core/picout.h index dfac74aa..e0631f3a 100644 --- a/src_main/core/picout.h +++ b/src_main/core/picout.h @@ -115,7 +115,8 @@ namespace PICoutManipulators { class PIP_EXPORT PICout { public: //! Default constructor with default features (AddSpaces and AddNewLine) - explicit PICout(PIFlags controls = PICoutManipulators::DefaultControls); + PICout(PIFlags controls = PICoutManipulators::DefaultControls); + PICout(PICoutManipulators::PICoutControl control = PICoutManipulators::DefaultControls); //! Construct with default features (AddSpaces and AddNewLine), but if \"active\" is false does nothing PICout(bool active); diff --git a/src_main/io_utils/pistreampacker.h b/src_main/io_utils/pistreampacker.h index dec59134..7a0df5ba 100644 --- a/src_main/io_utils/pistreampacker.h +++ b/src_main/io_utils/pistreampacker.h @@ -76,9 +76,9 @@ public: void send(const PIByteArray & data); //! Receive data part. If packet is ready, raise \a received() event - void received(const PIByteArray & data); + void receivedBA(const PIByteArray & data); - EVENT_HANDLER2(void, received, uchar * , readed, int, size) {received(PIByteArray(readed, size));} + EVENT_HANDLER2(void, received, uchar * , readed, int, size); //! Connect \"dev\" \a PIIODevice::threadedReadEvent() event to \a received() handler //! and \a sendRequest() event to \"dev\" \a PIIODevice::write() handler diff --git a/src_main/system/pisystemmonitor.cpp b/src_main/system/pisystemmonitor.cpp index 09ffcc0f..eb3236cc 100755 --- a/src_main/system/pisystemmonitor.cpp +++ b/src_main/system/pisystemmonitor.cpp @@ -197,14 +197,14 @@ void PISystemMonitor::run() { if (t->isPIObject()) tbid[t->tid()] = t->name(); pitc->unlock(); + //piCout << tbid.keys().toType(); + ProcessStats tstat; + tstat.ID = pID_; #ifdef FREERTOS piForeach (PIThread * t, tv) if (t->isPIObject()) gatherThread(t->tid()); #else - //piCout << tbid.keys().toType(); - ProcessStats tstat; - tstat.ID = pID_; #ifndef WINDOWS tbid[pID_] = "main"; # ifdef MAC_OS diff --git a/src_main/thread/pithread.cpp b/src_main/thread/pithread.cpp index dd769a76..bf2434fa 100755 --- a/src_main/thread/pithread.cpp +++ b/src_main/thread/pithread.cpp @@ -313,9 +313,10 @@ bool PIThread::_startThread(void * func) { pthread_setname_np(((PIString&)name().elided(15, 0.4f).resize(15, '\0')).dataAscii()); pthread_threadid_np(PRIVATE->thread, (__uint64_t*)&tid_); # else - pthread_setname_np(PRIVATE->thread, ((PIString&)name().elided(15, 0.4f).resize(15, '\0')).dataAscii()); # ifdef FREERTOS tid_ = PRIVATE->thread; +# else + pthread_setname_np(PRIVATE->thread, ((PIString&)name().elided(15, 0.4f).resize(15, '\0')).dataAscii()); # endif # endif #else