-
-
Notifications
You must be signed in to change notification settings - Fork 7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2365 from cmaglie/ide-1.0.x-spi-transaction
[IDE 1.0.x (backport from 1.5.x)] SPI Transactions
- Loading branch information
Showing
45 changed files
with
1,071 additions
and
456 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -34,6 +34,8 @@ | |
extern "C"{ | ||
#endif | ||
|
||
void yield(void); | ||
|
||
#define HIGH 0x1 | ||
#define LOW 0x0 | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
/* | ||
Copyright (c) 2012 Arduino. All right reserved. | ||
This library is free software; you can redistribute it and/or | ||
modify it under the terms of the GNU Lesser General Public | ||
License as published by the Free Software Foundation; either | ||
version 2.1 of the License, or (at your option) any later version. | ||
This library is distributed in the hope that it will be useful, | ||
but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. | ||
See the GNU Lesser General Public License for more details. | ||
You should have received a copy of the GNU Lesser General Public | ||
License along with this library; if not, write to the Free Software | ||
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA | ||
*/ | ||
|
||
/** | ||
* Empty yield() hook. | ||
* | ||
* This function is intended to be used by library writers to build | ||
* libraries or sketches that supports cooperative threads. | ||
* | ||
* Its defined as a weak symbol and it can be redefined to implement a | ||
* real cooperative scheduler. | ||
*/ | ||
static void __empty() { | ||
// Empty | ||
} | ||
void yield(void) __attribute__ ((weak, alias("__empty"))); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,8 +26,8 @@ | |
* [email protected] 12/30/2008 | ||
*/ | ||
|
||
#include "w5100.h" | ||
#include "socket.h" | ||
#include "utility/w5100.h" | ||
#include "utility/socket.h" | ||
#include "Ethernet.h" | ||
#include "Udp.h" | ||
#include "Dns.h" | ||
|
@@ -41,7 +41,7 @@ uint8_t EthernetUDP::begin(uint16_t port) { | |
return 0; | ||
|
||
for (int i = 0; i < MAX_SOCK_NUM; i++) { | ||
uint8_t s = W5100.readSnSR(i); | ||
uint8_t s = socketStatus(i); | ||
if (s == SnSR::CLOSED || s == SnSR::FIN_WAIT) { | ||
_sock = i; | ||
break; | ||
|
@@ -120,7 +120,7 @@ int EthernetUDP::parsePacket() | |
// discard any remaining bytes in the last packet | ||
flush(); | ||
|
||
if (W5100.getRXReceivedSize(_sock) > 0) | ||
if (recvAvailable(_sock) > 0) | ||
{ | ||
//HACK - hand-parse the UDP packet using TCP recv method | ||
uint8_t tmpBuf[8]; | ||
|
Oops, something went wrong.