From 9e9c08b6d7c6149c03e2a8034181f424cf6da531 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 19 Nov 2012 08:25:53 +1100 Subject: [PATCH] DigitalWriteFast: fixed memory cast to work on SITL build --- libraries/DigitalWriteFast/DigitalWriteFast.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/DigitalWriteFast/DigitalWriteFast.h b/libraries/DigitalWriteFast/DigitalWriteFast.h index 612780eb4e..35fd965cac 100644 --- a/libraries/DigitalWriteFast/DigitalWriteFast.h +++ b/libraries/DigitalWriteFast/DigitalWriteFast.h @@ -118,7 +118,7 @@ #define __atomicWrite__(A,P,V) \ -if ( (int)(A) < 0x40) { bitWrite(*(A), __digitalPinToBit(P), (V) );} \ +if ( (intptr_t)(A) < 0x40) { bitWrite(*(A), __digitalPinToBit(P), (V) );} \ else { \ uint8_t register saveSreg = SREG; \ cli(); \ @@ -152,7 +152,7 @@ else pinMode((P), (V)); \ #ifndef digitalReadFast - #define digitalReadFast(P) ( (int) _digitalReadFast_((P)) ) + #define digitalReadFast(P) ( (intptr_t) _digitalReadFast_((P)) ) #define _digitalReadFast_(P ) \ (__builtin_constant_p(P) ) ? ( \ ( BIT_READ(*digitalPinToPINReg(P), __digitalPinToBit(P))) ) : \