From a2db099bf748cef5f150f87c4a5022afa006bf7c Mon Sep 17 00:00:00 2001 From: Christian Lins Date: Wed, 28 Sep 2011 23:42:52 +0300 Subject: [PATCH] Workaround for gcc(?) issue as described here: http://arduino.cc/forum/index.php/topic,68624.msg523739.html#msg523739 --- libraries/Ethernet/utility/w5100.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/libraries/Ethernet/utility/w5100.h b/libraries/Ethernet/utility/w5100.h index 118e5d80d43..1d6ad7df023 100755 --- a/libraries/Ethernet/utility/w5100.h +++ b/libraries/Ethernet/utility/w5100.h @@ -258,7 +258,10 @@ class W5100Class { } \ static uint16_t read##name(SOCKET _s) { \ uint16_t res = readSn(_s, address); \ - res = (res << 8) + readSn(_s, address + 1); \ + uint16_t res2 = readSn(_s,address + 1); \ + res = res << 8; \ + res2 = res2 & 0xFF; \ + res = res | res2; \ return res; \ } #define __SOCKET_REGISTER_N(name, address, size) \