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