PX4IO driver: Get rid of weak function

This commit is contained in:
Lorenz Meier
2015-09-13 23:31:20 +02:00
parent 334c001cda
commit bdf5180b18
4 changed files with 11 additions and 6 deletions
+5 -2
View File
@@ -99,8 +99,7 @@
#include "modules/dataman/dataman.h"
extern device::Device *PX4IO_i2c_interface() weak_function;
extern device::Device *PX4IO_serial_interface() weak_function;
#include "px4io_driver.h"
#define PX4IO_SET_DEBUG _IOC(0xff00, 0)
#define PX4IO_INAIR_RESTART_ENABLE _IOC(0xff00, 1)
@@ -2973,10 +2972,12 @@ get_interface()
#ifndef CONFIG_ARCH_BOARD_PX4FMU_V1
#ifdef PX4IO_SERIAL_BASE
/* try for a serial interface */
if (PX4IO_serial_interface != nullptr) {
interface = PX4IO_serial_interface();
}
#endif
if (interface != nullptr) {
goto got;
@@ -2984,10 +2985,12 @@ get_interface()
#endif
#ifdef PX4_I2C_OBDEV_PX4IO
/* try for an I2C interface if we haven't got a serial one */
if (PX4IO_i2c_interface != nullptr) {
interface = PX4IO_i2c_interface();
}
#endif
if (interface != nullptr) {
goto got;
+2
View File
@@ -39,6 +39,8 @@
#pragma once
#include <board_config.h>
#ifdef PX4_I2C_OBDEV_PX4IO
device::Device *PX4IO_i2c_interface();
#endif
+2 -2
View File
@@ -53,9 +53,9 @@
#include <drivers/device/i2c.h>
#ifdef PX4_I2C_OBDEV_PX4IO
#include "px4io_driver.h"
device::Device *PX4IO_i2c_interface();
#ifdef PX4_I2C_OBDEV_PX4IO
class PX4IO_I2C : public device::I2C
{
+2 -2
View File
@@ -68,9 +68,9 @@
#include <modules/px4iofirmware/protocol.h>
#ifdef PX4IO_SERIAL_BASE
#include "px4io_driver.h"
device::Device *PX4IO_serial_interface();
#ifdef PX4IO_SERIAL_BASE
/* serial register accessors */
#define REG(_x) (*(volatile uint32_t *)(PX4IO_SERIAL_BASE + _x))