compiled for esp32
This commit is contained in:
@@ -1,6 +1,5 @@
|
|||||||
{
|
{
|
||||||
"name": "PIP",
|
"name": "PIP",
|
||||||
"version": "2.33.0",
|
|
||||||
"keywords": "pip",
|
"keywords": "pip",
|
||||||
"description": "Platform-Independent Primitives",
|
"description": "Platform-Independent Primitives",
|
||||||
"repository":
|
"repository":
|
||||||
@@ -15,8 +14,11 @@
|
|||||||
{
|
{
|
||||||
"srcFilter": [
|
"srcFilter": [
|
||||||
"+<libs/main/core/*.cpp>",
|
"+<libs/main/core/*.cpp>",
|
||||||
"+<libs/main/containers/*.cpp>"
|
"+<libs/main/containers/*.cpp>",
|
||||||
|
"+<libs/main/math/*.cpp>",
|
||||||
|
"+<libs/main/thread/*.cpp>"
|
||||||
],
|
],
|
||||||
"extraScript": "platformio_pre.py"
|
"extraScript": "platformio_pre.py",
|
||||||
|
"flags": "-DPIP_FREERTOS"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -32,7 +32,9 @@ class PIMutexLocker;
|
|||||||
class PIObject;
|
class PIObject;
|
||||||
class PIString;
|
class PIString;
|
||||||
class PIByteArray;
|
class PIByteArray;
|
||||||
|
#ifndef MICRO_PIP
|
||||||
class PIInit;
|
class PIInit;
|
||||||
|
#endif
|
||||||
class PIChar;
|
class PIChar;
|
||||||
class PICout;
|
class PICout;
|
||||||
|
|
||||||
|
|||||||
@@ -19,15 +19,15 @@
|
|||||||
|
|
||||||
#include "piincludes_p.h"
|
#include "piincludes_p.h"
|
||||||
#include "piinit.h"
|
#include "piinit.h"
|
||||||
|
#ifndef MICRO_PIP
|
||||||
|
|
||||||
#include "pitime.h"
|
#include "pitime.h"
|
||||||
#include "pisignals.h"
|
#include "pisignals.h"
|
||||||
#include "piobject.h"
|
#include "piobject.h"
|
||||||
#include "pisysteminfo.h"
|
#include "pisysteminfo.h"
|
||||||
#include "piresourcesstorage.h"
|
#include "piresourcesstorage.h"
|
||||||
#include "pidir.h"
|
#include "pidir.h"
|
||||||
#ifndef MICRO_PIP
|
#include "piprocess.h"
|
||||||
# include "piprocess.h"
|
|
||||||
#endif
|
|
||||||
#ifdef ESP_PLATFORM
|
#ifdef ESP_PLATFORM
|
||||||
# include "esp_system.h"
|
# include "esp_system.h"
|
||||||
#endif
|
#endif
|
||||||
@@ -49,9 +49,7 @@ void __PISetTimerResolution() {
|
|||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
# include <pwd.h>
|
# include <pwd.h>
|
||||||
# ifndef MICRO_PIP
|
|
||||||
# include <sys/utsname.h>
|
# include <sys/utsname.h>
|
||||||
# endif
|
|
||||||
# include <pthread.h>
|
# include <pthread.h>
|
||||||
# ifdef BLACKBERRY
|
# ifdef BLACKBERRY
|
||||||
# include <signal.h>
|
# include <signal.h>
|
||||||
@@ -84,7 +82,6 @@ ULONG prev_res;
|
|||||||
bool delete_locs;
|
bool delete_locs;
|
||||||
PRIVATE_DEFINITION_END(PIInit)
|
PRIVATE_DEFINITION_END(PIInit)
|
||||||
|
|
||||||
#ifndef MICRO_PIP
|
|
||||||
void __sighandler__(PISignals::Signal s) {
|
void __sighandler__(PISignals::Signal s) {
|
||||||
//piCout << Hex << int(s);
|
//piCout << Hex << int(s);
|
||||||
if (s == PISignals::StopTTYInput || s == PISignals::StopTTYOutput)
|
if (s == PISignals::StopTTYInput || s == PISignals::StopTTYOutput)
|
||||||
@@ -92,7 +89,6 @@ void __sighandler__(PISignals::Signal s) {
|
|||||||
if (s == PISignals::UserDefined1)
|
if (s == PISignals::UserDefined1)
|
||||||
dumpApplicationToFile(PIDir::home().path() + PIDir::separator + PIStringAscii("_PIP_DUMP_") + PIString::fromNumber(PIProcess::currentPID()));
|
dumpApplicationToFile(PIDir::home().path() + PIDir::separator + PIStringAscii("_PIP_DUMP_") + PIString::fromNumber(PIProcess::currentPID()));
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
#ifdef ANDROID
|
#ifdef ANDROID
|
||||||
@@ -106,9 +102,8 @@ PIInit::PIInit() {
|
|||||||
file_charset = 0;
|
file_charset = 0;
|
||||||
PISystemInfo * sinfo = PISystemInfo::instance();
|
PISystemInfo * sinfo = PISystemInfo::instance();
|
||||||
sinfo->execDateTime = PIDateTime::current();
|
sinfo->execDateTime = PIDateTime::current();
|
||||||
#ifndef MICRO_PIP
|
|
||||||
setFileCharset("UTF-8");
|
setFileCharset("UTF-8");
|
||||||
# ifndef ANDROID
|
#ifndef ANDROID
|
||||||
PISignals::setSlot(__sighandler__);
|
PISignals::setSlot(__sighandler__);
|
||||||
PISignals::grabSignals(PISignals::UserDefined1);
|
PISignals::grabSignals(PISignals::UserDefined1);
|
||||||
# ifndef WINDOWS
|
# ifndef WINDOWS
|
||||||
@@ -166,18 +161,18 @@ PIInit::PIInit() {
|
|||||||
setlocale(LC_ALL, "");
|
setlocale(LC_ALL, "");
|
||||||
setlocale(LC_NUMERIC, "C");
|
setlocale(LC_NUMERIC, "C");
|
||||||
# endif //HAS_LOCALE
|
# endif //HAS_LOCALE
|
||||||
# else //ANDROID
|
#else //ANDROID
|
||||||
struct sigaction actions;
|
struct sigaction actions;
|
||||||
memset(&actions, 0, sizeof(actions));
|
memset(&actions, 0, sizeof(actions));
|
||||||
sigemptyset(&actions.sa_mask);
|
sigemptyset(&actions.sa_mask);
|
||||||
actions.sa_flags = 0;
|
actions.sa_flags = 0;
|
||||||
actions.sa_handler = android_thread_exit_handler;
|
actions.sa_handler = android_thread_exit_handler;
|
||||||
sigaction(SIGTERM, &actions, 0);
|
sigaction(SIGTERM, &actions, 0);
|
||||||
# endif //ANDROID
|
#endif //ANDROID
|
||||||
PRIVATE->delete_locs = false;
|
PRIVATE->delete_locs = false;
|
||||||
__syslocname__ = __sysoemname__ = 0;
|
__syslocname__ = __sysoemname__ = 0;
|
||||||
__utf8name__ = const_cast<char*>("UTF-8");
|
__utf8name__ = const_cast<char*>("UTF-8");
|
||||||
# ifdef PIP_ICU
|
#ifdef PIP_ICU
|
||||||
UErrorCode e((UErrorCode)0);
|
UErrorCode e((UErrorCode)0);
|
||||||
u_init(&e);
|
u_init(&e);
|
||||||
# ifdef WINDOWS
|
# ifdef WINDOWS
|
||||||
@@ -201,21 +196,21 @@ PIInit::PIInit() {
|
|||||||
# endif
|
# endif
|
||||||
//piCout << __syslocname__;
|
//piCout << __syslocname__;
|
||||||
//piCout << __sysoemname__;
|
//piCout << __sysoemname__;
|
||||||
# else //PIP_ICU
|
#else //PIP_ICU
|
||||||
# ifdef WINDOWS
|
# ifdef WINDOWS
|
||||||
__syslocname__ = (char *)CP_ACP;
|
__syslocname__ = (char *)CP_ACP;
|
||||||
__sysoemname__ = (char *)CP_OEMCP;
|
__sysoemname__ = (char *)CP_OEMCP;
|
||||||
__utf8name__ = (char *)CP_UTF8;
|
__utf8name__ = (char *)CP_UTF8;
|
||||||
# endif
|
# endif
|
||||||
# endif //PIP_ICU
|
#endif //PIP_ICU
|
||||||
# ifdef MAC_OS
|
#ifdef MAC_OS
|
||||||
host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &__pi_mac_clock);
|
host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &__pi_mac_clock);
|
||||||
# endif
|
#endif
|
||||||
char cbuff[1024];
|
char cbuff[1024];
|
||||||
memset(cbuff, 0, 1024);
|
memset(cbuff, 0, 1024);
|
||||||
if (gethostname(cbuff, 1023) == 0)
|
if (gethostname(cbuff, 1023) == 0)
|
||||||
sinfo->hostname = cbuff;
|
sinfo->hostname = cbuff;
|
||||||
# ifdef WINDOWS
|
#ifdef WINDOWS
|
||||||
SYSTEM_INFO sysinfo;
|
SYSTEM_INFO sysinfo;
|
||||||
GetSystemInfo(&sysinfo);
|
GetSystemInfo(&sysinfo);
|
||||||
sinfo->processorsCount = sysinfo.dwNumberOfProcessors;
|
sinfo->processorsCount = sysinfo.dwNumberOfProcessors;
|
||||||
@@ -236,7 +231,7 @@ PIInit::PIInit() {
|
|||||||
ulong unlen = 1023;
|
ulong unlen = 1023;
|
||||||
if (GetUserName(cbuff, &unlen) != 0)
|
if (GetUserName(cbuff, &unlen) != 0)
|
||||||
sinfo->user = cbuff;
|
sinfo->user = cbuff;
|
||||||
# else //WINDOWS
|
#else //WINDOWS
|
||||||
sinfo->processorsCount = piMaxi(1, int(sysconf(_SC_NPROCESSORS_ONLN)));
|
sinfo->processorsCount = piMaxi(1, int(sysconf(_SC_NPROCESSORS_ONLN)));
|
||||||
passwd * ps = getpwuid(getuid());
|
passwd * ps = getpwuid(getuid());
|
||||||
if (ps)
|
if (ps)
|
||||||
@@ -252,8 +247,7 @@ PIInit::PIInit() {
|
|||||||
sinfo->OS_version = uns.release;
|
sinfo->OS_version = uns.release;
|
||||||
sinfo->architecture = uns.machine;
|
sinfo->architecture = uns.machine;
|
||||||
}
|
}
|
||||||
# endif //WINDOWS
|
#endif //WINDOWS
|
||||||
#endif // MICRO_PIP
|
|
||||||
|
|
||||||
#ifdef ESP_PLATFORM
|
#ifdef ESP_PLATFORM
|
||||||
esp_chip_info_t chip_info;
|
esp_chip_info_t chip_info;
|
||||||
@@ -266,21 +260,21 @@ PIInit::PIInit() {
|
|||||||
sinfo->OS_name =
|
sinfo->OS_name =
|
||||||
#ifdef WINDOWS
|
#ifdef WINDOWS
|
||||||
PIStringAscii("Windows");
|
PIStringAscii("Windows");
|
||||||
# elif defined(QNX)
|
#elif defined(QNX)
|
||||||
PIStringAscii("QNX");
|
PIStringAscii("QNX");
|
||||||
# elif defined(MAC_OS)
|
#elif defined(MAC_OS)
|
||||||
PIStringAscii("MacOS");
|
PIStringAscii("MacOS");
|
||||||
# elif defined(ANDROID)
|
#elif defined(ANDROID)
|
||||||
PIStringAscii("Android");
|
PIStringAscii("Android");
|
||||||
# elif defined(FREE_BSD)
|
#elif defined(FREE_BSD)
|
||||||
PIStringAscii("FreeBSD");
|
PIStringAscii("FreeBSD");
|
||||||
# elif defined(FREERTOS)
|
#elif defined(FREERTOS)
|
||||||
PIStringAscii("FreeRTOS");
|
PIStringAscii("FreeRTOS");
|
||||||
# elif defined(MICRO_PIP)
|
#elif defined(MICRO_PIP)
|
||||||
PIStringAscii("MicroPIP");
|
PIStringAscii("MicroPIP");
|
||||||
# else
|
#else
|
||||||
uns.sysname;
|
uns.sysname;
|
||||||
# endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -418,3 +412,6 @@ __PIInit_Initializer__::~__PIInit_Initializer__() {
|
|||||||
__instance__ = 0;
|
__instance__ = 0;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif // MICRO_PIP
|
||||||
|
|
||||||
|
|||||||
@@ -23,6 +23,10 @@
|
|||||||
#ifndef PIINIT_H
|
#ifndef PIINIT_H
|
||||||
#define PIINIT_H
|
#define PIINIT_H
|
||||||
|
|
||||||
|
#include "pibase.h"
|
||||||
|
|
||||||
|
#ifndef MICRO_PIP
|
||||||
|
|
||||||
#include "piincludes.h"
|
#include "piincludes.h"
|
||||||
|
|
||||||
|
|
||||||
@@ -70,4 +74,5 @@ private:
|
|||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
#endif // MICRO_PIP
|
||||||
#endif // PIINIT_H
|
#endif // PIINIT_H
|
||||||
|
|||||||
@@ -19,6 +19,7 @@
|
|||||||
|
|
||||||
#include "pifft.h"
|
#include "pifft.h"
|
||||||
|
|
||||||
|
#ifndef MICRO_PIP
|
||||||
|
|
||||||
PIFFT_double::PIFFT_double() {
|
PIFFT_double::PIFFT_double() {
|
||||||
}
|
}
|
||||||
@@ -1883,3 +1884,5 @@ void PIFFT_float::ftbase_ffttwcalc(PIVector<float> * a, int aoffset, int n1, int
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#endif // MICRO_PIP
|
||||||
|
|||||||
@@ -23,9 +23,12 @@
|
|||||||
#ifndef PIFFT_H
|
#ifndef PIFFT_H
|
||||||
#define PIFFT_H
|
#define PIFFT_H
|
||||||
|
|
||||||
#include "pip_fftw_export.h"
|
|
||||||
#include "pimathcomplex.h"
|
#include "pimathcomplex.h"
|
||||||
|
|
||||||
|
#ifndef MICRO_PIP
|
||||||
|
|
||||||
|
#include "pip_fftw_export.h"
|
||||||
|
|
||||||
class PIP_EXPORT PIFFT_double
|
class PIP_EXPORT PIFFT_double
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@@ -194,4 +197,6 @@ typedef PIFFTW<ldouble> PIFFTWld;
|
|||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#endif // MICRO_PIP
|
||||||
|
|
||||||
#endif // PIFFT_H
|
#endif // PIFFT_H
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ PIConditionVariable::PIConditionVariable() {
|
|||||||
|
|
||||||
pthread_condattr_t condattr;
|
pthread_condattr_t condattr;
|
||||||
pthread_condattr_init(&condattr);
|
pthread_condattr_init(&condattr);
|
||||||
# ifndef MAC_OS
|
# if !defined(MAC_OS) && !defined(FREERTOS)
|
||||||
pthread_condattr_setclock(&condattr, CLOCK_MONOTONIC);
|
pthread_condattr_setclock(&condattr, CLOCK_MONOTONIC);
|
||||||
# endif
|
# endif
|
||||||
memset(&(PRIVATE->nativeHandle), 0, sizeof(PRIVATE->nativeHandle));
|
memset(&(PRIVATE->nativeHandle), 0, sizeof(PRIVATE->nativeHandle));
|
||||||
|
|||||||
Reference in New Issue
Block a user