pierre Rousselin / Mbed 2 deprecated AX12

Dependencies:   mbed

Fork of AX12 by Chris Styles

Revision:
4:a7c95f3012db
Parent:
3:ced71d1b2558
diff -r ced71d1b2558 -r a7c95f3012db AX12.cpp
--- a/AX12.cpp	Sun Apr 10 21:20:44 2011 +0000
+++ b/AX12.cpp	Wed Oct 18 11:58:25 2017 +0000
@@ -1,34 +1,11 @@
-/* mbed AX-12+ Servo Library
- *
- * Copyright (c) 2010, cstyles (http://mbed.org)
- *
- * Permission is hereby granted, free of charge, to any person obtaining a copy
- * of this software and associated documentation files (the "Software"), to deal
- * in the Software without restriction, including without limitation the rights
- * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
- * copies of the Software, and to permit persons to whom the Software is
- * furnished to do so, subject to the following conditions:
- *
- * The above copyright notice and this permission notice shall be included in
- * all copies or substantial portions of the Software.
- *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
- * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
- * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
- * THE SOFTWARE.
- */
+#include "AX12.h"
+
 
-#include "AX12.h"
-#include "mbed.h"
-
-AX12::AX12(PinName tx, PinName rx, int ID, int baud)
+AX12::AX12(int tx, int rx, int ID, int baud)
         : _ax12(tx,rx) {
-    _baud = baud;
-    _ID = ID;
-    _ax12.baud(_baud);
+    _baud = baud;  
+   _ID = ID;
+    int _ax12.baud(_baud);
 
 }
 
@@ -351,9 +328,6 @@
         _ax12.putc(TxBuf[i]);
     }
 
-    // Wait for the bytes to be transmitted
-    wait (0.00002);
-
     // Skip if the read was to the broadcast address
     if (_ID != 0xFE) {
 
@@ -373,9 +347,6 @@
                 plen++;
                 timeout = 0;
             }
-
-            // wait for the bit period
-            wait (1.0/_baud);
             timeout++;
         }
 
@@ -488,8 +459,6 @@
         _ax12.putc(TxBuf[i]);
     }
 
-    // Wait for data to transmit
-    wait (0.00002);
 
     // make sure we have a valid return
     Status[4]=0x00;
@@ -511,9 +480,6 @@
                 plen++;
                 timeout = 0;
             }
-
-            // wait for the bit period
-            wait (1.0/_baud);
             timeout++;
         }