AP_HAL_AVR ISRRegistry: use AP_HAL::Proc types instead of private typedef

This commit is contained in:
Pat Hickey 2012-09-07 11:42:51 -07:00 committed by Andrew Tridgell
parent af68c09591
commit a1863ec1f5
2 changed files with 5 additions and 6 deletions

View File

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

View File

@ -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__