projects
/
pub
/
USBasp.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
4b1f6ca
)
Replace cast-as-char* byte access of multibyte variables with proper shifts and masks...
author
Dean Camera
<dean@fourwalledcubicle.com>
Wed, 13 Apr 2011 06:12:52 +0000
(06:12 +0000)
committer
Dean Camera
<dean@fourwalledcubicle.com>
Wed, 13 Apr 2011 06:12:52 +0000
(06:12 +0000)
LUFA/Drivers/USB/Class/Device/RNDIS.c
patch
|
blob
|
blame
|
history
Projects/AVRISP-MKII/Lib/XPROG/TINYNVM.c
patch
|
blob
|
blame
|
history
Projects/AVRISP-MKII/Lib/XPROG/XMEGANVM.c
patch
|
blob
|
blame
|
history
Projects/MIDIToneGenerator/MIDIToneGenerator.c
patch
|
blob
|
blame
|
history
diff --git
a/LUFA/Drivers/USB/Class/Device/RNDIS.c
b/LUFA/Drivers/USB/Class/Device/RNDIS.c
index
3ade4af
..
616af5f
100644
(file)
--- a/
LUFA/Drivers/USB/Class/Device/RNDIS.c
+++ b/
LUFA/Drivers/USB/Class/Device/RNDIS.c
@@
-279,8
+279,8
@@
void RNDIS_Device_ProcessRNDISControlMessage(USB_ClassInfo_RNDIS_Device_t* const
RNDIS_Query_Complete_t* QUERY_Response = (RNDIS_Query_Complete_t*)&RNDISInterfaceInfo->State.RNDISMessageBuffer;
uint32_t Query_Oid = QUERY_Message->Oid;
RNDIS_Query_Complete_t* QUERY_Response = (RNDIS_Query_Complete_t*)&RNDISInterfaceInfo->State.RNDISMessageBuffer;
uint32_t Query_Oid = QUERY_Message->Oid;
- void* QueryData = &RNDISInterfaceInfo->State.RNDISMessageBuffer[sizeof(RNDIS_Message_Header_t) +
- QUERY_Message->InformationBufferOffset];
+ void* QueryData
= &RNDISInterfaceInfo->State.RNDISMessageBuffer[sizeof(RNDIS_Message_Header_t) +
+
QUERY_Message->InformationBufferOffset];
void* ResponseData = &RNDISInterfaceInfo->State.RNDISMessageBuffer[sizeof(RNDIS_Query_Complete_t)];
uint16_t ResponseSize;
void* ResponseData = &RNDISInterfaceInfo->State.RNDISMessageBuffer[sizeof(RNDIS_Query_Complete_t)];
uint16_t ResponseSize;
diff --git
a/Projects/AVRISP-MKII/Lib/XPROG/TINYNVM.c
b/Projects/AVRISP-MKII/Lib/XPROG/TINYNVM.c
index
49d5766
..
891ae8d
100644
(file)
--- 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);
{
/* 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(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.
}
/** 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
b1fea59
..
e4f1186
100644
(file)
--- 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 */
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.
}
/** Sends the given NVM register address to the target.
diff --git
a/Projects/MIDIToneGenerator/MIDIToneGenerator.c
b/Projects/MIDIToneGenerator/MIDIToneGenerator.c
index
a4e2764
..
e1008a7
100644
(file)
--- a/
Projects/MIDIToneGenerator/MIDIToneGenerator.c
+++ b/
Projects/MIDIToneGenerator/MIDIToneGenerator.c
@@
-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