add initial FreeRTOS support
git-svn-id: svn://db.shs.com.ru/pip@685 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -190,7 +190,7 @@ endif()
|
|||||||
# Check if RT timers exists
|
# Check if RT timers exists
|
||||||
set(CMAKE_REQUIRED_INCLUDES time.h)
|
set(CMAKE_REQUIRED_INCLUDES time.h)
|
||||||
set(CMAKE_REQUIRED_LIBRARIES )
|
set(CMAKE_REQUIRED_LIBRARIES )
|
||||||
if((NOT DEFINED ENV{QNX_HOST}) AND (NOT APPLE) AND (NOT WIN32) AND (NOT DEFINED ANDROID_PLATFORM))
|
if((NOT DEFINED ENV{QNX_HOST}) AND (NOT APPLE) AND (NOT WIN32) AND (NOT DEFINED ANDROID_PLATFORM) AND (NOT PIP_FREERTOS))
|
||||||
list(APPEND LIBS_MAIN rt)
|
list(APPEND LIBS_MAIN rt)
|
||||||
set(CMAKE_REQUIRED_LIBRARIES rt)
|
set(CMAKE_REQUIRED_LIBRARIES rt)
|
||||||
endif()
|
endif()
|
||||||
@@ -276,6 +276,7 @@ if ((NOT DEFINED LIBPROJECT) AND (DEFINED ANDROID_PLATFORM))
|
|||||||
#message("${ANDROID_SYSTEM_LIBRARY_PATH}/usr/include")
|
#message("${ANDROID_SYSTEM_LIBRARY_PATH}/usr/include")
|
||||||
#message("${ANDROID_NDK}/sysroot/usr/include")
|
#message("${ANDROID_NDK}/sysroot/usr/include")
|
||||||
endif()
|
endif()
|
||||||
|
if(NOT PIP_FREERTOS)
|
||||||
if(WIN32)
|
if(WIN32)
|
||||||
if(${C_COMPILER} STREQUAL "cl.exe")
|
if(${C_COMPILER} STREQUAL "cl.exe")
|
||||||
else()
|
else()
|
||||||
@@ -291,6 +292,7 @@ else()
|
|||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
endif()
|
endif()
|
||||||
|
endif()
|
||||||
set(PIP_LIBS)
|
set(PIP_LIBS)
|
||||||
if(PIP_FREERTOS)
|
if(PIP_FREERTOS)
|
||||||
set(PIP_LIBS ${LIBS_MAIN})
|
set(PIP_LIBS ${LIBS_MAIN})
|
||||||
|
|||||||
@@ -218,14 +218,11 @@ PIInit::PIInit() {
|
|||||||
#endif
|
#endif
|
||||||
#ifdef MAC_OS
|
#ifdef MAC_OS
|
||||||
host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &__pi_mac_clock);
|
host_get_clock_service(mach_host_self(), CALENDAR_CLOCK, &__pi_mac_clock);
|
||||||
#endif
|
|
||||||
#endif
|
#endif
|
||||||
char cbuff[1024];
|
char cbuff[1024];
|
||||||
memset(cbuff, 0, 1024);
|
memset(cbuff, 0, 1024);
|
||||||
#ifndef FREERTOS
|
|
||||||
if (gethostname(cbuff, 1023) == 0)
|
if (gethostname(cbuff, 1023) == 0)
|
||||||
sinfo->hostname = cbuff;
|
sinfo->hostname = cbuff;
|
||||||
#endif
|
|
||||||
#ifdef WINDOWS
|
#ifdef WINDOWS
|
||||||
SYSTEM_INFO sysinfo;
|
SYSTEM_INFO sysinfo;
|
||||||
GetSystemInfo(&sysinfo);
|
GetSystemInfo(&sysinfo);
|
||||||
@@ -258,7 +255,6 @@ PIInit::PIInit() {
|
|||||||
if (l)
|
if (l)
|
||||||
sinfo->user = l;
|
sinfo->user = l;
|
||||||
}
|
}
|
||||||
# ifndef FREERTOS
|
|
||||||
struct utsname uns;
|
struct utsname uns;
|
||||||
if (uname(&uns) == 0) {
|
if (uname(&uns) == 0) {
|
||||||
sinfo->OS_version = uns.release;
|
sinfo->OS_version = uns.release;
|
||||||
|
|||||||
@@ -17,8 +17,12 @@
|
|||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "pisystemtests.h"
|
#include "pisystemtests.h"
|
||||||
#include "piconfig.h"
|
|
||||||
|
#ifndef PIP_FREERTOS
|
||||||
|
# include "piconfig.h"
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
namespace PISystemTests {
|
namespace PISystemTests {
|
||||||
@@ -32,7 +36,7 @@ namespace PISystemTests {
|
|||||||
|
|
||||||
|
|
||||||
PISystemTests::PISystemTestReader::PISystemTestReader() {
|
PISystemTests::PISystemTestReader::PISystemTestReader() {
|
||||||
#ifndef WINDOWS
|
#if !defined(WINDOWS) && !defined(FREERTOS)
|
||||||
PIConfig conf(PIStringAscii("/etc/pip.conf"), PIIODevice::ReadOnly);
|
PIConfig conf(PIStringAscii("/etc/pip.conf"), PIIODevice::ReadOnly);
|
||||||
//conf.setReopenEnabled(false);
|
//conf.setReopenEnabled(false);
|
||||||
time_resolution_ns = conf.getValue(PIStringAscii("time_resolution_ns"), 1);
|
time_resolution_ns = conf.getValue(PIStringAscii("time_resolution_ns"), 1);
|
||||||
@@ -40,3 +44,5 @@ PISystemTests::PISystemTestReader::PISystemTestReader() {
|
|||||||
usleep_offset_us = conf.getValue(PIStringAscii("usleep_offset_us"), 60);
|
usleep_offset_us = conf.getValue(PIStringAscii("usleep_offset_us"), 60);
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -389,7 +389,7 @@ bool PIThread::waitForStart(int timeout_msecs) {
|
|||||||
|
|
||||||
void PIThread::__thread_func__(void * t) {
|
void PIThread::__thread_func__(void * t) {
|
||||||
#ifndef WINDOWS
|
#ifndef WINDOWS
|
||||||
# ifndef ANDROID
|
# if !defined(ANDROID) && !defined(FREERTOS)
|
||||||
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, 0);
|
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, 0);
|
||||||
pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, 0);
|
pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, 0);
|
||||||
# endif
|
# endif
|
||||||
@@ -466,7 +466,7 @@ void PIThread::__thread_func__(void * t) {
|
|||||||
|
|
||||||
void PIThread::__thread_func_once__(void * t) {
|
void PIThread::__thread_func_once__(void * t) {
|
||||||
#ifndef WINDOWS
|
#ifndef WINDOWS
|
||||||
# ifndef ANDROID
|
# if !defined(ANDROID) && !defined(FREERTOS)
|
||||||
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, 0);
|
pthread_setcancelstate(PTHREAD_CANCEL_ENABLE, 0);
|
||||||
pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, 0);
|
pthread_setcanceltype(PTHREAD_CANCEL_ASYNCHRONOUS, 0);
|
||||||
# endif
|
# endif
|
||||||
|
|||||||
Reference in New Issue
Block a user