Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Erik Strand
lufa
Commits
54e69dbe
Commit
54e69dbe
authored
May 26, 2010
by
Dean Camera
Browse files
Switch to using the correct intptr_t type use where a pointer must be cast to an integer type.
parent
67041360
Changes
5
Hide whitespace changes
Inline
Side-by-side
Bootloaders/CDC/BootloaderCDC.c
View file @
54e69dbe
...
...
@@ -233,7 +233,7 @@ static void ReadWriteMemoryBlock(const uint8_t Command)
else
{
/* Read the next EEPROM byte into the endpoint */
WriteNextResponseByte
(
eeprom_read_byte
((
uint8_t
*
)(
u
int
16
_t
)(
CurrAddress
>>
1
)));
WriteNextResponseByte
(
eeprom_read_byte
((
uint8_t
*
)(
int
ptr
_t
)(
CurrAddress
>>
1
)));
/* Increment the address counter after use */
CurrAddress
+=
2
;
...
...
@@ -275,7 +275,7 @@ static void ReadWriteMemoryBlock(const uint8_t Command)
else
{
/* Write the next EEPROM byte from the endpoint */
eeprom_write_byte
((
uint8_t
*
)(
u
int
16
_t
)(
CurrAddress
>>
1
),
FetchNextCommandByte
());
eeprom_write_byte
((
uint8_t
*
)(
(
int
ptr
_t
)(
CurrAddress
>>
1
)
)
,
FetchNextCommandByte
());
/* Increment the address counter after use */
CurrAddress
+=
2
;
...
...
@@ -513,7 +513,7 @@ void CDC_Task(void)
else
if
(
Command
==
'D'
)
{
/* Read the byte from the endpoint and write it to the EEPROM */
eeprom_write_byte
((
uint8_t
*
)((
u
int
16
_t
)(
CurrAddress
>>
1
)),
FetchNextCommandByte
());
eeprom_write_byte
((
uint8_t
*
)((
int
ptr
_t
)(
CurrAddress
>>
1
)),
FetchNextCommandByte
());
/* Increment the address after use */
CurrAddress
+=
2
;
...
...
@@ -524,7 +524,7 @@ void CDC_Task(void)
else
if
(
Command
==
'd'
)
{
/* Read the EEPROM byte and write it to the endpoint */
WriteNextResponseByte
(
eeprom_read_byte
((
uint8_t
*
)((
u
int
16
_t
)(
CurrAddress
>>
1
))));
WriteNextResponseByte
(
eeprom_read_byte
((
uint8_t
*
)((
int
ptr
_t
)(
CurrAddress
>>
1
))));
/* Increment the address after use */
CurrAddress
+=
2
;
...
...
Demos/Device/ClassDriver/RNDISEthernet/Lib/DHCP.c
View file @
54e69dbe
...
...
@@ -69,7 +69,7 @@ int16_t DHCP_ProcessDHCPPacket(void* IPHeaderInStart, void* DHCPHeaderInStart, v
DHCPHeaderOUT
->
ElapsedSeconds
=
0
;
DHCPHeaderOUT
->
Flags
=
DHCPHeaderIN
->
Flags
;
DHCPHeaderOUT
->
YourIP
=
ClientIPAddress
;
mem
cpy
(
&
DHCPHeaderOUT
->
ClientHardwareAddress
,
&
DHCPHeaderIN
->
ClientHardwareAddress
,
sizeof
(
MAC_Address_t
));
mem
move
(
&
DHCPHeaderOUT
->
ClientHardwareAddress
,
&
DHCPHeaderIN
->
ClientHardwareAddress
,
sizeof
(
MAC_Address_t
));
DHCPHeaderOUT
->
Cookie
=
SwapEndian_32
(
DHCP_MAGIC_COOKIE
);
/* Alter the incoming IP packet header so that the corrected IP source and destinations are used - this means that
...
...
Demos/Device/ClassDriver/RNDISEthernet/Lib/ICMP.c
View file @
54e69dbe
...
...
@@ -63,12 +63,12 @@ int16_t ICMP_ProcessICMPPacket(Ethernet_Frame_Info_t* FrameIN, void* InDataStart
ICMPHeaderOUT
->
Id
=
ICMPHeaderIN
->
Id
;
ICMPHeaderOUT
->
Sequence
=
ICMPHeaderIN
->
Sequence
;
u
int
16
_t
DataSize
=
FrameIN
->
FrameLength
-
((((
u
int
16
_t
)
InDataStart
+
sizeof
(
ICMP_Header_t
))
-
(
u
int
16
_t
)
FrameIN
->
FrameData
));
int
ptr
_t
DataSize
=
FrameIN
->
FrameLength
-
((((
int
ptr
_t
)
InDataStart
+
sizeof
(
ICMP_Header_t
))
-
(
int
ptr
_t
)
FrameIN
->
FrameData
));
/* Copy the remaining payload to the response - echo requests should echo back any sent data */
mem
cpy
(
&
((
uint8_t
*
)
OutDataStart
)[
sizeof
(
ICMP_Header_t
)],
&
((
uint8_t
*
)
InDataStart
)[
sizeof
(
ICMP_Header_t
)],
DataSize
);
mem
move
(
&
((
uint8_t
*
)
OutDataStart
)[
sizeof
(
ICMP_Header_t
)],
&
((
uint8_t
*
)
InDataStart
)[
sizeof
(
ICMP_Header_t
)],
DataSize
);
ICMPHeaderOUT
->
Checksum
=
Ethernet_Checksum16
(
ICMPHeaderOUT
,
(
DataSize
+
sizeof
(
ICMP_Header_t
)));
...
...
Demos/Device/LowLevel/RNDISEthernet/Lib/DHCP.c
View file @
54e69dbe
...
...
@@ -69,7 +69,7 @@ int16_t DHCP_ProcessDHCPPacket(void* IPHeaderInStart, void* DHCPHeaderInStart, v
DHCPHeaderOUT
->
ElapsedSeconds
=
0
;
DHCPHeaderOUT
->
Flags
=
DHCPHeaderIN
->
Flags
;
DHCPHeaderOUT
->
YourIP
=
ClientIPAddress
;
mem
cpy
(
&
DHCPHeaderOUT
->
ClientHardwareAddress
,
&
DHCPHeaderIN
->
ClientHardwareAddress
,
sizeof
(
MAC_Address_t
));
mem
move
(
&
DHCPHeaderOUT
->
ClientHardwareAddress
,
&
DHCPHeaderIN
->
ClientHardwareAddress
,
sizeof
(
MAC_Address_t
));
DHCPHeaderOUT
->
Cookie
=
SwapEndian_32
(
DHCP_MAGIC_COOKIE
);
/* Alter the incoming IP packet header so that the corrected IP source and destinations are used - this means that
...
...
Demos/Device/LowLevel/RNDISEthernet/Lib/ICMP.c
View file @
54e69dbe
...
...
@@ -62,12 +62,12 @@ int16_t ICMP_ProcessICMPPacket(void* InDataStart, void* OutDataStart)
ICMPHeaderOUT
->
Id
=
ICMPHeaderIN
->
Id
;
ICMPHeaderOUT
->
Sequence
=
ICMPHeaderIN
->
Sequence
;
u
int
16
_t
DataSize
=
FrameIN
.
FrameLength
-
((((
u
int
16
_t
)
InDataStart
+
sizeof
(
ICMP_Header_t
))
-
(
u
int
16
_t
)
FrameIN
.
FrameData
));
int
ptr
_t
DataSize
=
FrameIN
.
FrameLength
-
((((
int
ptr
_t
)
InDataStart
+
sizeof
(
ICMP_Header_t
))
-
(
int
ptr
_t
)
FrameIN
.
FrameData
));
/* Copy the remaining payload to the response - echo requests should echo back any sent data */
mem
cpy
(
&
((
uint8_t
*
)
OutDataStart
)[
sizeof
(
ICMP_Header_t
)],
&
((
uint8_t
*
)
InDataStart
)[
sizeof
(
ICMP_Header_t
)],
DataSize
);
mem
move
(
&
((
uint8_t
*
)
OutDataStart
)[
sizeof
(
ICMP_Header_t
)],
&
((
uint8_t
*
)
InDataStart
)[
sizeof
(
ICMP_Header_t
)],
DataSize
);
ICMPHeaderOUT
->
Checksum
=
Ethernet_Checksum16
(
ICMPHeaderOUT
,
(
DataSize
+
sizeof
(
ICMP_Header_t
)));
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment