aboutsummaryrefslogtreecommitdiffstats
path: root/os/common/ports
diff options
context:
space:
mode:
authorawygle <awygle@gmail.com>2016-05-04 23:47:33 -0700
committerawygle <awygle@gmail.com>2016-05-04 23:47:33 -0700
commitcf02c79b5aa7209542cbf1b0cefe703a2c0c60be (patch)
tree0557b4194870b710411fbddaf1c58eb432e2d0d4 /os/common/ports
parentfe1d3f21146b1d28bd281b3682a528042b80253c (diff)
downloadChibiOS-Contrib-cf02c79b5aa7209542cbf1b0cefe703a2c0c60be.tar.gz
ChibiOS-Contrib-cf02c79b5aa7209542cbf1b0cefe703a2c0c60be.tar.bz2
ChibiOS-Contrib-cf02c79b5aa7209542cbf1b0cefe703a2c0c60be.zip
Merge pull request #68 from awygle/msp430x
MSP430X DMA Support, EXP430FR6989 Demo + Makefile Updates
Diffstat (limited to 'os/common/ports')
-rw-r--r--os/common/ports/MSP430X/chcore.c4
-rw-r--r--os/common/ports/MSP430X/compilers/GCC/chtypes.h14
2 files changed, 15 insertions, 3 deletions
diff --git a/os/common/ports/MSP430X/chcore.c b/os/common/ports/MSP430X/chcore.c
index 4e09b8f..7a8d7f2 100644
--- a/os/common/ports/MSP430X/chcore.c
+++ b/os/common/ports/MSP430X/chcore.c
@@ -58,11 +58,11 @@
* @param[in] ntp the thread to be switched in
* @param[in] otp the thread to be switched out
*/
-#if !defined(__DOXYGEN__) && defined(__OPTIMIZE__)
+#if !(__GNUC__ < 6 && __GNUC_MINOR__ < 4) || defined(__OPTIMIZE__)
__attribute__((naked))
#endif
void _port_switch(thread_t *ntp, thread_t *otp) {
-#if !defined(__OPTIMIZE__)
+#if (__GNUC__ < 6 && __GNUC_MINOR__ < 4) && !defined(__OPTIMIZE__)
asm volatile ("add #4, r1");
#endif
(void)(ntp);
diff --git a/os/common/ports/MSP430X/compilers/GCC/chtypes.h b/os/common/ports/MSP430X/compilers/GCC/chtypes.h
index 11cc980..46a074c 100644
--- a/os/common/ports/MSP430X/compilers/GCC/chtypes.h
+++ b/os/common/ports/MSP430X/compilers/GCC/chtypes.h
@@ -94,6 +94,18 @@ typedef uint16_t ucnt_t; /**< Generic unsigned counter. */
*/
#define ALIGNED_VAR(n) __attribute__((aligned(n)))
-#endif /* _NILTYPES_H_ */
+/**
+ * @brief Size of a pointer.
+ * @note To be used where the sizeof operator cannot be used, preprocessor
+ * expressions for example.
+ */
+#define SIZEOF_PTR 4
+
+/**
+ * @brief True if alignment is low-high in current architecture.
+ */
+#define REVERSE_ORDER 1
+
+#endif /* CHTYPES_H */
/** @} */