From 973c3c6bc61b1e655e291394309ace54257440f5 Mon Sep 17 00:00:00 2001 From: Lucas De Marchi Date: Tue, 3 Nov 2015 11:46:29 -0200 Subject: [PATCH] AP_HAL_FLYMAPLE: remove checks for HAL_BOARD_APM2 and HAL_BOARD_APM1 --- libraries/AP_HAL_FLYMAPLE/AnalogSource.cpp | 1 - libraries/AP_HAL_FLYMAPLE/HAL_FLYMAPLE_Class.cpp | 2 -- .../AP_HAL_FLYMAPLE/examples/Console/Console.cpp | 5 ----- .../examples/Scheduler/Scheduler.cpp | 9 +++++---- .../examples/Semaphore/Semaphore.cpp | 15 ++++++++------- .../examples/UARTDriver/UARTDriver.cpp | 4 ---- 6 files changed, 13 insertions(+), 23 deletions(-) diff --git a/libraries/AP_HAL_FLYMAPLE/AnalogSource.cpp b/libraries/AP_HAL_FLYMAPLE/AnalogSource.cpp index 18bc29f1d8..025931566f 100644 --- a/libraries/AP_HAL_FLYMAPLE/AnalogSource.cpp +++ b/libraries/AP_HAL_FLYMAPLE/AnalogSource.cpp @@ -170,7 +170,6 @@ bool FLYMAPLEAnalogSource::reading_settled() void FLYMAPLEAnalogSource::new_sample(uint16_t sample) { _sum += sample; _latest = sample; - // Copied from AVR code in ArduPlane-2.74b, but AVR code is wrong! if (_sum_count >= 15) { // Flymaple has a 12 bit ADC, so can only sum 16 in a uint16_t _sum >>= 1; _sum_count = 8; diff --git a/libraries/AP_HAL_FLYMAPLE/HAL_FLYMAPLE_Class.cpp b/libraries/AP_HAL_FLYMAPLE/HAL_FLYMAPLE_Class.cpp index fd5141c5ec..7bd9e5a243 100644 --- a/libraries/AP_HAL_FLYMAPLE/HAL_FLYMAPLE_Class.cpp +++ b/libraries/AP_HAL_FLYMAPLE/HAL_FLYMAPLE_Class.cpp @@ -79,8 +79,6 @@ void HAL_FLYMAPLE::run(int argc, char* const argv[], Callbacks* callbacks) const * it is initialized at boot */ uartA->begin(115200); - /* The AVR RCInput drivers take an AP_HAL_AVR::ISRRegistry* - * as the init argument */ rcin->init(NULL); rcout->init(NULL); spi->init(NULL); diff --git a/libraries/AP_HAL_FLYMAPLE/examples/Console/Console.cpp b/libraries/AP_HAL_FLYMAPLE/examples/Console/Console.cpp index 6335d170b1..64866c9eff 100644 --- a/libraries/AP_HAL_FLYMAPLE/examples/Console/Console.cpp +++ b/libraries/AP_HAL_FLYMAPLE/examples/Console/Console.cpp @@ -1,10 +1,5 @@ // -*- Mode: C++; c-basic-offset: 8; indent-tabs-mode: nil -*- - -// -// Example code for the AP_HAL AVRUARTDriver, based on FastSerial -// // This code is placed into the public domain. -// #include #include diff --git a/libraries/AP_HAL_FLYMAPLE/examples/Scheduler/Scheduler.cpp b/libraries/AP_HAL_FLYMAPLE/examples/Scheduler/Scheduler.cpp index 728a986a47..ab06465068 100644 --- a/libraries/AP_HAL_FLYMAPLE/examples/Scheduler/Scheduler.cpp +++ b/libraries/AP_HAL_FLYMAPLE/examples/Scheduler/Scheduler.cpp @@ -8,11 +8,12 @@ const AP_HAL::HAL& hal = AP_HAL::get_HAL(); -/** +/* * You'll want to use a logic analyzer to watch the effects of this test. - * On the APM2 its pretty easy to hook up an analyzer to pins A0 through A3. + * Define each of the pins below to the pins used during the test on your + * board. */ -#define DELAY_TOGGLE_PIN 15 /* A0 = pin 15 */ +#define DELAY_TOGGLE_PIN 15 /* A0 = pin 15 */ #define FAILSAFE_TOGGLE_PIN 16 /* A1 = pin 16 */ #define SCHEDULED_TOGGLE_PIN_1 17 /* A2 = pin 17 */ #define SCHEDULED_TOGGLE_PIN_2 18 /* A3 = pin 18 */ @@ -61,7 +62,7 @@ void setup_pin(int pin_num) { void setup (void) { // hal.scheduler->delay(5000); - hal.console->printf("Starting AP_HAL_AVR::Scheduler test\r\n"); + hal.console->printf("Starting AP_HAL::Scheduler test\r\n"); setup_pin(DELAY_TOGGLE_PIN); setup_pin(FAILSAFE_TOGGLE_PIN); diff --git a/libraries/AP_HAL_FLYMAPLE/examples/Semaphore/Semaphore.cpp b/libraries/AP_HAL_FLYMAPLE/examples/Semaphore/Semaphore.cpp index 20754ea858..e224b01b89 100644 --- a/libraries/AP_HAL_FLYMAPLE/examples/Semaphore/Semaphore.cpp +++ b/libraries/AP_HAL_FLYMAPLE/examples/Semaphore/Semaphore.cpp @@ -7,17 +7,18 @@ const AP_HAL::HAL& hal = AP_HAL::get_HAL(); -/** +/* * You'll want to use a logic analyzer to watch the effects of this test. - * On the APM2 its pretty easy to hook up an analyzer to pins A0 through A3. + * Define each of the pins below to the pins used during the test on your + * board. */ -#define PIN_A0 15 /* A0 */ -#define PIN_A1 16 /* A1 */ -#define PIN_A2 17 /* A2 */ -#define PIN_A3 18 /* A3 */ +#define PIN_A0 15 +#define PIN_A1 16 +#define PIN_A2 17 +#define PIN_A3 18 /** - * Create an AVRSemaphore for this test. + * Create a Semaphore for this test. */ AP_HAL::Semaphore *sem; diff --git a/libraries/AP_HAL_FLYMAPLE/examples/UARTDriver/UARTDriver.cpp b/libraries/AP_HAL_FLYMAPLE/examples/UARTDriver/UARTDriver.cpp index dd60151d8e..94be4737ab 100644 --- a/libraries/AP_HAL_FLYMAPLE/examples/UARTDriver/UARTDriver.cpp +++ b/libraries/AP_HAL_FLYMAPLE/examples/UARTDriver/UARTDriver.cpp @@ -1,10 +1,6 @@ // -*- Mode: C++; c-basic-offset: 8; indent-tabs-mode: nil -*- -// -// Example code for the AP_HAL AVRUARTDriver, based on FastSerial -// // This code is placed into the public domain. -// #include #include