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:
2019-02-04 23:57:53 +00:00
parent b0285fd251
commit 79e17eb928
17 changed files with 303 additions and 218 deletions

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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

View File

@@ -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();

View File

@@ -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;}