changeset 8:49a2ab305115

Move FREQ table to PROGMEM
author Radomir Dopieralski <sheep-devel@sheep.art.pl>
date Sat, 26 Nov 2016 18:58:15 +0100
parents 8a77f39e2f26
children 393915e97bb1 73a8e2860747
files main/main.c
diffstat 1 files changed, 2 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/main/main.c	Sat Nov 26 15:52:37 2016 +0100
+++ b/main/main.c	Sat Nov 26 18:58:15 2016 +0100
@@ -4,7 +4,7 @@
 
 #define byte unsigned char
 
-const byte FREQ[] = {126, 133, 149, 168, 189, 200, 212, 224};
+const byte PROGMEM FREQ[] = {126, 133, 149, 168, 189, 200, 212, 224};
 
 const byte PROGMEM INTRO_NOTES[] = {
 025, 024, 063, 060, 025, 024, 023, 020, 017, 035, 017, 021, 060, 063, 025, 024,
@@ -42,7 +42,7 @@
         note.raw = pgm_read_byte_near(notes++);
         if (note.note.octave) {
             TCCR1 |= (8 - note.note.octave);
-            OCR1C = FREQ[note.note.tone];
+            OCR1C = pgm_read_byte_near(FREQ + note.note.tone);
         }
         if (note.note.length) {
             _delay_ms(220);