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
d8a843bf
You need to sign in or sign up before continuing.
Commit
d8a843bf
authored
7 years ago
by
Sebastian Meiling
Browse files
Options
Downloads
Patches
Plain Diff
sys,fmt: update and fix docu
parent
65a230d1
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
sys/include/fmt.h
+18
-11
18 additions, 11 deletions
sys/include/fmt.h
with
18 additions
and
11 deletions
sys/include/fmt.h
+
18
−
11
View file @
d8a843bf
...
@@ -194,12 +194,13 @@ size_t fmt_s16_dec(char *out, int16_t val);
...
@@ -194,12 +194,13 @@ size_t fmt_s16_dec(char *out, int16_t val);
* If @p out is NULL, will only return the number of bytes that would have
* If @p out is NULL, will only return the number of bytes that would have
* been written.
* been written.
*
*
* @pre fp_digits < 8 (TENMAP_SIZE)
*
* @param[out] out Pointer to the output buffer, or NULL
* @param[out] out Pointer to the output buffer, or NULL
* @param[in] val Fixed point value
, MUST be <= 4
* @param[in] val Fixed point value
* @param[in] fp_digits Number of digits after the decimal point
* @param[in] fp_digits Number of digits after the decimal point
*
*
* @return Length of the resulting string
* @return Length of the resulting string
* @return 0 if @p fp_digits is > 4
*/
*/
size_t
fmt_s16_dfp
(
char
*
out
,
int16_t
val
,
unsigned
fp_digits
);
size_t
fmt_s16_dfp
(
char
*
out
,
int16_t
val
,
unsigned
fp_digits
);
...
@@ -222,12 +223,13 @@ size_t fmt_s16_dfp(char *out, int16_t val, unsigned fp_digits);
...
@@ -222,12 +223,13 @@ size_t fmt_s16_dfp(char *out, int16_t val, unsigned fp_digits);
* If @p out is NULL, will only return the number of bytes that would have
* If @p out is NULL, will only return the number of bytes that would have
* been written.
* been written.
*
*
* @pre fp_digits < 8 (TENMAP_SIZE)
*
* @param[out] out Pointer to the output buffer, or NULL
* @param[out] out Pointer to the output buffer, or NULL
* @param[in] val Fixed point value
* @param[in] val Fixed point value
* @param[in] fp_digits Number of digits after the decimal point
, MUST be <= 9
* @param[in] fp_digits Number of digits after the decimal point
*
*
* @return Length of the resulting string
* @return Length of the resulting string
* @return 0 if @p fp_digits is > 9
*/
*/
size_t
fmt_s32_dfp
(
char
*
out
,
int32_t
val
,
unsigned
fp_digits
);
size_t
fmt_s32_dfp
(
char
*
out
,
int32_t
val
,
unsigned
fp_digits
);
...
@@ -236,14 +238,18 @@ size_t fmt_s32_dfp(char *out, int32_t val, unsigned fp_digits);
...
@@ -236,14 +238,18 @@ size_t fmt_s32_dfp(char *out, int32_t val, unsigned fp_digits);
*
*
* Converts float value @p f to string
* Converts float value @p f to string
*
*
* @pre -2^32 < f < 2^32
* If @p out is NULL, will only return the number of bytes that would have
* been written.
*
*
* @note This function is using floating point math. It pulls in about 2.4k
* @attention This function is using floating point math.
* bytes of code on ARM Cortex-M platforms.
* It pulls in about 2.4k bytes of code on ARM Cortex-M platforms.
*
* @pre -2^32 < f < 2^32
* @pre precision < 8 (TENMAP_SIZE)
*
*
* @param[out] out string to write to (or NULL)
* @param[out] out string to write to (or NULL)
* @param[in] f float value to convert
* @param[in] f float value to convert
* @param[in] precision number of digits after decimal point
(<=7)
* @param[in] precision number of digits after decimal point
*
*
* @returns nr of bytes the function did or would write to out
* @returns nr of bytes the function did or would write to out
*/
*/
...
@@ -340,18 +346,19 @@ void print_u64_dec(uint64_t val);
...
@@ -340,18 +346,19 @@ void print_u64_dec(uint64_t val);
/**
/**
* @brief Print float value
* @brief Print float value
*
*
* @note See fmt_float for code size warning!
*
* @pre -2^32 < f < 2^32
* @pre -2^32 < f < 2^32
* @pre precision < TENMAP_SIZE (== 8)
*
*
* @param[in] f float value to print
* @param[in] f float value to print
* @param[in] precision number of digits after decimal point
(<=7)
* @param[in] precision number of digits after decimal point
*/
*/
void
print_float
(
float
f
,
unsigned
precision
);
void
print_float
(
float
f
,
unsigned
precision
);
/**
/**
* @brief Print null-terminated string to stdout
* @brief Print null-terminated string to stdout
*
*
* @note See fmt_float for code size warning!
*
* @param[in] str Pointer to string to print
* @param[in] str Pointer to string to print
*/
*/
void
print_str
(
const
char
*
str
);
void
print_str
(
const
char
*
str
);
...
...
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