fixed warings caused by unhandled cases in SoftSerial
authorbouni <bouni@owee.de>
Wed, 13 Jul 2016 10:01:31 +0000 (12:01 +0200)
committerbouni <bouni@owee.de>
Wed, 13 Jul 2016 10:01:31 +0000 (12:01 +0200)
src/modules/tools/spindle/SoftSerial/SoftSerial_rx.cpp
src/modules/tools/spindle/SoftSerial/SoftSerial_tx.cpp

index 3e0bf48..23681b8 100644 (file)
@@ -66,6 +66,9 @@ void SoftSerial::rx_handler(void) {
                 if ((!parity_count) && (_parity == Odd))\r
                     rx_error = true;\r
                 return;\r
+            case None:\r
+                // No parity, nothing to do here\r
+                break;\r
         }\r
     }\r
     \r
index 204cd8f..fa766c9 100644 (file)
@@ -60,6 +60,8 @@ void SoftSerial::prepare_tx(int c)
     switch (_parity) {\r
         case Forced1:\r
             _char |= 1 << (_bits + 1);\r
+        case Forced0:\r
+            _char &= ~(1 << (_bits + 1));\r
         case Even:\r
             parity = false;\r
             for (int i = 0; i<_bits; i++) {\r
@@ -74,6 +76,9 @@ void SoftSerial::prepare_tx(int c)
                     parity = !parity;\r
             }\r
             _char |= parity << (_bits + 1);\r
+        case None:\r
+            // No parity, nothing to do here\r
+            break;\r
     }\r
     \r
     _char |= 0xFFFF << (1 + _bits + (bool)_parity);\r