You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
41 lines
632 B
41 lines
632 B
#include <avr/pgmspace.h>
|
|
#include "programStrings.h"
|
|
#include "wiring.h"
|
|
#include "HardwareSerial.h"
|
|
|
|
// call with printString(PSTR("My string"))
|
|
void SPrint_P(const char *data)
|
|
{
|
|
char ch;
|
|
|
|
for (;;) {
|
|
ch = pgm_read_byte( data++ );
|
|
if ( !ch ) return;
|
|
Serial.print(ch);
|
|
}
|
|
}
|
|
|
|
void SPrintln_P(const char *data)
|
|
{
|
|
SPrint_P(data);
|
|
SPrint_P(PSTR("\r\n"));
|
|
}
|
|
|
|
void SPrintHex_P(const char *data)
|
|
{
|
|
char ch;
|
|
|
|
for (;;) {
|
|
ch = pgm_read_byte( data++ );
|
|
if ( !ch ) return;
|
|
Serial.print(ch, HEX);
|
|
}
|
|
}
|
|
|
|
void SPrintlnHex_P(const char *data)
|
|
{
|
|
printString(data);
|
|
|
|
Serial.println();
|
|
}
|