mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-11 10:28:29 -04:00
TimerProcess: make some variables uint8_t
save a couple of bytes
This commit is contained in:
parent
590d812bc3
commit
0a08a0b515
@ -1,6 +1,6 @@
|
||||
|
||||
#include "AP_PeriodicProcessStub.h"
|
||||
AP_PeriodicProcessStub::AP_PeriodicProcessStub(int period) {}
|
||||
AP_PeriodicProcessStub::AP_PeriodicProcessStub(uint8_t period) {}
|
||||
void AP_PeriodicProcessStub::init( Arduino_Mega_ISR_Registry * isr_reg ){}
|
||||
void AP_PeriodicProcessStub::register_process(ap_procedure proc) {}
|
||||
void AP_PeriodicProcessStub::set_failsafe(ap_procedure proc) {}
|
||||
|
@ -9,13 +9,13 @@
|
||||
class AP_PeriodicProcessStub : public AP_PeriodicProcess
|
||||
{
|
||||
public:
|
||||
AP_PeriodicProcessStub(int period = 0);
|
||||
AP_PeriodicProcessStub(uint8_t period = 0);
|
||||
void init( Arduino_Mega_ISR_Registry * isr_reg );
|
||||
void register_process(ap_procedure proc);
|
||||
void set_failsafe(ap_procedure proc);
|
||||
static void run(void);
|
||||
protected:
|
||||
static int _period;
|
||||
static uint8_t _period;
|
||||
static void (*_proc)(void);
|
||||
static void (*_failsafe)(void);
|
||||
};
|
||||
|
@ -1,3 +1,4 @@
|
||||
/// -*- tab-width: 4; Mode: C++; c-basic-offset: 4; indent-tabs-mode: nil -*-
|
||||
|
||||
#include "AP_TimerProcess.h"
|
||||
|
||||
@ -8,13 +9,13 @@ extern "C" {
|
||||
#include <avr/interrupt.h>
|
||||
}
|
||||
|
||||
int AP_TimerProcess::_period;
|
||||
uint8_t AP_TimerProcess::_period;
|
||||
ap_procedure AP_TimerProcess::_proc[AP_TIMERPROCESS_MAX_PROCS];
|
||||
ap_procedure AP_TimerProcess::_failsafe;
|
||||
bool AP_TimerProcess::_in_timer_call;
|
||||
int AP_TimerProcess::_pidx = 0;
|
||||
uint8_t AP_TimerProcess::_pidx = 0;
|
||||
|
||||
AP_TimerProcess::AP_TimerProcess(int period)
|
||||
AP_TimerProcess::AP_TimerProcess(uint8_t period)
|
||||
{
|
||||
_period = period;
|
||||
}
|
||||
|
@ -13,16 +13,16 @@
|
||||
class AP_TimerProcess : public AP_PeriodicProcess
|
||||
{
|
||||
public:
|
||||
AP_TimerProcess(int period = TIMERPROCESS_PER_DEFAULT);
|
||||
AP_TimerProcess(uint8_t period = TIMERPROCESS_PER_DEFAULT);
|
||||
void init( Arduino_Mega_ISR_Registry * isr_reg );
|
||||
void register_process(ap_procedure proc);
|
||||
void set_failsafe(ap_procedure proc);
|
||||
static void run(void);
|
||||
protected:
|
||||
static int _period;
|
||||
static uint8_t _period;
|
||||
static ap_procedure _proc[AP_TIMERPROCESS_MAX_PROCS];
|
||||
static ap_procedure _failsafe;
|
||||
static int _pidx;
|
||||
static uint8_t _pidx;
|
||||
static bool _in_timer_call;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user