diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2009-09-29 20:16:06 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2009-09-29 20:16:06 +0000 |
commit | 3a397f9f5b3920339a7316e09379bc25dd5195a0 (patch) | |
tree | 64fe653037fdb1a8027b7692786fd1c0b76f35ed | |
parent | ea9916ae798da3689d64689b88343d26508d137e (diff) | |
download | ChibiOS-3a397f9f5b3920339a7316e09379bc25dd5195a0.tar.gz ChibiOS-3a397f9f5b3920339a7316e09379bc25dd5195a0.tar.bz2 ChibiOS-3a397f9f5b3920339a7316e09379bc25dd5195a0.zip |
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@1194 35acf78f-673a-0410-8e92-d51de3d6d3f4
-rw-r--r-- | demos/ARM7-AT91SAM7X-WEB-GCC/Makefile | 2 | ||||
-rw-r--r-- | os/io/platforms/AT91SAM7X/mac_lld.c | 4 |
2 files changed, 4 insertions, 2 deletions
diff --git a/demos/ARM7-AT91SAM7X-WEB-GCC/Makefile b/demos/ARM7-AT91SAM7X-WEB-GCC/Makefile index 345cb3d13..bb4c21c1a 100644 --- a/demos/ARM7-AT91SAM7X-WEB-GCC/Makefile +++ b/demos/ARM7-AT91SAM7X-WEB-GCC/Makefile @@ -5,7 +5,7 @@ # Compiler options here.
ifeq ($(USE_OPT),)
- USE_OPT = -O0 -ggdb -fomit-frame-pointer -mabi=apcs-gnu
+ USE_OPT = -O2 -ggdb -fomit-frame-pointer -mabi=apcs-gnu
endif
# C++ specific options here (added to USE_OPT).
diff --git a/os/io/platforms/AT91SAM7X/mac_lld.c b/os/io/platforms/AT91SAM7X/mac_lld.c index 7ebee112d..d7a7a947f 100644 --- a/os/io/platforms/AT91SAM7X/mac_lld.c +++ b/os/io/platforms/AT91SAM7X/mac_lld.c @@ -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) +
rdp->rd_offset;
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 ) {
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
memcpy(buf, src, size);
|