diff options
author | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2013-11-30 09:14:06 +0000 |
---|---|---|
committer | gdisirio <gdisirio@35acf78f-673a-0410-8e92-d51de3d6d3f4> | 2013-11-30 09:14:06 +0000 |
commit | c86a5d888757ac3c861e0cf6d28671ea97bddc98 (patch) | |
tree | 2ffdb95d278caa80748297dec60c513d235072b0 /os | |
parent | ff8d0f326cea945049dd084ac0d3599efb9e908d (diff) | |
download | ChibiOS-c86a5d888757ac3c861e0cf6d28671ea97bddc98.tar.gz ChibiOS-c86a5d888757ac3c861e0cf6d28671ea97bddc98.tar.bz2 ChibiOS-c86a5d888757ac3c861e0cf6d28671ea97bddc98.zip |
Fixed bug #434.
git-svn-id: svn://svn.code.sf.net/p/chibios/svn/trunk@6517 35acf78f-673a-0410-8e92-d51de3d6d3f4
Diffstat (limited to 'os')
-rw-r--r-- | os/hal/platforms/STM32/OTGv1/usb_lld.c | 6 | ||||
-rw-r--r-- | os/ports/GCC/ARMCMx/chtypes.h | 5 | ||||
-rw-r--r-- | os/ports/IAR/ARMCMx/chtypes.h | 5 | ||||
-rw-r--r-- | os/ports/RVCT/ARMCMx/chtypes.h | 5 |
4 files changed, 18 insertions, 3 deletions
diff --git a/os/hal/platforms/STM32/OTGv1/usb_lld.c b/os/hal/platforms/STM32/OTGv1/usb_lld.c index 4af75ccd2..35b5335e5 100644 --- a/os/hal/platforms/STM32/OTGv1/usb_lld.c +++ b/os/hal/platforms/STM32/OTGv1/usb_lld.c @@ -246,7 +246,7 @@ static uint8_t *otg_do_push(volatile uint32_t *fifop, uint8_t *buf, size_t n) { while (n > 0) {
/* Note, this line relies on the Cortex-M3/M4 ability to perform
unaligned word accesses and on the LSB-first memory organization.*/
- *fifop = *((uint32_t *)buf);
+ *fifop = *((PACKED_VAR uint32_t *)buf);
buf += 4;
n--;
}
@@ -345,7 +345,7 @@ static uint8_t *otg_do_pop(volatile uint32_t *fifop, uint8_t *buf, size_t n) { uint32_t w = *fifop;
/* Note, this line relies on the Cortex-M3/M4 ability to perform
unaligned word accesses and on the LSB-first memory organization.*/
- *((uint32_t *)buf) = w;
+ *((PACKED_VAR uint32_t *)buf) = w;
buf += 4;
n--;
}
@@ -374,7 +374,7 @@ static void otg_fifo_read_to_buffer(volatile uint32_t *fifop, if (max) {
/* Note, this line relies on the Cortex-M3/M4 ability to perform
unaligned word accesses and on the LSB-first memory organization.*/
- *((uint32_t *)buf) = w;
+ *((PACKED_VAR uint32_t *)buf) = w;
buf += 4;
max--;
}
diff --git a/os/ports/GCC/ARMCMx/chtypes.h b/os/ports/GCC/ARMCMx/chtypes.h index a94ae24ae..5116a79a7 100644 --- a/os/ports/GCC/ARMCMx/chtypes.h +++ b/os/ports/GCC/ARMCMx/chtypes.h @@ -75,6 +75,11 @@ typedef int32_t cnt_t; /**< Resources counter. */ */
#define PACK_STRUCT_END
+/**
+ * @brief Packed variable specifier.
+ */
+#define PACKED_VAR __attribute__((packed))
+
#endif /* _CHTYPES_H_ */
/** @} */
diff --git a/os/ports/IAR/ARMCMx/chtypes.h b/os/ports/IAR/ARMCMx/chtypes.h index 9855c4e00..d2a55bbfe 100644 --- a/os/ports/IAR/ARMCMx/chtypes.h +++ b/os/ports/IAR/ARMCMx/chtypes.h @@ -74,6 +74,11 @@ typedef int32_t cnt_t; /**< Resources counter. */ */
#define PACK_STRUCT_END
+/**
+ * @brief Packed variable specifier.
+ */
+#define PACKED_VAR __packed
+
#endif /* _CHTYPES_H_ */
/** @} */
diff --git a/os/ports/RVCT/ARMCMx/chtypes.h b/os/ports/RVCT/ARMCMx/chtypes.h index b3f19f674..ec76fd523 100644 --- a/os/ports/RVCT/ARMCMx/chtypes.h +++ b/os/ports/RVCT/ARMCMx/chtypes.h @@ -74,6 +74,11 @@ typedef int32_t cnt_t; /**< Resources counter. */ */
#define PACK_STRUCT_END
+/**
+ * @brief Packed variable specifier.
+ */
+#define PACKED_VAR __packed
+
#endif /* _CHTYPES_H_ */
/** @} */
|