Loading [MathJax]/jax/input/TeX/config.js
CTRE Phoenix C++
5.35.1
Toggle main menu visibility
Main Page
Related Pages
Namespaces
Namespace List
Namespace Members
All
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
Functions
Enumerations
a
c
d
e
f
g
i
l
m
n
p
r
s
t
v
Enumerator
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
w
Classes
Class List
Class Index
Class Hierarchy
Class Members
All
_
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
q
r
s
t
u
v
w
z
~
Functions
a
b
c
d
e
f
g
h
i
k
l
m
n
o
p
r
s
t
u
v
w
~
Variables
_
a
b
c
d
e
f
h
i
k
l
m
n
o
p
q
r
s
t
u
v
z
Enumerations
Enumerator
a
b
c
f
g
i
l
m
n
o
p
q
r
s
t
u
Related Symbols
Files
File List
File Members
All
c
d
g
i
j
k
l
m
p
s
t
w
Functions
c
j
p
t
Variables
Macros
▼
CTRE Phoenix C++
Deprecated List
►
Namespaces
►
Classes
▼
Files
▼
File List
►
ctre
►
ctre
▼
ctre
▼
phoenix
►
cci
▼
platform
►
Platform-pack.h
►
SleepUs.h
►
ErrorCode.h
►
PhoenixVersion.h
►
ctre
►
File Members
•
All
Classes
Namespaces
Files
Functions
Variables
Enumerations
Enumerator
Friends
Macros
Pages
Loading...
Searching...
No Matches
SleepUs.h
Go to the documentation of this file.
1
/* Copyright (C) Cross The Road Electronics 2024 */
2
#pragma once
3
4
#include <chrono>
5
#include <thread>
6
7
#ifdef __FRC_ROBORIO__
8
#include <unistd.h>
9
#endif
10
11
namespace
ctre
{
12
namespace
phoenix {
13
namespace
platform {
14
15
/**
16
* @param timeUs How long to yield current thread in microseconds (us).
17
* If platform cannot honor us resolution, round to nearest
18
* value that platform can honor.
19
*/
20
static
inline
void
SleepUs
(
int
timeUs)
21
{
22
#ifdef __FRC_ROBORIO__
23
usleep(timeUs);
24
#else
25
std::this_thread::sleep_for(std::chrono::microseconds(timeUs));
26
#endif
27
}
20
static
inline
void
SleepUs
(
int
timeUs) {
…
}
28
29
}
// namespace platform
30
}
// namespace phoenix
31
}
// namespace ctre
ctre::phoenix::platform::SleepUs
static void SleepUs(int timeUs)
Definition
SleepUs.h:20
ctre
WPI Compliant CANcoder class.
Definition
CANCoderStatusFrame.h:4
ctre
phoenix
platform
SleepUs.h
Generated by
1.12.0