diff --git a/ArduCopter/ArduCopter.pde b/ArduCopter/ArduCopter.pde index ed9dee46bb..4a6705ad3b 100644 --- a/ArduCopter/ArduCopter.pde +++ b/ArduCopter/ArduCopter.pde @@ -61,10 +61,9 @@ And much more so PLEASE PM me on DIYDRONES to add your contribution to the List #include // ArduPilot Mega Vector/Matrix math Library #include // ArduPilot Mega Inertial Sensor (accel & gyro) Library #include // ArduPilot Mega IMU Library -#include // Parent header of Timer and TimerAperiodic +#include // Parent header of Timer // (only included for makefile libpath to work) #include // TimerProcess is the scheduler for MPU6000 reads. -#include // TimerAperiodicProcess is the scheduler for ADC reads. #include // ArduPilot Mega DCM Library #include // PI library #include // RC Channel Library diff --git a/ArduPlane/ArduPlane.pde b/ArduPlane/ArduPlane.pde index f5fc8244e7..8d05cb4d30 100644 --- a/ArduPlane/ArduPlane.pde +++ b/ArduPlane/ArduPlane.pde @@ -34,7 +34,7 @@ version 2.1 of the License, or (at your option) any later version. #include // ArduPilot Mega Flash Memory Library #include // ArduPilot Mega Analog to Digital Converter Library #include // ArduPilot Mega polymorphic analog getter -#include // ArduPilot Mega TimerProcess and TimerAperiodicProcess +#include // ArduPilot Mega TimerProcess #include // ArduPilot barometer library #include // ArduPilot Mega Magnetometer Library #include // ArduPilot Mega Vector/Matrix math Library diff --git a/libraries/AP_ADC/examples/AP_ADC_test/AP_ADC_test.pde b/libraries/AP_ADC/examples/AP_ADC_test/AP_ADC_test.pde index 74872b5646..aeefc9056c 100644 --- a/libraries/AP_ADC/examples/AP_ADC_test/AP_ADC_test.pde +++ b/libraries/AP_ADC/examples/AP_ADC_test/AP_ADC_test.pde @@ -12,7 +12,7 @@ FastSerialPort0(Serial); // FTDI/console Arduino_Mega_ISR_Registry isr_registry; -AP_TimerAperiodicProcess adc_scheduler; +AP_PeriodicProcess adc_scheduler; unsigned long timer; diff --git a/libraries/AP_IMU/examples/AP_IMU_MPU6000/AP_IMU_MPU6000.pde b/libraries/AP_IMU/examples/AP_IMU_MPU6000/AP_IMU_MPU6000.pde index 2b56368f21..cca0b14792 100644 --- a/libraries/AP_IMU/examples/AP_IMU_MPU6000/AP_IMU_MPU6000.pde +++ b/libraries/AP_IMU/examples/AP_IMU_MPU6000/AP_IMU_MPU6000.pde @@ -7,10 +7,9 @@ #include #include #include // Experimental MPU6000 IMU library -#include // Parent header of Timer and TimerAperiodic +#include // Parent header of Timer // (only included for makefile libpath to work) #include // TimerProcess is the scheduler for MPU6000 reads. -#include // TimerAperiodicProcess is the scheduler for ADC reads. #include #include #include diff --git a/libraries/AP_IMU/examples/IMU_Oilpan_test/IMU_Oilpan_test.pde b/libraries/AP_IMU/examples/IMU_Oilpan_test/IMU_Oilpan_test.pde index 8c909b488f..d39c50749f 100644 --- a/libraries/AP_IMU/examples/IMU_Oilpan_test/IMU_Oilpan_test.pde +++ b/libraries/AP_IMU/examples/IMU_Oilpan_test/IMU_Oilpan_test.pde @@ -17,7 +17,7 @@ FastSerialPort(Serial, 0); Arduino_Mega_ISR_Registry isr_registry; -AP_TimerAperiodicProcess adc_scheduler; +AP_TimerPeriodicProcess adc_scheduler; AP_ADC_ADS7844 adc; AP_InertialSensor_Oilpan oilpan_ins(&adc); diff --git a/libraries/AP_PeriodicProcess/AP_PeriodicProcess.h b/libraries/AP_PeriodicProcess/AP_PeriodicProcess.h index 7b879bdcc4..093387610d 100644 --- a/libraries/AP_PeriodicProcess/AP_PeriodicProcess.h +++ b/libraries/AP_PeriodicProcess/AP_PeriodicProcess.h @@ -5,6 +5,5 @@ #include "PeriodicProcess.h" #include "AP_PeriodicProcessStub.h" #include "AP_TimerProcess.h" -#include "AP_TimerAperiodicProcess.h" #endif // __AP_PERIODIC_PROCESS_H__ diff --git a/libraries/AP_PeriodicProcess/AP_TimerAperiodicProcess.cpp b/libraries/AP_PeriodicProcess/AP_TimerAperiodicProcess.cpp deleted file mode 100644 index 95231248d2..0000000000 --- a/libraries/AP_PeriodicProcess/AP_TimerAperiodicProcess.cpp +++ /dev/null @@ -1,41 +0,0 @@ - -#include "AP_TimerAperiodicProcess.h" - -extern "C" { -#include -#include -#include "WConstants.h" -} -// TCNT2 values for various interrupt rates, -// assuming 256 prescaler. Note that these values -// assume a zero-time ISR. The actual rate will be a -// bit lower than this -#define TCNT2_781_HZ (256-80) -#define TCNT2_1008_HZ (256-62) -#define TCNT2_1302_HZ (256-48) - -uint8_t AP_TimerAperiodicProcess::_timer_offset; - -void AP_TimerAperiodicProcess::init( Arduino_Mega_ISR_Registry * isr_reg ) -{ - // Enable Timer2 Overflow interrupt to trigger process. - TIMSK2 = 0; // Disable interrupts - TCCR2A = 0; // normal counting mode - TCCR2B = _BV(CS21) | _BV(CS22); // Set prescaler of clk/256 - TCNT2 = 0; // Set count to zero, so it goes off right away. - TIFR2 = _BV(TOV2); // clear pending interrupts; - TIMSK2 = _BV(TOIE2); // enable the overflow interrupt - - isr_reg->register_signal(ISR_REGISTRY_TIMER2_OVF, AP_TimerAperiodicProcess::run); -} - -void AP_TimerAperiodicProcess::run(void) -{ - _timer_offset = (_timer_offset + 49) % 32; - _period = TCNT2_781_HZ + _timer_offset; - TCNT2 = _period; - for (int i = 0; i < _pidx; i++) { - if (_proc[i] != NULL) - _proc[i](); - } -} diff --git a/libraries/AP_PeriodicProcess/AP_TimerAperiodicProcess.h b/libraries/AP_PeriodicProcess/AP_TimerAperiodicProcess.h deleted file mode 100644 index 1242104fd1..0000000000 --- a/libraries/AP_PeriodicProcess/AP_TimerAperiodicProcess.h +++ /dev/null @@ -1,19 +0,0 @@ - -#ifndef __AP_TIMER_APERIODIC_PROCESS_H__ -#define __AP_TIMER_APERIODIC_PROCESS_H__ - -#include - -#include "../Arduino_Mega_ISR_Registry/Arduino_Mega_ISR_Registry.h" -#include "AP_TimerProcess.h" - -class AP_TimerAperiodicProcess : public AP_TimerProcess -{ - public: - void init( Arduino_Mega_ISR_Registry * isr_reg ); - static void run(void); - private: - static uint8_t _timer_offset; -}; - -#endif // __AP_TIMER_APERIODIC_PROCESS_H__ diff --git a/libraries/Desktop/support/sitl.cpp b/libraries/Desktop/support/sitl.cpp index f0c6232b22..a085662a2b 100644 --- a/libraries/Desktop/support/sitl.cpp +++ b/libraries/Desktop/support/sitl.cpp @@ -25,7 +25,6 @@ #include #include #include -#include #include "sitl_adc.h" #include "sitl_rc.h" #include "desktop.h"