mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-29 03:36:07 +08:00
PX4IO driver: Get rid of weak function
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -39,6 +39,8 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <board_config.h>
|
||||
|
||||
#ifdef PX4_I2C_OBDEV_PX4IO
|
||||
device::Device *PX4IO_i2c_interface();
|
||||
#endif
|
||||
|
||||
@@ -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
|
||||
{
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user