summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Friesel <derf@finalrewind.org>2021-09-23 20:58:49 +0200
committerDaniel Friesel <derf@finalrewind.org>2021-09-23 20:58:49 +0200
commit102e6f03e9d1ab9dc213b021b1dbe81d7fda332a (patch)
treef59b728899becbf13182d16d4181852be6dd006e /src
parentd79ef3a1a1e85bb411a7458367c988f51e31e48f (diff)
lora32u4ii: stdout: Add pprint for PSTR (pgmspace strings)
Diffstat (limited to 'src')
-rw-r--r--src/arch/lora32u4ii/driver/stdout.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/arch/lora32u4ii/driver/stdout.cc b/src/arch/lora32u4ii/driver/stdout.cc
index afe6ff8..ee45a43 100644
--- a/src/arch/lora32u4ii/driver/stdout.cc
+++ b/src/arch/lora32u4ii/driver/stdout.cc
@@ -1,6 +1,5 @@
#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)));