esp32 fixes
git-svn-id: svn://db.shs.com.ru/pip@878 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -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/resources")
|
||||||
list(APPEND COMPONENT_ADD_INCLUDEDIRS "pip/src_main/system")
|
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/thread")
|
||||||
|
list(APPEND COMPONENT_ADD_INCLUDEDIRS "pip/src_main/introspection")
|
||||||
set(COMPONENT_PRIV_REQUIRES pthread lwip freertos vfs spiffs)
|
set(COMPONENT_PRIV_REQUIRES pthread lwip freertos vfs spiffs)
|
||||||
set(COMPONENT_ADD_LDFRAGMENTS linker.lf)
|
#set(COMPONENT_ADD_LDFRAGMENTS linker.lf)
|
||||||
register_component()
|
register_component()
|
||||||
set(PIP_FREERTOS ON)
|
set(PIP_FREERTOS ON)
|
||||||
set(LIB OFF)
|
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/libsodium/src/libsodium/include")
|
||||||
list(APPEND INCLUDE_DIRS "../libsodium/port_include")
|
list(APPEND INCLUDE_DIRS "../libsodium/port_include")
|
||||||
list(APPEND INCLUDE_DIRS "../heap/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 "../driver/include")
|
||||||
list(APPEND INCLUDE_DIRS "../spi_flash/include")
|
list(APPEND INCLUDE_DIRS "../spi_flash/include")
|
||||||
list(APPEND INCLUDE_DIRS "../spiffs/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 "../lwip/port/esp32/include")
|
||||||
list(APPEND INCLUDE_DIRS "../vfs/include")
|
list(APPEND INCLUDE_DIRS "../vfs/include")
|
||||||
include_directories(${INCLUDE_DIRS})
|
include_directories(${INCLUDE_DIRS})
|
||||||
|
include_directories(${CMAKE_CURRENT_BINARY_DIR})
|
||||||
#message("IDF_COMPILE_DEFINITIONS = ${IDF_COMPILE_DEFINITIONS}")
|
#message("IDF_COMPILE_DEFINITIONS = ${IDF_COMPILE_DEFINITIONS}")
|
||||||
#message("IDF_INCLUDE_DIRECTORIES = ${IDF_INCLUDE_DIRECTORIES}")
|
#message("IDF_INCLUDE_DIRECTORIES = ${IDF_INCLUDE_DIRECTORIES}")
|
||||||
add_compile_options(${IDF_COMPILE_OPTIONS})
|
add_compile_options(${IDF_COMPILE_OPTIONS})
|
||||||
|
|||||||
@@ -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);
|
stream.append(data);
|
||||||
//piCout << "rec" << data.size();
|
//piCout << "rec" << data.size();
|
||||||
while (stream.size_s() >= 4) {
|
while (stream.size_s() >= 4) {
|
||||||
|
|||||||
@@ -118,6 +118,9 @@ PICout::PICout(PIFlags<PICoutControl> controls): fo_(true), cc_(false), fc_(fals
|
|||||||
init();
|
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) {
|
PICout::PICout(bool active): fo_(true), cc_(false), fc_(false), act_(active), cnb_(10), co_(PICoutManipulators::DefaultControls) {
|
||||||
if (act_)
|
if (act_)
|
||||||
|
|||||||
@@ -115,7 +115,8 @@ namespace PICoutManipulators {
|
|||||||
class PIP_EXPORT PICout {
|
class PIP_EXPORT PICout {
|
||||||
public:
|
public:
|
||||||
//! Default constructor with default features (AddSpaces and AddNewLine)
|
//! Default constructor with default features (AddSpaces and AddNewLine)
|
||||||
explicit PICout(PIFlags<PICoutManipulators::PICoutControl> controls = PICoutManipulators::DefaultControls);
|
PICout(PIFlags<PICoutManipulators::PICoutControl> controls = PICoutManipulators::DefaultControls);
|
||||||
|
PICout(PICoutManipulators::PICoutControl control = PICoutManipulators::DefaultControls);
|
||||||
|
|
||||||
//! Construct with default features (AddSpaces and AddNewLine), but if \"active\" is false does nothing
|
//! Construct with default features (AddSpaces and AddNewLine), but if \"active\" is false does nothing
|
||||||
PICout(bool active);
|
PICout(bool active);
|
||||||
|
|||||||
@@ -76,9 +76,9 @@ public:
|
|||||||
void send(const PIByteArray & data);
|
void send(const PIByteArray & data);
|
||||||
|
|
||||||
//! Receive data part. If packet is ready, raise \a received() event
|
//! 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
|
//! Connect \"dev\" \a PIIODevice::threadedReadEvent() event to \a received() handler
|
||||||
//! and \a sendRequest() event to \"dev\" \a PIIODevice::write() handler
|
//! and \a sendRequest() event to \"dev\" \a PIIODevice::write() handler
|
||||||
|
|||||||
@@ -197,14 +197,14 @@ void PISystemMonitor::run() {
|
|||||||
if (t->isPIObject())
|
if (t->isPIObject())
|
||||||
tbid[t->tid()] = t->name();
|
tbid[t->tid()] = t->name();
|
||||||
pitc->unlock();
|
pitc->unlock();
|
||||||
|
//piCout << tbid.keys().toType<uint>();
|
||||||
|
ProcessStats tstat;
|
||||||
|
tstat.ID = pID_;
|
||||||
#ifdef FREERTOS
|
#ifdef FREERTOS
|
||||||
piForeach (PIThread * t, tv)
|
piForeach (PIThread * t, tv)
|
||||||
if (t->isPIObject())
|
if (t->isPIObject())
|
||||||
gatherThread(t->tid());
|
gatherThread(t->tid());
|
||||||
#else
|
#else
|
||||||
//piCout << tbid.keys().toType<uint>();
|
|
||||||
ProcessStats tstat;
|
|
||||||
tstat.ID = pID_;
|
|
||||||
#ifndef WINDOWS
|
#ifndef WINDOWS
|
||||||
tbid[pID_] = "main";
|
tbid[pID_] = "main";
|
||||||
# ifdef MAC_OS
|
# ifdef MAC_OS
|
||||||
|
|||||||
@@ -313,9 +313,10 @@ bool PIThread::_startThread(void * func) {
|
|||||||
pthread_setname_np(((PIString&)name().elided(15, 0.4f).resize(15, '\0')).dataAscii());
|
pthread_setname_np(((PIString&)name().elided(15, 0.4f).resize(15, '\0')).dataAscii());
|
||||||
pthread_threadid_np(PRIVATE->thread, (__uint64_t*)&tid_);
|
pthread_threadid_np(PRIVATE->thread, (__uint64_t*)&tid_);
|
||||||
# else
|
# else
|
||||||
pthread_setname_np(PRIVATE->thread, ((PIString&)name().elided(15, 0.4f).resize(15, '\0')).dataAscii());
|
|
||||||
# ifdef FREERTOS
|
# ifdef FREERTOS
|
||||||
tid_ = PRIVATE->thread;
|
tid_ = PRIVATE->thread;
|
||||||
|
# else
|
||||||
|
pthread_setname_np(PRIVATE->thread, ((PIString&)name().elided(15, 0.4f).resize(15, '\0')).dataAscii());
|
||||||
# endif
|
# endif
|
||||||
# endif
|
# endif
|
||||||
#else
|
#else
|
||||||
|
|||||||
Reference in New Issue
Block a user