aboutsummaryrefslogtreecommitdiffstats
path: root/Projects
diff options
context:
space:
mode:
Diffstat (limited to 'Projects')
-rw-r--r--Projects/AVRISP-MKII/Lib/XPROG/TINYNVM.c4
-rw-r--r--Projects/AVRISP-MKII/Lib/XPROG/XMEGANVM.c8
-rw-r--r--Projects/MIDIToneGenerator/MIDIToneGenerator.c2
3 files changed, 7 insertions, 7 deletions
diff --git a/Projects/AVRISP-MKII/Lib/XPROG/TINYNVM.c b/Projects/AVRISP-MKII/Lib/XPROG/TINYNVM.c
index 49d576608..891ae8d14 100644
--- a/Projects/AVRISP-MKII/Lib/XPROG/TINYNVM.c
+++ b/Projects/AVRISP-MKII/Lib/XPROG/TINYNVM.c
@@ -43,9 +43,9 @@ static void TINYNVM_SendPointerAddress(const uint16_t AbsoluteAddress)
{
/* Send the given 16-bit address to the target, LSB first */
XPROGTarget_SendByte(TPI_CMD_SSTPR | 0);
- XPROGTarget_SendByte(((uint8_t*)&AbsoluteAddress)[0]);
+ XPROGTarget_SendByte(AbsoluteAddress & 0xFF);
XPROGTarget_SendByte(TPI_CMD_SSTPR | 1);
- XPROGTarget_SendByte(((uint8_t*)&AbsoluteAddress)[1]);
+ XPROGTarget_SendByte(AbsoluteAddress >> 8);
}
/** Sends a SIN command to the target with the specified I/O address, ready for the data byte to be written.
diff --git a/Projects/AVRISP-MKII/Lib/XPROG/XMEGANVM.c b/Projects/AVRISP-MKII/Lib/XPROG/XMEGANVM.c
index b1fea5992..e4f1186b0 100644
--- a/Projects/AVRISP-MKII/Lib/XPROG/XMEGANVM.c
+++ b/Projects/AVRISP-MKII/Lib/XPROG/XMEGANVM.c
@@ -45,10 +45,10 @@
static void XMEGANVM_SendAddress(const uint32_t AbsoluteAddress)
{
/* Send the given 32-bit address to the target, LSB first */
- XPROGTarget_SendByte(((uint8_t*)&AbsoluteAddress)[0]);
- XPROGTarget_SendByte(((uint8_t*)&AbsoluteAddress)[1]);
- XPROGTarget_SendByte(((uint8_t*)&AbsoluteAddress)[2]);
- XPROGTarget_SendByte(((uint8_t*)&AbsoluteAddress)[3]);
+ XPROGTarget_SendByte(AbsoluteAddress & 0xFF);
+ XPROGTarget_SendByte(AbsoluteAddress >> 8);
+ XPROGTarget_SendByte(AbsoluteAddress >> 16);
+ XPROGTarget_SendByte(AbsoluteAddress >> 24);
}
/** Sends the given NVM register address to the target.
diff --git a/Projects/MIDIToneGenerator/MIDIToneGenerator.c b/Projects/MIDIToneGenerator/MIDIToneGenerator.c
index a4e2764c0..e1008a7d3 100644
--- a/Projects/MIDIToneGenerator/MIDIToneGenerator.c
+++ b/Projects/MIDIToneGenerator/MIDIToneGenerator.c
@@ -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];