Added mutex for multiple SPI devices on the same SPI bus
Fork of cc3000_hostdriver_mbedsocket by
Revision 37:3332f57b7f1e, committed 2013-10-12
- Comitter:
- Kojto
- Date:
- Sat Oct 12 14:27:46 2013 +0200
- Parent:
- 36:1f70a62a160e
- Child:
- 40:acb9324640c4
- Commit message:
- GCC conflict with FD_SET
Changed in this revision
| cc3000.cpp | Show annotated file Show diff for this revision Revisions of this file |
| cc3000_socket.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/cc3000.cpp Wed Oct 09 20:18:40 2013 +0200
+++ b/cc3000.cpp Sat Oct 12 14:27:46 2013 +0200
@@ -302,7 +302,7 @@
}
uint32_t cc3000::ping(uint32_t ip, uint8_t attempts, uint16_t timeout, uint8_t size) {
- uint32_t reversed_ip = (ip >> 24) | (ip >> 8) & 0xFF00 | (ip << 8) & 0xFF0000 | (ip << 24);
+ uint32_t reversed_ip = (ip >> 24) | ((ip >> 8) & 0xFF00) | ((ip << 8) & 0xFF0000) | (ip << 24);
_ping_report.packets_received = 0;
if (_netapp.ping_send(&reversed_ip, attempts, size, timeout) == -1) {
--- a/cc3000_socket.h Wed Oct 09 20:18:40 2013 +0200
+++ b/cc3000_socket.h Sat Oct 12 14:27:46 2013 +0200
@@ -134,8 +134,6 @@
#define IOCTL_SOCKET_EVENTMASK
-#define ENOBUFS 55 // No buffer space available
-
#define __FD_SETSIZE 32
#define ASIC_ADDR_LEN 8
@@ -172,6 +170,16 @@
#define __FDELT(d) ((d) / __NFDBITS)
#define __FDMASK(d) ((__fd_mask) 1 << ((d) % __NFDBITS))
+#ifndef FD_SET
+//not used in the current code
+#define ENOBUFS 55 // No buffer space available
+
+// Access macros for 'fd_set'.
+#define FD_SET(fd, fdsetp) __FD_SET (fd, fdsetp)
+#define FD_CLR(fd, fdsetp) __FD_CLR (fd, fdsetp)
+#define FD_ISSET(fd, fdsetp) __FD_ISSET (fd, fdsetp)
+#define FD_ZERO(fdsetp) __FD_ZERO (fdsetp)
+
// fd_set for select and pselect.
typedef struct
{
@@ -179,6 +187,8 @@
#define __FDS_BITS(set) ((set)->fds_bits)
} fd_set;
+#endif /* FD_SET */
+
// We don't use `memset' because this would require a prototype and
// the array isn't too big.
#define __FD_ZERO(set) \
@@ -192,12 +202,6 @@
#define __FD_CLR(d, set) (__FDS_BITS (set)[__FDELT (d)] &= ~__FDMASK (d))
#define __FD_ISSET(d, set) (__FDS_BITS (set)[__FDELT (d)] & __FDMASK (d))
-// Access macros for 'fd_set'.
-#define FD_SET(fd, fdsetp) __FD_SET (fd, fdsetp)
-#define FD_CLR(fd, fdsetp) __FD_CLR (fd, fdsetp)
-#define FD_ISSET(fd, fdsetp) __FD_ISSET (fd, fdsetp)
-#define FD_ZERO(fdsetp) __FD_ZERO (fdsetp)
-
//Use in case of Big Endian only
#define htonl(A) ((((uint32_t)(A) & 0xff000000) >> 24) | \
