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
157f8c93
Commit
157f8c93
authored
9 years ago
by
Kaspar Schleiser
Browse files
Options
Downloads
Patches
Plain Diff
sys: fmt: add workaround for AVR libc's missing write()
parent
28d9eab4
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
sys/fmt/fmt.c
+5
-0
5 additions, 0 deletions
sys/fmt/fmt.c
with
5 additions
and
0 deletions
sys/fmt/fmt.c
+
5
−
0
View file @
157f8c93
...
@@ -137,6 +137,10 @@ uint32_t scn_u32_dec(const char *str, size_t n)
...
@@ -137,6 +137,10 @@ uint32_t scn_u32_dec(const char *str, size_t n)
void
print
(
const
char
*
s
,
size_t
n
)
void
print
(
const
char
*
s
,
size_t
n
)
{
{
#ifdef __WITH_AVRLIBC__
/* AVR's libc doesn't offer write(), so use fwrite() instead */
fwrite
(
s
,
n
,
1
,
stdout
);
#else
while
(
n
>
0
)
{
while
(
n
>
0
)
{
ssize_t
written
=
write
(
STDOUT_FILENO
,
s
,
n
);
ssize_t
written
=
write
(
STDOUT_FILENO
,
s
,
n
);
if
(
written
<
0
)
{
if
(
written
<
0
)
{
...
@@ -145,6 +149,7 @@ void print(const char *s, size_t n)
...
@@ -145,6 +149,7 @@ void print(const char *s, size_t n)
n
-=
written
;
n
-=
written
;
s
+=
written
;
s
+=
written
;
}
}
#endif
/* __WITH_AVRLIBC__ */
}
}
void
print_u32_dec
(
uint32_t
val
)
void
print_u32_dec
(
uint32_t
val
)
...
...
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