X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=bertos%2Fcpu%2Fcortex-m3%2Fio%2Flm3s_types.h;h=ab1a822b0ef1847a179e5429faaa76a43e841cdb;hb=ab03b5b37726fb8b39a6f6c915f8668bddd779ee;hp=eede2c0305784e4df69f88a9b62ede739bc27094;hpb=42915fdb2ea25ed68b8bb835b78c2bca9b32f1f5;p=bertos.git diff --git a/bertos/cpu/cortex-m3/io/lm3s_types.h b/bertos/cpu/cortex-m3/io/lm3s_types.h index eede2c03..ab1a822b 100644 --- a/bertos/cpu/cortex-m3/io/lm3s_types.h +++ b/bertos/cpu/cortex-m3/io/lm3s_types.h @@ -36,25 +36,25 @@ #ifndef LM3S_TYPES_H #define LM3S_TYPES_H +#include + /** * Macros for hardware access, both direct and via the bit-band region. */ /*\{*/ -#define HWREG(x) \ - (*((volatile unsigned long *)(x))) -#define HWREGH(x) \ - (*((volatile unsigned short *)(x))) -#define HWREGB(x) \ - (*((volatile unsigned char *)(x))) -#define HWREGBITW(x, b) \ - HWREG(((unsigned long)(x) & 0xF0000000) | 0x02000000 | \ - (((unsigned long)(x) & 0x000FFFFF) << 5) | ((b) << 2)) -#define HWREGBITH(x, b) \ - HWREGH(((unsigned long)(x) & 0xF0000000) | 0x02000000 | \ - (((unsigned long)(x) & 0x000FFFFF) << 5) | ((b) << 2)) -#define HWREGBITB(x, b) \ - HWREGB(((unsigned long)(x) & 0xF0000000) | 0x02000000 | \ - (((unsigned long)(x) & 0x000FFFFF) << 5) | ((b) << 2)) +#define HWREG(x) (*((reg32_t *)(x))) +#define HWREGH(x) (*((reg16_t *)(x))) +#define HWREGB(x) (*((reg8_t *)(x))) + +#define HWREGBITW(x, b) \ + HWREG(((reg32_t)(x) & 0xF0000000) | 0x02000000 | \ + (((reg32_t)(x) & 0x000FFFFF) << 5) | ((b) << 2)) +#define HWREGBITH(x, b) \ + HWREGH(((reg32_t)(x) & 0xF0000000) | 0x02000000 | \ + (((reg32_t)(x) & 0x000FFFFF) << 5) | ((b) << 2)) +#define HWREGBITB(x, b) \ + HWREGB(((reg32_t)(x) & 0xF0000000) | 0x02000000 | \ + (((reg32_t)(x) & 0x000FFFFF) << 5) | ((b) << 2)) /*\}*/ /**