AP_HAL_SITL: attach_interrupt now takes a functor

AP_HAL_SITL: add type-safety for interrupt types
This commit is contained in:
Peter Barker 2018-07-05 14:13:57 +10:00 committed by Randy Mackay
parent a7b79f7693
commit 5180e025bb
2 changed files with 7 additions and 4 deletions

View File

@ -53,8 +53,10 @@ 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;
}

View File

@ -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);