Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
multipass
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
Package Registry
Model registry
Operate
Environments
Terraform modules
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
derf
multipass
Commits
102e6f03
Unverified
Commit
102e6f03
authored
3 years ago
by
Birte Kristina Friesel
Browse files
Options
Downloads
Patches
Plain Diff
lora32u4ii: stdout: Add pprint for PSTR (pgmspace strings)
parent
d79ef3a1
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
include/arch/lora32u4ii/driver/stdout.h
+2
-0
2 additions, 0 deletions
include/arch/lora32u4ii/driver/stdout.h
src/arch/lora32u4ii/driver/stdout.cc
+11
-1
11 additions, 1 deletion
src/arch/lora32u4ii/driver/stdout.cc
with
13 additions
and
1 deletion
include/arch/lora32u4ii/driver/stdout.h
+
2
−
0
View file @
102e6f03
#ifndef STANDARDOUTPUT_H
#define STANDARDOUTPUT_H
#include
<avr/pgmspace.h>
#include
"object/outputstream.h"
class
StandardOutput
:
public
OutputStream
{
...
...
@@ -12,6 +13,7 @@ class StandardOutput : public OutputStream {
void
setup
();
virtual
void
put
(
char
c
)
override
;
OutputStream
&
pprint
(
const
char
*
text
);
};
extern
StandardOutput
kout
;
...
...
This diff is collapsed.
Click to expand it.
src/arch/lora32u4ii/driver/stdout.cc
+
11
−
1
View file @
102e6f03
#include
"driver/stdout.h"
#include
<avr/io.h>
#include
<avr/interrupt.h>
#ifndef BAUD
#define BAUD 9600UL
...
...
@@ -24,6 +23,17 @@ void StandardOutput::setup()
//UCSR1D = 0;
}
OutputStream
&
StandardOutput
::
pprint
(
const
char
*
text
)
{
PGM_P
p
=
reinterpret_cast
<
PGM_P
>
(
text
);
char
c
;
while
((
c
=
pgm_read_byte
(
p
++
)))
{
put
(
c
);
}
return
*
this
;
}
void
StandardOutput
::
put
(
char
c
)
{
while
(
!
(
UCSR1A
&
_BV
(
UDRE1
)));
...
...
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