/*\r
LUFA Library\r
- Copyright (C) Dean Camera, 2010.\r
+ Copyright (C) Dean Camera, 2011.\r
\r
dean [at] fourwalledcubicle [dot] com\r
www.fourwalledcubicle.com\r
*/\r
\r
/*\r
- Copyright 2010 Dean Camera (dean [at] fourwalledcubicle [dot] com)\r
+ Copyright 2011 Dean Camera (dean [at] fourwalledcubicle [dot] com)\r
\r
Permission to use, copy, modify, distribute, and sell this \r
software and its documentation for any purpose is hereby granted\r
};\r
\r
/** 8-bit 256 entry Sine Wave lookup table */\r
-const uint8_t SineTable[256] =\r
+static const uint8_t SineTable[256] =\r
{\r
128, 131, 134, 137, 140, 143, 146, 149, 152, 156, 159, 162, 165, 168, 171, 174,\r
176, 179, 182, 185, 188, 191, 193, 196, 199, 201, 204, 206, 209, 211, 213, 216,\r
};\r
\r
/** Array of structures describing each note being generated */\r
-DDSNoteData NoteData[MAX_SIMULTANEOUS_NOTES];\r
+static DDSNoteData NoteData[MAX_SIMULTANEOUS_NOTES];\r
+\r
\r
/** Main program entry point. This routine contains the overall program flow, including initial\r
* setup of all components and the main program loop.\r
if (NoteData[i].Pitch)\r
{\r
/* Use the top 8 bits of the table position as the sample table index */\r
- uint8_t TableIndex = ((uint8_t*)&NoteData[i].TablePosition)[3];\r
+ uint8_t TableIndex = (NoteData[i].TablePosition >> 24);\r
\r
/* Add the new tone sample to the accumulator and increment the table position */\r
MixedSample += SineTable[TableIndex];\r