mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-20 00:51:42 +00:00
This is the changes made by Patrick Plenefisch converting the native code to use CMake and the CMake Maven Plugin, as opposed to the native Maven plugin. This is to allow for compatibility with newer versions of the GCC toolchain. All the cpp sources were moved from maven style directories to cpp style directories for CMake. Change-Id: I67f5e3608948f37c83b0990d232105a3784f8593
30 lines
638 B
C++
30 lines
638 B
C++
|
|
#include "HAL/Utilities.h"
|
|
|
|
#include "HAL/HAL.h"
|
|
#include "ChipObject.h"
|
|
|
|
const int32_t HAL_NO_WAIT = 0;
|
|
const int32_t HAL_WAIT_FOREVER = -1;
|
|
|
|
void delayTicks(int32_t ticks) {
|
|
struct timespec test, remaining;
|
|
test.tv_sec = 0;
|
|
test.tv_nsec = ticks * 3;
|
|
nanosleep(&test, &remaining);
|
|
}
|
|
|
|
void delayMillis(double ms) {
|
|
struct timespec test, remaining;
|
|
test.tv_sec = ms/1000;
|
|
test.tv_nsec = 1000*(((uint64_t) ms)%1000000);
|
|
nanosleep(&test, &remaining);
|
|
}
|
|
|
|
void delaySeconds(double s) {
|
|
struct timespec test, remaining;
|
|
test.tv_sec = (int) s;
|
|
test.tv_nsec = (s - (int)s) * 1000000000.0;
|
|
nanosleep(&test, &remaining);
|
|
}
|