35 #if defined(__IAR_SYSTEMS_ICC__) || defined(__MSPGCC__)
38 #include <legacymsp430.h>
45 #ifdef __IAR_SYSTEMS_ICC__
46 #include <intrinsics.h>
48 #define dint() __disable_interrupt()
49 #define eint() __enable_interrupt()
50 #define __MSP430F1611__ 1
52 #define CC_CONF_INLINE
53 #define BV(x) (1 << x)
55 #define CC_CONF_INLINE inline
56 #define MSP430_MEMCPY_WORKAROUND 1
63 typedef unsigned char uint8_t;
64 typedef unsigned short uint16_t;
65 typedef unsigned long uint32_t;
66 typedef signed char int8_t;
67 typedef short int16_t;
74 typedef uint16_t
u16_t;
75 typedef uint32_t
u32_t;
76 typedef int32_t
s32_t;
79 #ifdef DCOSYNCH_CONF_PERIOD
80 #define DCOSYNCH_PERIOD DCOSYNCH_CONF_PERIOD
82 #define DCOSYNCH_PERIOD 30
85 void msp430_cpu_init(
void);
86 void msp430_sync_dco(
void);
89 #define cpu_init() msp430_cpu_init()
97 #define splhigh() splhigh_()
98 #ifdef __IAR_SYSTEMS_ICC__
99 #define splx(sr) sr = __get_SR_register()
101 #define splx(sr) __asm__ __volatile__("bis %0, r2" : : "r" (sr))
105 #if defined(__MSP430__) && defined(__GNUC__) && MSP430_MEMCPY_WORKAROUND
109 void *w_memcpy(
void *out,
const void *in,
size_t n);
110 #define memcpy(dest, src, count) w_memcpy(dest, src, count)
121 void *w_memset(
void *out,
int value,
size_t n);
122 #define memset(dest, value, count) w_memset(dest, value, count)
139 #define MSP430_CPU_SPEED F_CPU
141 #define MSP430_CPU_SPEED 2457600UL
144 #define MSP430_REQUIRE_CPUON 0
145 #define MSP430_REQUIRE_LPM1 1
146 #define MSP430_REQUIRE_LPM2 2
147 #define MSP430_REQUIRE_LPM3 3
149 void msp430_add_lpm_req(
int req);
150 void msp430_remove_lpm_req(
int req);