From 417c7f8c70f7ed9d8e9103b1e175191f5045d978 Mon Sep 17 00:00:00 2001 From: adamdunkels Date: Thu, 16 Dec 2010 22:39:50 +0000 Subject: [PATCH] Added parenthesis around addresses to allow expressions as arguments --- core/dev/cc2420.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/core/dev/cc2420.h b/core/dev/cc2420.h index c96957487..c23e0207f 100644 --- a/core/dev/cc2420.h +++ b/core/dev/cc2420.h @@ -28,7 +28,7 @@ * * This file is part of the Contiki operating system. * - * $Id: cc2420.h,v 1.13 2010/09/23 08:26:06 nifi Exp $ + * $Id: cc2420.h,v 1.14 2010/12/16 22:39:50 adamdunkels Exp $ */ /** @@ -169,8 +169,8 @@ void cc2420_set_cca_threshold(int value); do { \ uint8_t i; \ CC2420_SPI_ENABLE(); \ - SPI_WRITE_FAST(0x80 | (adr & 0x7f)); \ - SPI_WRITE_FAST((adr >> 1) & 0xc0); \ + SPI_WRITE_FAST(0x80 | ((adr) & 0x7f)); \ + SPI_WRITE_FAST(((adr) >> 1) & 0xc0); \ for(i = 0; i < (count); i++) { \ SPI_WRITE_FAST(((uint8_t*)(buffer))[i]); \ } \ @@ -183,8 +183,8 @@ void cc2420_set_cca_threshold(int value); do { \ uint8_t i; \ CC2420_SPI_ENABLE(); \ - SPI_WRITE(0x80 | (adr & 0x7f)); \ - SPI_WRITE(((adr >> 1) & 0xc0) | 0x20); \ + SPI_WRITE(0x80 | ((adr) & 0x7f)); \ + SPI_WRITE((((adr) >> 1) & 0xc0) | 0x20); \ SPI_RXBUF; \ for(i = 0; i < (count); i++) { \ SPI_READ(((uint8_t*)(buffer))[i]); \