2018-07-12 16:29:32 +02:00
|
|
|
#ifndef OS_RTEMS_RTEMSBASIC_H_
|
|
|
|
#define OS_RTEMS_RTEMSBASIC_H_
|
|
|
|
|
|
|
|
#include <framework/returnvalues/HasReturnvaluesIF.h>
|
|
|
|
#include <rtems.h>
|
|
|
|
#include <rtems/libio.h>
|
|
|
|
#include <rtems/error.h>
|
|
|
|
#include <rtems/stackchk.h>
|
|
|
|
#include <stddef.h>
|
|
|
|
|
|
|
|
|
2018-07-13 18:28:26 +02:00
|
|
|
class RtemsBasic {
|
2018-07-12 16:29:32 +02:00
|
|
|
public:
|
|
|
|
static rtems_interval convertMsToTicks(uint32_t msIn) {
|
2018-07-13 18:28:26 +02:00
|
|
|
rtems_interval ticks_per_second = rtems_clock_get_ticks_per_second();
|
2018-07-12 16:29:32 +02:00
|
|
|
return (ticks_per_second * msIn) / 1000;
|
|
|
|
}
|
|
|
|
|
|
|
|
static rtems_interval convertTicksToMs(rtems_interval ticksIn) {
|
2018-07-13 18:28:26 +02:00
|
|
|
rtems_interval ticks_per_second = rtems_clock_get_ticks_per_second();
|
2018-07-12 16:29:32 +02:00
|
|
|
return (ticksIn * 1000) / ticks_per_second;
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif /* OS_RTEMS_RTEMSBASIC_H_ */
|