Added mutex for multiple SPI devices on the same SPI bus

Fork of cc3000_hostdriver_mbedsocket by Martin Kojtal

Revision:
11:5e3771b29385
Parent:
8:4c42ca37ba33
Child:
12:1c2a856c618a
Child:
13:5e36c267e62f
--- a/Socket/Socket.cpp	Tue Oct 01 04:41:47 2013 +0000
+++ b/Socket/Socket.cpp	Tue Oct 01 21:17:44 2013 +0000
@@ -29,7 +29,7 @@
 int Socket::init_socket(int type, int protocol) {
     if (_sock_fd != -1) {
 #if (CC3000_DEBUG == 1)
-        printf("DEBUG: Socket was initialized previously.\n");
+        printf("DEBUG: Socket was initialized previously.\r\n");
 #endif
         return -1;
     }
@@ -37,12 +37,12 @@
     int fd = _cc3000_module->_socket.socket(AF_INET, type, protocol);
     if (fd < -1) {
 #if (CC3000_DEBUG == 1)
-        printf("DEBUG: Failed to create new socket (type: %d, protocol: %d).\n",type, protocol);
+        printf("DEBUG: Failed to create new socket (type: %d, protocol: %d).\r\n",type, protocol);
 #endif
         return -1;
     }
 #if (CC3000_DEBUG == 1)
-        printf("DEBUG: Socket created (fd: %d type: %d, protocol: %d).\n",fd, type, protocol);
+        printf("DEBUG: Socket created (fd: %d type: %d, protocol: %d).\r\n",fd, type, protocol);
 #endif
     _sock_fd = fd;
 
@@ -76,7 +76,7 @@
 
     int ret = _cc3000_module->_socket.select(_sock_fd+1, readset, writeset, NULL, timeout);
 #if (CC3000_DEBUG == 1)
-    printf("DEBUG: Select on sock_fd: %d, returns %d. fdSet: %d\n",_sock_fd, ret, fdSet);
+    printf("DEBUG: Select on sock_fd: %d, returns %d. fdSet: %d\r\n",_sock_fd, ret, fdSet);
 #endif
     // TODO
     //return (ret <= 0 || !FD_ISSET(_sock_fd, &fdSet)) ? (-1) : (0);