diff --git a/ground/openpilotgcs/src/plugins/rawhid/pjrc_rawhid_mac.cpp b/ground/openpilotgcs/src/plugins/rawhid/pjrc_rawhid_mac.cpp index 72d50ede2..549ec3f24 100644 --- a/ground/openpilotgcs/src/plugins/rawhid/pjrc_rawhid_mac.cpp +++ b/ground/openpilotgcs/src/plugins/rawhid/pjrc_rawhid_mac.cpp @@ -69,18 +69,18 @@ static hid_t *last_hid = NULL; // Make sure we use the correct runloop CFRunLoopRef the_correct_runloop = NULL; struct hid_struct { - IOHIDDeviceRef ref; - int open; - uint8_t buffer[BUFFER_SIZE]; - buffer_t *first_buffer; - buffer_t *last_buffer; - struct hid_struct *prev; - struct hid_struct *next; + IOHIDDeviceRef ref; + int open; + uint8_t buffer[BUFFER_SIZE]; + buffer_t *first_buffer; + buffer_t *last_buffer; + struct hid_struct *prev; + struct hid_struct *next; }; struct buffer_struct { - struct buffer_struct *next; - uint32_t len; - uint8_t buf[BUFFER_SIZE]; + struct buffer_struct *next; + uint32_t len; + uint8_t buf[BUFFER_SIZE]; }; static void add_hid(hid_t *); diff --git a/ground/openpilotgcs/src/plugins/rawhid/rawhid.cpp b/ground/openpilotgcs/src/plugins/rawhid/rawhid.cpp index eadf55a0c..37400dfb1 100644 --- a/ground/openpilotgcs/src/plugins/rawhid/rawhid.cpp +++ b/ground/openpilotgcs/src/plugins/rawhid/rawhid.cpp @@ -383,29 +383,29 @@ bool RawHID::open(OpenMode mode) void RawHID::close() { - emit aboutToClose(); + emit aboutToClose(); - m_mutex->lock(); + m_mutex->lock(); - if (m_readThread) - { - m_readThread->terminate(); - delete m_readThread; // calls wait - m_readThread = NULL; - } + if (m_readThread) + { + m_readThread->terminate(); + delete m_readThread; // calls wait + m_readThread = NULL; + } - if (m_writeThread) - { - m_writeThread->terminate(); - delete m_writeThread; - m_writeThread = NULL; - } + if (m_writeThread) + { + m_writeThread->terminate(); + delete m_writeThread; + m_writeThread = NULL; + } - dev.close(m_deviceNo); + dev.close(m_deviceNo); - m_mutex->unlock(); + m_mutex->unlock(); - emit closed(); + emit closed(); QIODevice::close(); }