Manchester

Revision:
3:03109c995123
Parent:
2:de778df5892c
Child:
4:f2c392191c74
--- a/Manchester.cpp	Wed May 17 21:02:49 2017 +0000
+++ b/Manchester.cpp	Thu May 18 10:20:55 2017 +0000
@@ -34,11 +34,17 @@
  * @param   txPin Pin name of transmitter line
  *          rxPin Pin name of receiver line
  *          speed Communication bit rate in bits per second
- *          tol Pulse width tolerance in %
+ *          tol   Pulse width tolerance in %
  * @retval
  */
-Manchester::Manchester(PinName txPin, PinName rxPin, uint32_t speed /* = 1200 bps */, uint8_t tol /* = 20% */ ) :
-    _tx(txPin),
+Manchester::Manchester
+    (
+        PinName txPin, 
+        PinName rxPin, 
+        uint32_t speed  /* = 1200 bps */, 
+        uint8_t tol /* = 20% */ 
+    ) : 
+    _tx(txPin), 
     _rx(rxPin) {
     _state = IDLE;
     _midBitTime = 1000000 / speed / 2;  // mid-bit time [us]
@@ -75,7 +81,7 @@
 
 /**
  * @brief   ISR handling transmission
- * @note    Called by the rxTicker
+ * @note    Called by _txTicker
  * @param
  * @retval
  */
@@ -216,7 +222,7 @@
         if(_rx == 0)
             _state = SYNCH_START;
         else
-            _state = ERROR;
+            _state = ERROR;  // It isn't a synch pulse => error
         break;
 
     case SYNCH_START:
@@ -263,7 +269,7 @@
 
 /**
  * @brief   ISR handling 'receive timeout'
- * @note    Called when receiver line rxPin is idle longer than limit.
+ * @note    Called when receiver line is idle longer than limit.
  *          Signals 'end of transmission' by setting state to IDLE
  *          or 'timeout error' by setting state to ERROR.
  * @param   None