AP_HAL_Empty: add support for OpticalFlow

Void driver
This commit is contained in:
Julien BERAUD 2015-11-23 19:58:14 +01:00 committed by Andrew Tridgell
parent c7668479bb
commit d14f4104ea
4 changed files with 30 additions and 2 deletions

View File

@ -6,6 +6,7 @@ namespace Empty {
class DigitalSource;
class GPIO;
class I2CDriver;
class OpticalFlow;
class PrivateMember;
class RCInput;
class RCOutput;

View File

@ -17,6 +17,7 @@
#include "Semaphores.h"
#include "Scheduler.h"
#include "Util.h"
#include "OpticalFlow.h"
#include "PrivateMember.h"
#endif // __AP_HAL_EMPTY_PRIVATE_H__

View File

@ -22,6 +22,7 @@ static RCInput rcinDriver;
static RCOutput rcoutDriver;
static Scheduler schedulerInstance;
static Util utilInstance;
static OpticalFlow opticalFlowDriver;
HAL_Empty::HAL_Empty() :
AP_HAL::HAL(
@ -41,8 +42,9 @@ HAL_Empty::HAL_Empty() :
&rcinDriver,
&rcoutDriver,
&schedulerInstance,
&utilInstance),
_member(new PrivateMember(123))
&utilInstance,
&opticalFlowDriver),
_member(new EmptyPrivateMember(123))
{}
void HAL_Empty::run(int argc, char* const argv[], Callbacks* callbacks) const

View File

@ -0,0 +1,24 @@
/*
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef __AP_HAL_EMPTY_OPTICALFLOW_H__
#define __AP_HAL_EMPTY_OPTICALFLOW_H__
class Empty::OpticalFlow : public AP_HAL::OpticalFlow {
public:
void init(AP_HAL::OpticalFlow::Gyro_Cb) {return;};
bool read(Data_Frame& frame) {return false;};
};
#endif