Adding Code for Linux

This commit is contained in:
2018-07-13 18:28:26 +02:00
parent db1f93a155
commit fd782b20c0
90 changed files with 2411 additions and 1497 deletions

View File

@ -2,11 +2,6 @@
#define OS_RTEMS_RTEMSBASIC_H_
#include <framework/returnvalues/HasReturnvaluesIF.h>
#include <framework/osal/OperatingSystemIF.h>
extern "C" {
#include <bsp_flp/rtems_config.h>
}
#include <rtems/endian.h>
#include <rtems.h>
#include <rtems/libio.h>
#include <rtems/error.h>
@ -14,24 +9,15 @@ extern "C" {
#include <stddef.h>
class RtemsBasic: public OperatingSystemIF {
class RtemsBasic {
public:
/**
* A method to convert an OS-specific return code to the frameworks return value concept.
* @param inValue The return code coming from the OS.
* @return The converted return value.
*/
static ReturnValue_t convertReturnCode(rtems_status_code inValue);
static rtems_interval convertMsToTicks(uint32_t msIn) {
rtems_interval ticks_per_second;
rtems_clock_get(RTEMS_CLOCK_GET_TICKS_PER_SECOND, &ticks_per_second);
rtems_interval ticks_per_second = rtems_clock_get_ticks_per_second();
return (ticks_per_second * msIn) / 1000;
}
static rtems_interval convertTicksToMs(rtems_interval ticksIn) {
rtems_interval ticks_per_second;
rtems_clock_get(RTEMS_CLOCK_GET_TICKS_PER_SECOND, &ticks_per_second);
rtems_interval ticks_per_second = rtems_clock_get_ticks_per_second();
return (ticksIn * 1000) / ticks_per_second;
}
};