mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-22 08:38:36 -04:00
AP_HAL_AVR ISRRegistry: use AP_HAL::Proc types instead of private typedef
This commit is contained in:
parent
af68c09591
commit
a1863ec1f5
@ -6,9 +6,9 @@
|
||||
|
||||
using namespace AP_HAL_AVR;
|
||||
|
||||
proc_ptr ISRRegistry::_registry[ISR_REGISTRY_NUM_SLOTS] = {NULL};
|
||||
AP_HAL::Proc ISRRegistry::_registry[ISR_REGISTRY_NUM_SLOTS] = {NULL};
|
||||
|
||||
int ISRRegistry::register_signal(int signal, proc_ptr proc)
|
||||
int ISRRegistry::register_signal(int signal, AP_HAL::Proc proc)
|
||||
{
|
||||
if (signal >= 0 && signal < ISR_REGISTRY_NUM_SLOTS) {
|
||||
_registry[signal] = proc;
|
||||
|
@ -3,6 +3,7 @@
|
||||
#ifndef __AP_HAL_AVR_ISR_REGISTRY_H__
|
||||
#define __AP_HAL_AVR_ISR_REGISTRY_H__
|
||||
|
||||
#include <AP_HAL.h>
|
||||
#include "AP_HAL_AVR_Namespace.h"
|
||||
|
||||
#define ISR_REGISTRY_TIMER2_OVF 0
|
||||
@ -10,14 +11,12 @@
|
||||
#define ISR_REGISTRY_TIMER5_CAPT 2
|
||||
#define ISR_REGISTRY_NUM_SLOTS 3
|
||||
|
||||
typedef void (*proc_ptr)(void);
|
||||
|
||||
class AP_HAL_AVR::ISRRegistry {
|
||||
public:
|
||||
int register_signal(int isr_number, proc_ptr proc);
|
||||
int register_signal(int isr_number, AP_HAL::Proc proc);
|
||||
int unregister_signal(int isr_number);
|
||||
|
||||
static proc_ptr _registry[ISR_REGISTRY_NUM_SLOTS];
|
||||
static AP_HAL::Proc _registry[ISR_REGISTRY_NUM_SLOTS];
|
||||
};
|
||||
|
||||
#endif // __AP_HAL_AVR_ISR_REGISTRY_H__
|
||||
|
Loading…
Reference in New Issue
Block a user