Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
B
Baitboat
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
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
OpenSource
Baitboat
Commits
8aa8f81b
Commit
8aa8f81b
authored
12 years ago
by
Andrew Tridgell
Browse files
Options
Downloads
Patches
Plain Diff
FastSerial: added a vprintf_P() function
used by CLI on UART2
parent
aeb39dab
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
libraries/FastSerial/BetterStream.cpp
+8
-2
8 additions, 2 deletions
libraries/FastSerial/BetterStream.cpp
libraries/FastSerial/BetterStream.h
+3
-2
3 additions, 2 deletions
libraries/FastSerial/BetterStream.h
with
11 additions
and
4 deletions
libraries/FastSerial/BetterStream.cpp
+
8
−
2
View file @
8aa8f81b
...
@@ -44,15 +44,21 @@ BetterStream::printf(const char *fmt, ...)
...
@@ -44,15 +44,21 @@ BetterStream::printf(const char *fmt, ...)
}
}
void
void
BetterStream
::
_printf_P
(
const
prog_char
*
fmt
,
...)
BetterStream
::
_printf_P
(
const
prog_char
_t
*
fmt
,
...)
{
{
va_list
ap
;
va_list
ap
;
va_start
(
ap
,
fmt
);
va_start
(
ap
,
fmt
);
_vprintf
(
1
,
fmt
,
ap
);
_vprintf
(
1
,
(
const
char
*
)
fmt
,
ap
);
va_end
(
ap
);
va_end
(
ap
);
}
}
void
BetterStream
::
vprintf_P
(
const
prog_char_t
*
fmt
,
va_list
ap
)
{
_vprintf
(
1
,
(
const
char
*
)
fmt
,
ap
);
}
int
int
BetterStream
::
txspace
(
void
)
BetterStream
::
txspace
(
void
)
{
{
...
...
This diff is collapsed.
Click to expand it.
libraries/FastSerial/BetterStream.h
+
3
−
2
View file @
8aa8f81b
...
@@ -25,12 +25,13 @@ public:
...
@@ -25,12 +25,13 @@ public:
void
println_P
(
const
prog_char_t
*
);
void
println_P
(
const
prog_char_t
*
);
void
printf
(
const
char
*
,
...)
void
printf
(
const
char
*
,
...)
__attribute__
((
format
(
__printf__
,
2
,
3
)));
__attribute__
((
format
(
__printf__
,
2
,
3
)));
void
_printf_P
(
const
prog_char
*
,
...);
void
_printf_P
(
const
prog_char
_t
*
,
...);
__attribute__
((
format
(
__printf__
,
2
,
3
)));
__attribute__
((
format
(
__printf__
,
2
,
3
)));
void
vprintf_P
(
const
prog_char_t
*
,
va_list
);
virtual
int
txspace
(
void
);
virtual
int
txspace
(
void
);
#define printf_P(fmt, ...) _printf_P((const prog_char *)fmt, ## __VA_ARGS__)
#define printf_P(fmt, ...) _printf_P((const prog_char
_t
*)fmt, ## __VA_ARGS__)
private
:
private
:
void
_vprintf
(
unsigned
char
,
const
char
*
,
va_list
)
void
_vprintf
(
unsigned
char
,
const
char
*
,
va_list
)
...
...
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