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:
@@ -17,6 +17,8 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef PIP_FREERTOS
|
||||
|
||||
#include "picodec.h"
|
||||
|
||||
|
||||
@@ -39,3 +41,5 @@ PIByteArray PICodec::exec_iconv(const PIString & from, const PIString & to, cons
|
||||
waitForFinish();
|
||||
return readOutput();
|
||||
}
|
||||
|
||||
#endif // PIP_FREERTOS
|
||||
|
||||
@@ -20,6 +20,8 @@
|
||||
#ifndef PICODEC_H
|
||||
#define PICODEC_H
|
||||
|
||||
#ifndef PIP_FREERTOS
|
||||
|
||||
#include "piprocess.h"
|
||||
|
||||
class PIP_EXPORT PICodec: protected PIProcess
|
||||
@@ -48,4 +50,5 @@ private:
|
||||
|
||||
};
|
||||
|
||||
#endif // PIP_FREERTOS
|
||||
#endif // PICODEC_H
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef PIP_FREERTOS
|
||||
|
||||
#include "pilibrary.h"
|
||||
#include "piincludes_p.h"
|
||||
#ifndef WINDOWS
|
||||
@@ -107,3 +109,5 @@ void PILibrary::getLastError() {
|
||||
else liberror.clear();
|
||||
#endif
|
||||
}
|
||||
|
||||
#endif // PIP_FREERTOS
|
||||
|
||||
@@ -16,10 +16,12 @@
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#
|
||||
#ifndef PILIBRARY_H
|
||||
#define PILIBRARY_H
|
||||
|
||||
#ifndef PIP_FREERTOS
|
||||
|
||||
#include "pistring.h"
|
||||
|
||||
class PIP_EXPORT PILibrary {
|
||||
@@ -45,4 +47,5 @@ private:
|
||||
|
||||
};
|
||||
|
||||
#endif // PIP_FREERTOS
|
||||
#endif // PILIBRARY_H
|
||||
|
||||
@@ -17,6 +17,8 @@
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
#ifndef PIP_FREERTOS
|
||||
|
||||
#include "piincludes_p.h"
|
||||
#include "piprocess.h"
|
||||
#ifndef WINDOWS
|
||||
@@ -26,7 +28,6 @@
|
||||
#ifdef MAC_OS
|
||||
# include <crt_externs.h>
|
||||
#endif
|
||||
|
||||
PRIVATE_DEFINITION_START(PIProcess)
|
||||
#ifdef WINDOWS
|
||||
STARTUPINFOA si;
|
||||
@@ -38,7 +39,6 @@ PRIVATE_DEFINITION_START(PIProcess)
|
||||
PRIVATE_DEFINITION_END(PIProcess)
|
||||
|
||||
|
||||
|
||||
PIProcess::PIProcess(): PIThread() {
|
||||
exit_code = -1;
|
||||
#ifdef WINDOWS
|
||||
@@ -307,3 +307,5 @@ PIString PIProcess::getEnvironmentVariable(const PIString & variable) {
|
||||
return PIString();
|
||||
}
|
||||
|
||||
#endif // PIP_FREERTOS
|
||||
|
||||
|
||||
@@ -23,6 +23,8 @@
|
||||
#ifndef PIPROCESS_H
|
||||
#define PIPROCESS_H
|
||||
|
||||
#ifndef PIP_FREERTOS
|
||||
|
||||
#include "pithread.h"
|
||||
#include "pifile.h"
|
||||
|
||||
@@ -102,4 +104,5 @@ private:
|
||||
|
||||
};
|
||||
|
||||
#endif // PIP_FREERTOS
|
||||
#endif // PIPROCESS_H
|
||||
|
||||
@@ -83,6 +83,7 @@ PISystemMonitor::ProcessStats::ProcessStats() {
|
||||
}
|
||||
|
||||
|
||||
#ifndef FREERTOS
|
||||
bool PISystemMonitor::startOnProcess(int pID, int interval_ms) {
|
||||
stop();
|
||||
self_ = false;
|
||||
@@ -109,13 +110,12 @@ bool PISystemMonitor::startOnProcess(int pID, int interval_ms) {
|
||||
return start(interval_ms);
|
||||
}
|
||||
|
||||
|
||||
bool PISystemMonitor::startOnSelf(int interval_ms) {
|
||||
bool ret = startOnProcess(PIProcess::currentPID(), interval_ms);
|
||||
self_ = true;
|
||||
return ret;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
PIVector<PISystemMonitor::ThreadStats> PISystemMonitor::threadsStatistic() const {
|
||||
mutex_.lock();
|
||||
|
||||
@@ -70,9 +70,10 @@ public:
|
||||
ullong space_used;
|
||||
ullong space_free;*/
|
||||
};
|
||||
|
||||
#ifndef FREERTOS
|
||||
bool startOnProcess(int pID, int interval_ms = 1000);
|
||||
bool startOnSelf(int interval_ms = 1000);
|
||||
#endif
|
||||
void stop();
|
||||
|
||||
const ProcessStats & statistic() const {return stat;}
|
||||
|
||||
Reference in New Issue
Block a user