moved all strings to pgm-memory

This commit is contained in:
Simen Svale Skogsrud
2010-03-07 23:10:41 +01:00
parent 3c98837a70
commit e409f10047
8 changed files with 38 additions and 23 deletions

View File

@@ -23,6 +23,8 @@
*/
#include "wiring_private.h"
#include <math.h>
#include <avr/pgmspace.h>
// Define constants and variables for buffering incoming serial data. We're
// using a ring buffer (I think), in which rx_buffer_head is the index of the
@@ -149,6 +151,14 @@ void printString(const char *s)
printByte(*s++);
}
// Print a string stored in PGM-memory
void printPgmString(const char *s)
{
char c;
while ((c = pgm_read_byte_near(s++)))
printByte(c);
}
void printIntegerInBase(unsigned long n, unsigned long base)
{
unsigned char buf[8 * sizeof(long)]; // Assumes 8-bit chars.