From 9b9ec4db407333fc770408afb8789d23e859d5ea Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Thu, 5 Jul 2018 14:17:12 +1000 Subject: [PATCH] AP_HAL_Empty: attach_interrupt now takes a functor AP_HAL_Empty: add type-safety for interrupt types --- libraries/AP_HAL_Empty/GPIO.cpp | 5 +++-- libraries/AP_HAL_Empty/GPIO.h | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/libraries/AP_HAL_Empty/GPIO.cpp b/libraries/AP_HAL_Empty/GPIO.cpp index d8053ac094..e9b4a07766 100644 --- a/libraries/AP_HAL_Empty/GPIO.cpp +++ b/libraries/AP_HAL_Empty/GPIO.cpp @@ -28,8 +28,9 @@ AP_HAL::DigitalSource* GPIO::channel(uint16_t n) { } /* Interrupt interface: */ -bool GPIO::attach_interrupt(uint8_t interrupt_num, AP_HAL::Proc p, - uint8_t mode) { +bool GPIO::attach_interrupt(uint8_t interrupt_num, + irq_handler_fn_t fn, + INTERRUPT_TRIGGER_TYPE mode) { return true; } diff --git a/libraries/AP_HAL_Empty/GPIO.h b/libraries/AP_HAL_Empty/GPIO.h index dc01d34761..05a4798bae 100644 --- a/libraries/AP_HAL_Empty/GPIO.h +++ b/libraries/AP_HAL_Empty/GPIO.h @@ -15,8 +15,9 @@ public: AP_HAL::DigitalSource* channel(uint16_t n); /* Interrupt interface: */ - bool attach_interrupt(uint8_t interrupt_num, AP_HAL::Proc p, - uint8_t mode); + 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);