diff --git a/platform/msb430/dev/cc1020-internal.h b/platform/msb430/dev/cc1020-internal.h index 0a38a64e7..6748b1f44 100644 --- a/platform/msb430/dev/cc1020-internal.h +++ b/platform/msb430/dev/cc1020-internal.h @@ -236,8 +236,6 @@ enum cc1020_state { * @{ */ -const uint8_t syncword[2] = {0xD3,0x91}; - // header: number of bytes in packet including header struct cc1020_header { uint8_t pad; @@ -251,7 +249,7 @@ struct cc1020_header { #define PREAMBLE_SIZE 6 #define PREAMBLE 0xAA -#define SYNCWORD_SIZE (sizeof (syncword)) +#define SYNCWORD_SIZE 2 #define HDR_SIZE (sizeof (struct cc1020_header)) #define CRC_SIZE 2 diff --git a/platform/msb430/dev/cc1020.c b/platform/msb430/dev/cc1020.c index a40d00940..83b1a3be4 100644 --- a/platform/msb430/dev/cc1020.c +++ b/platform/msb430/dev/cc1020.c @@ -75,6 +75,8 @@ static void cc1020_write_reg(uint8_t addr, uint8_t adata); static void cc1020_load_config(const uint8_t *); static void cc1020_reset(void); +static const uint8_t syncword[SYNCWORD_SIZE] = {0xD3, 0x91}; + /* current mode of cc1020 chip */ static volatile enum cc1020_state cc1020_state = CC1020_OFF; static volatile uint8_t cc1020_rxbuf[HDR_SIZE + CC1020_BUFFERSIZE]; @@ -138,7 +140,8 @@ cc1020_init(const uint8_t *config) /* init tx buffer with preamble + syncword */ memset(cc1020_txbuf, PREAMBLE, PREAMBLE_SIZE); - memcpy((char *)cc1020_txbuf + PREAMBLE_SIZE, &syncword, SYNCWORD_SIZE); + cc1020_txbuf[PREAMBLE_SIZE] = syncword[0]; + cc1020_txbuf[PREAMBLE_SIZE + 1] = syncword[1]; /* calibrate receiver */ cc1020_wakeupRX(RX_CURRENT);