git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1194 35acf78f-673a-0410-8e92-d51de3d6d3f4
parent
ea9916ae79
commit
3a397f9f5b
|
@ -5,7 +5,7 @@
|
||||||
|
|
||||||
# Compiler options here.
|
# Compiler options here.
|
||||||
ifeq ($(USE_OPT),)
|
ifeq ($(USE_OPT),)
|
||||||
USE_OPT = -O0 -ggdb -fomit-frame-pointer -mabi=apcs-gnu
|
USE_OPT = -O2 -ggdb -fomit-frame-pointer -mabi=apcs-gnu
|
||||||
endif
|
endif
|
||||||
|
|
||||||
# C++ specific options here (added to USE_OPT).
|
# C++ specific options here (added to USE_OPT).
|
||||||
|
|
|
@ -388,9 +388,11 @@ size_t mac_lld_read_receive_descriptor(MACReceiveDescriptor *rdp,
|
||||||
uint8_t *src = (uint8_t *)(rdp->rd_physdesc->w1 & W1_R_ADDRESS_MASK) +
|
uint8_t *src = (uint8_t *)(rdp->rd_physdesc->w1 & W1_R_ADDRESS_MASK) +
|
||||||
rdp->rd_offset;
|
rdp->rd_offset;
|
||||||
uint8_t *limit = &rb[EMAC_RECEIVE_DESCRIPTORS * EMAC_RECEIVE_BUFFERS_SIZE];
|
uint8_t *limit = &rb[EMAC_RECEIVE_DESCRIPTORS * EMAC_RECEIVE_BUFFERS_SIZE];
|
||||||
|
if (src >= limit)
|
||||||
|
src -= EMAC_RECEIVE_DESCRIPTORS * EMAC_RECEIVE_BUFFERS_SIZE;
|
||||||
if (src + size > limit ) {
|
if (src + size > limit ) {
|
||||||
memcpy(buf, src, (size_t)(limit - src));
|
memcpy(buf, src, (size_t)(limit - src));
|
||||||
memcpy(buf, rb, (size_t)(src + size - limit));
|
memcpy(buf + (size_t)(limit - src), rb, size - (size_t)(limit - src));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
memcpy(buf, src, size);
|
memcpy(buf, src, size);
|
||||||
|
|
Loading…
Reference in New Issue