Added some comment text for interrupt select and NUM_OSCILLATORS

This commit is contained in:
Jakob Bak 2013-01-24 10:22:47 +01:00
parent 642b4973ca
commit 5912dfdcd4
2 changed files with 19 additions and 6 deletions

View File

@ -37,10 +37,16 @@ MMusic Music;
#define SPI_SCK 5 #define SPI_SCK 5
#define SPI_MOSI 3 #define SPI_MOSI 3
// timer 2 is audio interrupt timer
ISR(TIMER2_COMPA_vect) { //////////////////////////////////////////////////////////
//
// AUDIO INTERRUPT. USE EITHER 8bit or 12bitSine VERSION
// COMMENT OUT THE ONE YOU ARE NOT USING
//
//////////////////////////////////////////////////////////
ISR(TIMER2_COMPA_vect) { // timer 2 is audio interrupt timer
OCR2A = 127; OCR2A = 127; // don't change this
// Music.synthInterrupt8bit(); // Music.synthInterrupt8bit();

View File

@ -25,13 +25,20 @@
#ifndef Music_h // include guard #ifndef Music_h // include guard
#define Music_h #define Music_h
////////////////////////////////////
//
// SET NUMBER OF OSCILLATORS HERE.
// SHOULD BE 1, 2 or 3
//
////////////////////////////////////
#define NUM_OSCILLATORS 1
// current sample rate is 15625 as defined in the init() section // current sample rate is 15625 as defined in the init() section
#define SAMPLE_RATE 15625 #define SAMPLE_RATE 15625
#define NUM_OSCILLATORS 1
#ifndef NUM_OSCILLATORS #ifndef NUM_OSCILLATORS
#error NUM_OSCILLATORS should be defined in the Music.h file in the libraries folder. #error NUM_OSCILLATORS should be defined in the Music.h file in the libraries/MMM folder.
#elif (NUM_OSCILLATORS == 1)||(NUM_OSCILLATORS == 2)||(NUM_OSCILLATORS == 3) #elif (NUM_OSCILLATORS == 1)||(NUM_OSCILLATORS == 2)||(NUM_OSCILLATORS == 3)
#else #else
#error NUM_OSCILLATORS shall be 1, 2 or 3 #error NUM_OSCILLATORS shall be 1, 2 or 3