ardupilot/libraries/AP_HAL_AVR/utility/ISRRegistry.h
Pat Hickey 2c14a77693 AP_HAL_AVR: add ISRRegistry class, member of HAL_AVR
* derived from Arduino_Mega_ISR_Registry class
2012-12-20 14:51:20 +11:00

25 lines
548 B
C++

#ifndef __AP_HAL_AVR_ISR_REGISTRY_H__
#define __AP_HAL_AVR_ISR_REGISTRY_H__
#include "AP_HAL_AVR_Namespace.h"
#define ISR_REGISTRY_TIMER2_OVF 0
#define ISR_REGISTRY_TIMER4_CAPT 1
#define ISR_REGISTRY_TIMER5_CAPT 2
#define ISR_REGISTRY_NUM_SLOTS 3
typedef void (*proc_ptr)(void);
class AP_HAL_AVR::ISRRegistry {
public:
void init();
int register_signal(int isr_number, proc_ptr proc);
int unregister_signal(int isr_number);
static proc_ptr _registry[ISR_REGISTRY_NUM_SLOTS];
};
#endif // __AP_HAL_AVR_ISR_REGISTRY_H__