From a7b79f76933869efa45c9fec94059b3f2e700bff Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 5 Jul 2018 14:12:40 +1000 Subject: [PATCH] AP_HAL_VRBrain: attach_interrupt now takes a functor AP_HAL_VRBRAIN: add type-safety for interrupt types --- libraries/AP_HAL_VRBRAIN/GPIO.cpp | 4 +++- libraries/AP_HAL_VRBRAIN/GPIO.h | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/libraries/AP_HAL_VRBRAIN/GPIO.cpp b/libraries/AP_HAL_VRBRAIN/GPIO.cpp index cc785265e7..fa0ca9c91a 100644 --- a/libraries/AP_HAL_VRBRAIN/GPIO.cpp +++ b/libraries/AP_HAL_VRBRAIN/GPIO.cpp @@ -173,7 +173,9 @@ AP_HAL::DigitalSource* VRBRAINGPIO::channel(uint16_t n) { } /* Interrupt interface: */ -bool VRBRAINGPIO::attach_interrupt(uint8_t interrupt_num, AP_HAL::Proc p, uint8_t mode) +bool VRBRAINGPIO::attach_interrupt(uint8_t interrupt_num, + irq_handler_fn_t fn, + INTERRUPT_TRIGGER_TYPE mode) { return true; } diff --git a/libraries/AP_HAL_VRBRAIN/GPIO.h b/libraries/AP_HAL_VRBRAIN/GPIO.h index ca6cf5a583..b14abf89fc 100644 --- a/libraries/AP_HAL_VRBRAIN/GPIO.h +++ b/libraries/AP_HAL_VRBRAIN/GPIO.h @@ -31,7 +31,9 @@ public: AP_HAL::DigitalSource* channel(uint16_t n) override; /* Interrupt interface: */ - bool attach_interrupt(uint8_t interrupt_num, AP_HAL::Proc p, uint8_t mode) override; + bool attach_interrupt(uint8_t interrupt_num, + irq_handler_fn_t fn, + INTERRUPT_TRIGGER_TYPE mode) override; /* return true if USB cable is connected */ bool usb_connected(void) override;