DataFlash: Use GCS_Dummy GCS singleton

This commit is contained in:
Peter Barker 2017-07-03 08:56:13 +10:00 committed by Francisco Ferreira
parent 6a7ed2646c
commit c1264cf60a
2 changed files with 8 additions and 14 deletions

View File

@ -4,7 +4,7 @@
#include <AP_HAL/AP_HAL.h> #include <AP_HAL/AP_HAL.h>
#include <DataFlash/DataFlash.h> #include <DataFlash/DataFlash.h>
#include <GCS_MAVLink/GCS.h> #include <GCS_MAVLink/GCS_Dummy.h>
#include <stdio.h> #include <stdio.h>
const AP_HAL::HAL& hal = AP_HAL::get_HAL(); const AP_HAL::HAL& hal = AP_HAL::get_HAL();
@ -205,14 +205,11 @@ void DataFlashTest_AllTypes::loop(void)
hal.scheduler->delay(1000); hal.scheduler->delay(1000);
} }
class GCS_Dataflash_AllTypes : public GCS const struct AP_Param::GroupInfo GCS_MAVLINK::var_info[] = {
{ AP_GROUPEND
void send_statustext(MAV_SEVERITY severity, uint8_t dest_bitmask, const char *text) override {
::fprintf(stderr, "GCS: %s\n", text);
}
}; };
GCS_Dummy _gcs;
GCS_Dataflash_AllTypes _gcs;
static DataFlashTest_AllTypes dataflashtest; static DataFlashTest_AllTypes dataflashtest;

View File

@ -5,7 +5,7 @@
#include <AP_HAL/AP_HAL.h> #include <AP_HAL/AP_HAL.h>
#include <DataFlash/DataFlash.h> #include <DataFlash/DataFlash.h>
#include <GCS_MAVLink/GCS.h> #include <GCS_MAVLink/GCS_Dummy.h>
#include <stdio.h> #include <stdio.h>
const AP_HAL::HAL& hal = AP_HAL::get_HAL(); const AP_HAL::HAL& hal = AP_HAL::get_HAL();
@ -129,12 +129,9 @@ void loop()
dataflashtest.loop(); dataflashtest.loop();
} }
class GCS_Dataflash_test : public GCS const struct AP_Param::GroupInfo GCS_MAVLINK::var_info[] = {
{ AP_GROUPEND
void send_statustext(MAV_SEVERITY severity, uint8_t dest_bitmask, const char *text) override {
::fprintf(stderr, "GCS: %s\n", text);
}
}; };
GCS_Dataflash_test _gcs; GCS_Dummy _gcs;
AP_HAL_MAIN(); AP_HAL_MAIN();