Update UC3 platform driver support to use the bitmasks defined in the header files...
[pub/USBasp.git] / Projects / MIDIToneGenerator / MIDIToneGenerator.c
index a4e2764..e1008a7 100644 (file)
@@ -166,7 +166,7 @@ ISR(TIMER0_COMPA_vect, ISR_BLOCK)
                if (NoteData[i].Pitch)\r
                {\r
                        /* Use the top 8 bits of the table position as the sample table index */\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
                        \r
                        /* Add the new tone sample to the accumulator and increment the table position */\r
                        MixedSample += SineTable[TableIndex];\r