From b2fe6b8e9c04035fb025ffa128ab4ab5e925f88f Mon Sep 17 00:00:00 2001 From: follower Date: Sat, 8 Dec 2007 02:53:04 +0000 Subject: [PATCH] Move the byte receiving into a convenience function and stop using the rx buffer. git-svn-id: svn+ssh://oldsvn/home/mlalondesvn/svn/cral@77 3ee9b42a-b53c-0410-a25e-f0b6218d5d5b --- .../follower/wiz810mj/src/demo/WizDemo3/WizDemo3.pde | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/branches/follower/wiz810mj/src/demo/WizDemo3/WizDemo3.pde b/branches/follower/wiz810mj/src/demo/WizDemo3/WizDemo3.pde index 8b00e8f..65434d3 100644 --- a/branches/follower/wiz810mj/src/demo/WizDemo3/WizDemo3.pde +++ b/branches/follower/wiz810mj/src/demo/WizDemo3/WizDemo3.pde @@ -193,6 +193,13 @@ void sendBanner(uint8_t *buffer, int ledState) { // {Socket targetSocket, ) { } +uint8_t readByte() { + uint8_t theByte; + recv(testSocket, &theByte, 1); + return theByte; +} + + void loop() { Serial.println("Test W5100 socket..."); @@ -256,8 +263,7 @@ void loop() { while (getSn_SR(testSocket) == SOCK_ESTABLISHED) { while (getSn_RX_RSR(testSocket) > 0) { - recv(testSocket, bytesReceived, 1); - theByte = bytesReceived[0]; + theByte = readByte(); //Serial.print(bytesReceived[0], BYTE); Serial.print(theByte, BYTE); if ((state == STATE_G) && (theByte == 'G')) {