01

Revision:
1:35fdc7056f66
Parent:
0:6262fc7582a9
Child:
2:5318159b5eab
Child:
3:b8d920737d9e
--- a/ModbusSlave232.cpp	Thu Jul 21 19:48:35 2016 +0000
+++ b/ModbusSlave232.cpp	Fri Jul 22 09:44:55 2016 +0000
@@ -1,4 +1,7 @@
 /* 		
+ Modified by Afdhal: arduino library so that it can be used on mbed.
+ 
+ Original message:
  Modbus over serial line - RTU Slave Arduino Sketch 
  
  By Juan Pablo Zometa : jpmzometa@gmail.com
@@ -48,6 +51,7 @@
 
 
 //#include "Arduino.h" //afdhal
+
 #include "millis.h"
 #include "MODSERIAL.h" //afdhal
 MODSERIAL pc(USBTX, USBRX); // tx, rx //afdhal
@@ -279,8 +283,8 @@
         int bytes_received = 0;
 
         /* FIXME: does Serial.available wait 1.5T or 3.5T before exiting the loop? */
-        //while (Serial.available()) { //afdhal
-        while (pc.readable()) { //afdhal
+        //while (Serial.available()) { 	//afdhal
+        while (pc.readable()) { 		//afdhal
                 received_string[bytes_received] = pc.getc(); //Serial.read(); //afdhal
                 //Serial.print(received_string[bytes_received], DEC);
                 bytes_received++;
@@ -536,7 +540,7 @@
 
 	
 	//Serial.begin(baud); //afdhal
-	pc.baud(baud);
+	pc.baud(baud); //afdhal
 
      switch (parity) {
         case 'e': // 8E1
@@ -650,7 +654,4 @@
                 break;                                
         }      
         
-}
-
-
-
+}
\ No newline at end of file