FreeRTOS console and io devices support for compile

git-svn-id: svn://db.shs.com.ru/pip@688 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
2019-02-06 13:04:25 +00:00
parent 30973842d1
commit 283da5b602
17 changed files with 185 additions and 63 deletions

View File

@@ -22,8 +22,11 @@
#include "pidir.h"
#include "pipropertystorage.h"
#include <errno.h>
#ifdef WINDOWS
# include <winreg.h>
#if defined(WINDOWS) || defined(FREERTOS)
# define PISERIAL_NO_PINS
#endif
#ifdef PISERIAL_NO_PINS
# define TIOCM_LE 1
# define TIOCM_DTR 4
# define TIOCM_RTS 7
@@ -33,6 +36,9 @@
# define TIOCM_CAR 1
# define TIOCM_RNG 9
# define TIOCM_DSR 6
#endif
#ifdef WINDOWS
# include <winreg.h>
# define B50 50
# define B75 75
# define B110 110
@@ -113,7 +119,7 @@
#ifndef CRTSCTS
# define CRTSCTS 020000000000
#endif
#if defined(LINUX)
#ifdef LINUX
# include <linux/serial.h>
#endif
@@ -251,7 +257,7 @@ bool PISerial::isDSR() const {return isBit(TIOCM_DSR, "DSR");}
bool PISerial::setBit(int bit, bool on, const PIString & bname) {
#ifndef WINDOWS
#ifndef PISERIAL_NO_PINS
if (fd < 0) {
piCoutObj << "setBit" << bname << " error: \"" << path() << "\" is not opened!";
return false;
@@ -262,14 +268,14 @@ bool PISerial::setBit(int bit, bool on, const PIString & bname) {
}
return true;
#else
piCoutObj << "setBit" << bname << " doesn`t implemented on Windows, sorry :-(";
piCoutObj << "setBit" << bname << " doesn`t implemented, sorry :-(";
return false;
#endif
}
bool PISerial::isBit(int bit, const PIString & bname) const {
#ifndef WINDOWS
#ifndef PISERIAL_NO_PINS
if (fd < 0) {
piCoutObj << "isBit" << bname << " error: \"" << path() << "\" is not opened!";
return false;
@@ -279,7 +285,7 @@ bool PISerial::isBit(int bit, const PIString & bname) const {
piCoutObj << "isBit" << bname << " error: " << errorString();
return ret & bit;
#else
piCoutObj << "isBit" << bname << " doesn`t implemented on Windows, sorry :-(";
piCoutObj << "isBit" << bname << " doesn`t implemented, sorry :-(";
return false;
#endif
}