Replace cast-as-char* byte access of multibyte variables with proper shifts and masks to preserve endianness across different architectures.

This commit is contained in:
Dean Camera committed 2011-04-13 06:12:52 +00:00
1 parent 4b1f6cac75
commit e0852408de
4 files changed
+9 -9

No files matched your search

@@ -166,7 +166,7 @@ ISR(TIMER0_COMPA_vect, ISR_BLOCK)
if (NoteData[i].Pitch)
{
/* Use the top 8 bits of the table position as the sample table index */
uint8_t TableIndex = ((uint8_t*)&NoteData[i].TablePosition)[3];
uint8_t TableIndex = (NoteData[i].TablePosition >> 24);
/* Add the new tone sample to the accumulator and increment the table position */
MixedSample += SineTable[TableIndex];