From 388cbf5cbdd09228276e0b5d7b9b0a0fe24c4d3e Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 1 Aug 2018 19:18:25 +1000 Subject: [PATCH] HAL_VRBrain: match plane 3.9.0 --- libraries/AP_HAL_VRBRAIN/GPIO.cpp | 6 ------ libraries/AP_HAL_VRBRAIN/GPIO.h | 1 - libraries/AP_HAL_VRBRAIN/Scheduler.cpp | 6 +----- libraries/AP_HAL_VRBRAIN/Util.cpp | 3 ++- 4 files changed, 3 insertions(+), 13 deletions(-) diff --git a/libraries/AP_HAL_VRBRAIN/GPIO.cpp b/libraries/AP_HAL_VRBRAIN/GPIO.cpp index 36415e5025..cc785265e7 100644 --- a/libraries/AP_HAL_VRBRAIN/GPIO.cpp +++ b/libraries/AP_HAL_VRBRAIN/GPIO.cpp @@ -84,12 +84,6 @@ void VRBRAINGPIO::pinMode(uint8_t pin, uint8_t output) } } -int8_t VRBRAINGPIO::analogPinToDigitalPin(uint8_t pin) -{ - return -1; -} - - uint8_t VRBRAINGPIO::read(uint8_t pin) { switch (pin) { diff --git a/libraries/AP_HAL_VRBRAIN/GPIO.h b/libraries/AP_HAL_VRBRAIN/GPIO.h index 0a9ac5b2cb..ca6cf5a583 100644 --- a/libraries/AP_HAL_VRBRAIN/GPIO.h +++ b/libraries/AP_HAL_VRBRAIN/GPIO.h @@ -23,7 +23,6 @@ public: VRBRAINGPIO(); void init() override; void pinMode(uint8_t pin, uint8_t output) override; - int8_t analogPinToDigitalPin(uint8_t pin) override; uint8_t read(uint8_t pin) override; void write(uint8_t pin, uint8_t value) override; void toggle(uint8_t pin) override; diff --git a/libraries/AP_HAL_VRBRAIN/Scheduler.cpp b/libraries/AP_HAL_VRBRAIN/Scheduler.cpp index 78f2ba9179..61b05eb5f8 100644 --- a/libraries/AP_HAL_VRBRAIN/Scheduler.cpp +++ b/libraries/AP_HAL_VRBRAIN/Scheduler.cpp @@ -173,17 +173,13 @@ void VRBRAINScheduler::delay_microseconds_boost(uint16_t usec) void VRBRAINScheduler::delay(uint16_t ms) { - if (!in_main_thread()) { - ::printf("ERROR: delay() from timer process\n"); - return; - } perf_begin(_perf_delay); uint64_t start = AP_HAL::micros64(); while ((AP_HAL::micros64() - start)/1000 < ms && !_vrbrain_thread_should_exit) { delay_microseconds_semaphore(1000); - if (_min_delay_cb_ms <= ms) { + if (in_main_thread() && _min_delay_cb_ms <= ms) { call_delay_cb(); } } diff --git a/libraries/AP_HAL_VRBRAIN/Util.cpp b/libraries/AP_HAL_VRBRAIN/Util.cpp index 0e65d760bc..7e399564c7 100644 --- a/libraries/AP_HAL_VRBRAIN/Util.cpp +++ b/libraries/AP_HAL_VRBRAIN/Util.cpp @@ -127,7 +127,8 @@ bool VRBRAINUtil::get_system_id(char buf[40]) board_type, (unsigned)serialid[0], (unsigned)serialid[1], (unsigned)serialid[2], (unsigned)serialid[3], (unsigned)serialid[4], (unsigned)serialid[5], (unsigned)serialid[6], (unsigned)serialid[7], - (unsigned)serialid[8], (unsigned)serialid[9], (unsigned)serialid[10],(unsigned)serialid[11]); + (unsigned)serialid[8], (unsigned)serialid[9], (unsigned)serialid[10],(unsigned)serialid[11]); + buf[39] = 0; return true; }