aboutsummaryrefslogtreecommitdiffstats
path: root/os
diff options
context:
space:
mode:
authorFabio Utzig <utzig@utzig.org>2016-10-27 16:09:38 +0000
committerFabio Utzig <utzig@utzig.org>2016-10-27 16:09:38 +0000
commit938af64be310a7973e02fda1ef48c55667b4df48 (patch)
tree537207075bb262c77d0c9f7aaec503bc3e863d6a /os
parent6a3e9bfe0be936a57c1c6ba8fde254ef60040ba5 (diff)
downloadChibiOS-938af64be310a7973e02fda1ef48c55667b4df48.tar.gz
ChibiOS-938af64be310a7973e02fda1ef48c55667b4df48.tar.bz2
ChibiOS-938af64be310a7973e02fda1ef48c55667b4df48.zip
Applied latest warning fix also for 3-byte PC sized models
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@9887 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os')
-rw-r--r--os/common/ports/AVR/chcore.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/os/common/ports/AVR/chcore.h b/os/common/ports/AVR/chcore.h
index f749383b2..87ada538b 100644
--- a/os/common/ports/AVR/chcore.h
+++ b/os/common/ports/AVR/chcore.h
@@ -250,13 +250,13 @@ struct port_context {
#define PORT_SETUP_CONTEXT(tp, wbase, wtop, pf, arg) { \
tp->ctx.sp = (struct port_intctx *)((uint8_t *)(wtop) - \
sizeof(struct port_intctx)); \
- tp->ctx.sp->r2 = (uint8_t)(pf); \
+ tp->ctx.sp->r2 = (uint8_t)(0xff & (uint16_t)pf); \
tp->ctx.sp->r3 = (uint8_t)((uint16_t)(pf) >> 8); \
- tp->ctx.sp->r4 = (uint8_t)(arg); \
+ tp->ctx.sp->r4 = (uint8_t)(0xff & (uint16_t)arg); \
tp->ctx.sp->r5 = (uint8_t)((uint16_t)(arg) >> 8); \
tp->ctx.sp->pcx = (uint8_t)0; \
tp->ctx.sp->pcl = (uint16_t)_port_thread_start >> 8; \
- tp->ctx.sp->pch = (uint8_t)_port_thread_start; \
+ tp->ctx.sp->pch = (uint8_t)(0xff & (uint16_t)_port_thread_start); \
}
#else /* !__AVR_3_BYTE_PC__ */
#define PORT_SETUP_CONTEXT(tp, wbase, wtop, pf, arg) { \