ardupilot/libraries/AP_PeriodicProcess/AP_TimerProcess.h
Pat Hickey d288b8870d purple: added PeriodicProcess library
this library provides a clean API for drivers to request periodic
timer driven calls at whatever rate they need
2011-11-25 20:00:16 -08:00

24 lines
638 B
C++

#ifndef __AP_TIMERPROCESS_H__
#define __AP_TIMERPROCESS_H__
#include "PeriodicProcess.h"
#include "../Arduino_Mega_ISR_Registry/Arduino_Mega_ISR_Registry.h"
/* XXX this value is a total guess, will look up. */
#define TIMERPROCESS_PER_DEFAULT (256)
class AP_TimerProcess : public AP_PeriodicProcess
{
public:
AP_TimerProcess(int period = TIMERPROCESS_PER_DEFAULT);
void init( Arduino_Mega_ISR_Registry * isr_reg );
void register_process(void (* proc)(void));
static void run(void);
protected:
static int _period;
static void (*_proc)(void);
};
#endif // __AP_TIMERPROCESS_H__