Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
R
RIOT
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
cm-projects
RIOT
Commits
36e0d488
Commit
36e0d488
authored
6 years ago
by
Hauke Petersen
Browse files
Options
Downloads
Patches
Plain Diff
core/byteorder: to/from bufs funcs are big endian
parent
359416f4
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
core/include/byteorder.h
+6
-6
6 additions, 6 deletions
core/include/byteorder.h
with
6 additions
and
6 deletions
core/include/byteorder.h
+
6
−
6
View file @
36e0d488
...
...
@@ -225,7 +225,7 @@ static inline uint32_t byteorder_swapl(uint32_t v);
static
inline
uint64_t
byteorder_swapll
(
uint64_t
v
);
/**
* @brief Read a
little
endian encoded unsigned integer from a buffer
* @brief Read a
big
endian encoded unsigned integer from a buffer
* into host byte order encoded variable, 16-bit
*
* @note This function is agnostic to the alignment of the target
...
...
@@ -235,10 +235,10 @@ static inline uint64_t byteorder_swapll(uint64_t v);
*
* @return 16-bit unsigned integer in host byte order
*/
static
inline
uint16_t
byteorder_
l
ebuftohs
(
const
uint8_t
*
buf
);
static
inline
uint16_t
byteorder_
b
ebuftohs
(
const
uint8_t
*
buf
);
/**
* @brief Write a host byte order encoded unsigned integer as
little
* @brief Write a host byte order encoded unsigned integer as
big
* endian encoded value into a buffer, 16-bit
*
* @note This function is alignment agnostic and works with any given
...
...
@@ -247,7 +247,7 @@ static inline uint16_t byteorder_lebuftohs(const uint8_t *buf);
* @param[out] buf target buffer, must be able to accept 2 bytes
* @param[in] val value written to the buffer, in host byte order
*/
static
inline
void
byteorder_hto
l
ebufs
(
uint8_t
*
buf
,
uint16_t
val
);
static
inline
void
byteorder_hto
b
ebufs
(
uint8_t
*
buf
,
uint16_t
val
);
/**
* @brief Convert from host byte order to network byte order, 16 bit.
...
...
@@ -443,7 +443,7 @@ static inline uint64_t ntohll(uint64_t v)
return
byteorder_ntohll
(
input
);
}
static
inline
uint16_t
byteorder_
l
ebuftohs
(
const
uint8_t
*
buf
)
static
inline
uint16_t
byteorder_
b
ebuftohs
(
const
uint8_t
*
buf
)
{
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
return
(
uint16_t
)((
buf
[
0
]
<<
8
)
|
buf
[
1
]);
...
...
@@ -452,7 +452,7 @@ static inline uint16_t byteorder_lebuftohs(const uint8_t *buf)
#endif
}
static
inline
void
byteorder_hto
l
ebufs
(
uint8_t
*
buf
,
uint16_t
val
)
static
inline
void
byteorder_hto
b
ebufs
(
uint8_t
*
buf
,
uint16_t
val
)
{
#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
buf
[
0
]
=
(
uint8_t
)(
val
>>
8
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment