git-svn-id: svn://svn.code.sf.net/p/chibios/svn/branches/kernel_3_dev@6515 35acf78f-673a-0410-8e92-d51de3d6d3f4

master
gdisirio 2013-11-30 09:12:10 +00:00
parent 83fa155385
commit 8a162d65ea
3 changed files with 13 additions and 3 deletions

View File

@ -230,7 +230,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--;
}
@ -328,7 +328,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--;
}
@ -357,7 +357,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--;
}

View File

@ -77,6 +77,11 @@ typedef uint32_t ucnt_t; /**< Generic unsigned counter. */
#define PORT_THD_FUNCTION(tname, arg) \
__attribute__((noreturn)) void tname(void *arg)
/**
* @brief Packed variable specifier.
*/
#define PACKED_VAR __attribute__((packed))
#endif /* _NILTYPES_H_ */
/** @} */

View File

@ -101,6 +101,11 @@ typedef uint32_t ucnt_t; /**< Generic unsigned counter. */
*/
#define PORT_THD_FUNCTION(tname, arg) msg_t tname(void *arg)
/**
* @brief Packed variable specifier.
*/
#define PACKED_VAR __attribute__((packed))
#endif /* _CHTYPES_H_ */
/** @} */