Added mutex for multiple SPI devices on the same SPI bus
Fork of cc3000_hostdriver_mbedsocket by
Diff: Socket/Socket.cpp
- Revision:
- 45:50ab13d8f2dc
- Parent:
- 17:14b6a3a2b622
diff -r 960b73df5981 -r 50ab13d8f2dc Socket/Socket.cpp --- a/Socket/Socket.cpp Sun Oct 13 11:46:21 2013 +0200 +++ b/Socket/Socket.cpp Wed Nov 06 17:56:25 2013 +0100 @@ -37,7 +37,7 @@ DBG_SOCKET("Failed to create new socket (type: %d, protocol: %d)",type, protocol); return -1; } - + DBG_SOCKET("Socket created (fd: %d type: %d, protocol: %d)",fd, type, protocol); _sock_fd = fd; @@ -50,7 +50,11 @@ } int Socket::set_option(int level, int optname, const void *optval, socklen_t optlen) { +#ifndef CC3000_TINY_DRIVER return _cc3000_module->_socket.setsockopt(_sock_fd, level, optname, optval, optlen); +#else + return -1; +#endif } int Socket::get_option(int level, int optname, void *optval, socklen_t *optlen) { @@ -70,9 +74,9 @@ fd_set* writeset = (write) ? (&fdSet) : (NULL); int ret = _cc3000_module->_socket.select(_sock_fd+1, readset, writeset, NULL, timeout); - + DBG_SOCKET("Select on sock_fd: %d, returns %d. fdSet: %d", _sock_fd, ret, FD_ISSET(_sock_fd, &fdSet)); - + // TODO //return (ret <= 0 || !FD_ISSET(_sock_fd, &fdSet)) ? (-1) : (0); if (FD_ISSET(_sock_fd, &fdSet)) {