1
0
mirror of https://github.com/arduino/Arduino.git synced 2024-12-01 12:24:14 +01:00

Ethernet library fix for avr-gcc v4.5.1 (and maybe others). (SurferTim)

This is a change in a few lines for combining two 8-bit values into a 16-bit one.  For some reason, the old way doesn't seem to work properly with certain gcc versions.

http://code.google.com/p/arduino/issues/detail?id=605
This commit is contained in:
David A. Mellis 2011-12-08 16:50:59 -05:00
parent 7b8888a93a
commit 597da2e45d

View File

@ -270,7 +270,10 @@ private:
} \ } \
static uint16_t read##name(SOCKET _s) { \ static uint16_t read##name(SOCKET _s) { \
uint16_t res = readSn(_s, address); \ 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; \ return res; \
} }
#define __SOCKET_REGISTER_N(name, address, size) \ #define __SOCKET_REGISTER_N(name, address, size) \