my sbus

Dependents:   Drone_air

Fork of FutabaSBUS by Uwe Gartmann

Revision:
3:50e10bf74374
Parent:
2:07dbb77a6f1a
diff -r 07dbb77a6f1a -r 50e10bf74374 FutabaSBUS.cpp
--- a/FutabaSBUS.cpp	Mon Feb 08 08:47:36 2016 +0000
+++ b/FutabaSBUS.cpp	Thu May 19 08:56:30 2016 +0000
@@ -37,6 +37,11 @@
 
 
 FutabaSBUS::FutabaSBUS(PinName tx, PinName rx) : sbus_(tx, rx) {
+    rx_timeout=50;
+    tx_timeout=60;
+}
+
+void FutabaSBUS::start() {
     // Set Baudrate
     sbus_.baud(100000);
     // Set Datalenght & Frame
@@ -46,8 +51,6 @@
     sbus_.attach(this, &FutabaSBUS::SBUS_irq_rx, RawSerial::RxIrq);
     // init ticker 500us
     rxSBUS.attach_us(this, &FutabaSBUS::rx_ticker_500us,500);
-    rx_timeout=50;
-    tx_timeout=60;
 }
 
 int16_t FutabaSBUS::channel(uint8_t ch) {
@@ -88,7 +91,6 @@
 
 void FutabaSBUS::failsafe(uint8_t status) {
     failsafe_status = status;
-    sbus_.baud(100000);
 }
 
 void FutabaSBUS::passthrough(bool mode) {