add initial RTOS support
now without io devices and console git-svn-id: svn://db.shs.com.ru/pip@683 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -23,9 +23,11 @@
|
||||
#include "pisignals.h"
|
||||
#include "piobject.h"
|
||||
#include "pisysteminfo.h"
|
||||
#include "pidir.h"
|
||||
#include "piprocess.h"
|
||||
#include "piresourcesstorage.h"
|
||||
#ifndef FREERTOS
|
||||
# include "pidir.h"
|
||||
# include "piprocess.h"
|
||||
#endif
|
||||
#ifdef WINDOWS
|
||||
# include <winsock2.h>
|
||||
extern FILETIME __pi_ftjan1970;
|
||||
@@ -44,7 +46,9 @@
|
||||
}
|
||||
#else
|
||||
# include <pwd.h>
|
||||
# include <sys/utsname.h>
|
||||
# ifndef FREERTOS
|
||||
# include <sys/utsname.h>
|
||||
# endif
|
||||
# include <pthread.h>
|
||||
# ifdef BLACKBERRY
|
||||
# include <signal.h>
|
||||
@@ -88,6 +92,7 @@ PRIVATE_DEFINITION_START(PIInit)
|
||||
#endif
|
||||
PRIVATE_DEFINITION_END(PIInit)
|
||||
|
||||
#ifndef FREERTOS
|
||||
void __sighandler__(PISignals::Signal s) {
|
||||
//piCout << Hex << int(s);
|
||||
if (s == PISignals::StopTTYInput || s == PISignals::StopTTYOutput)
|
||||
@@ -95,6 +100,7 @@ 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
|
||||
@@ -109,6 +115,7 @@ PIInit::PIInit() {
|
||||
PISystemInfo * sinfo = PISystemInfo::instance();
|
||||
sinfo->execDateTime = PIDateTime::current();
|
||||
setFileCharset("UTF-8");
|
||||
#ifndef FREERTOS
|
||||
#ifndef ANDROID
|
||||
PISignals::setSlot(__sighandler__);
|
||||
PISignals::grabSignals(PISignals::UserDefined1);
|
||||
@@ -211,11 +218,14 @@ PIInit::PIInit() {
|
||||
#endif
|
||||
#ifdef MAC_OS
|
||||
host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &__pi_mac_clock);
|
||||
#endif
|
||||
#endif
|
||||
char cbuff[1024];
|
||||
memset(cbuff, 0, 1024);
|
||||
#ifndef FREERTOS
|
||||
if (gethostname(cbuff, 1023) == 0)
|
||||
sinfo->hostname = cbuff;
|
||||
#endif
|
||||
#ifdef WINDOWS
|
||||
SYSTEM_INFO sysinfo;
|
||||
GetSystemInfo(&sysinfo);
|
||||
@@ -248,11 +258,13 @@ PIInit::PIInit() {
|
||||
if (l)
|
||||
sinfo->user = l;
|
||||
}
|
||||
# ifndef FREERTOS
|
||||
struct utsname uns;
|
||||
if (uname(&uns) == 0) {
|
||||
sinfo->OS_version = uns.release;
|
||||
sinfo->architecture = uns.machine;
|
||||
}
|
||||
# endif
|
||||
#endif
|
||||
sinfo->OS_name =
|
||||
#ifdef WINDOWS
|
||||
@@ -270,7 +282,11 @@ PIInit::PIInit() {
|
||||
# ifdef FREE_BSD
|
||||
PIStringAscii("FreeBSD");
|
||||
# else
|
||||
# ifdef FREERTOS
|
||||
PIStringAscii("FreeRTOS");
|
||||
# else
|
||||
uns.sysname;
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
# endif
|
||||
|
||||
Reference in New Issue
Block a user