diff --git a/CopterController/DSM2.cpp b/CopterController/DSM2.cpp index 4899ea7..1f0231c 100644 --- a/CopterController/DSM2.cpp +++ b/CopterController/DSM2.cpp @@ -5,14 +5,21 @@ #define VALUE_MASK 0x3FF -DSM2::DSM2( int mode ) +DSM2::DSM2() { std::cout << "opening serial port..." << std::flush; fd = serialOpen( "/dev/ttyAMA0", 115200 ); - std::cout << "SUCCESS " << fd << std::endl; + if( fd < 0 ) + { + std::cout << "FAILURE" << std::endl; + } + else + { + std::cout << "SUCCESS " << fd << std::endl; + } std::cout << "flushing serial..." << std::flush; serialFlush(fd); - std::cout << "SUCCESS" << std::endl; + std::cout << "DONE" << std::endl; } void DSM2::update() diff --git a/CopterController/DSM2.h b/CopterController/DSM2.h index ef91bbf..123c964 100644 --- a/CopterController/DSM2.h +++ b/CopterController/DSM2.h @@ -4,7 +4,7 @@ class DSM2 { public: - DSM2( int mode = 1024 ); + DSM2(); void update(); int values[7];