mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-06-27 05:40:36 +08:00
wip: squashed patch
This commit is contained in:
@@ -82,6 +82,10 @@
|
||||
#define BOARD_NUM_SPI_CFG_HW_VERSIONS 1
|
||||
#endif
|
||||
|
||||
#ifndef BOARD_MTD_NUM_EEPROM
|
||||
#define BOARD_MTD_NUM_EEPROM 1
|
||||
#endif
|
||||
|
||||
/* ADC defining tools
|
||||
* We want to normalize the V5 Sensing to V = (adc_dn) * ADC_V5_V_FULL_SCALE/(2 ^ ADC_BITS) * ADC_V5_SCALE)
|
||||
*/
|
||||
@@ -258,9 +262,12 @@
|
||||
|
||||
#if defined(BOARD_HAS_HW_VERSIONING)
|
||||
# define BOARD_HAS_VERSIONING 1
|
||||
# define HW_VER_REV(v,r) ((uint32_t)((v) & 0xff) << 8) | ((uint32_t)(r) & 0xff)
|
||||
# define HW_VER_REV(v,r) ((uint32_t)((v) & 0xffff) << 16) | ((uint32_t)(r) & 0xffff)
|
||||
#endif
|
||||
|
||||
#define HW_INFO_REV_DIGITS 3
|
||||
#define HW_INFO_VER_DIGITS 3
|
||||
|
||||
/* Default LED logical to color mapping */
|
||||
|
||||
#if defined(BOARD_OVERLOAD_LED)
|
||||
@@ -950,7 +957,7 @@ int board_get_mfguid_formated(char *format_buffer, int size); // DEPRICATED use
|
||||
int board_get_px4_guid(px4_guid_t guid);
|
||||
|
||||
/************************************************************************************
|
||||
* Name: board_get_mfguid_formated
|
||||
* Name: board_get_px4_guid_formated
|
||||
*
|
||||
* Description:
|
||||
* All boards either provide a way to retrieve a formatted string of the
|
||||
|
||||
@@ -70,6 +70,9 @@ static inline constexpr bool PX4_ISFINITE(double x) { return __builtin_isfinite(
|
||||
#define PX4_O_MODE_666 0666
|
||||
#define PX4_O_MODE_600 0600
|
||||
|
||||
#define DIRENT_REGULAR_FILE DTYPE_FILE
|
||||
#define DIRENT_DIRECTORY DTYPE_DIRECTORY
|
||||
|
||||
#elif defined(__PX4_POSIX)
|
||||
/****************************************************************************
|
||||
* POSIX Specific defines
|
||||
@@ -91,6 +94,9 @@ static inline constexpr bool PX4_ISFINITE(double x) { return __builtin_isfinite(
|
||||
#define USEC_PER_TICK (1000000/PX4_TICKS_PER_SEC)
|
||||
#define USEC2TICK(x) (((x)+(USEC_PER_TICK/2))/USEC_PER_TICK)
|
||||
|
||||
#define DIRENT_REGULAR_FILE DT_REG
|
||||
#define DIRENT_DIRECTORY DT_DIR
|
||||
|
||||
__BEGIN_DECLS
|
||||
extern long PX4_TICKS_PER_SEC;
|
||||
__END_DECLS
|
||||
|
||||
@@ -37,12 +37,13 @@ typedef enum {
|
||||
MTD_PARAMETERS = 1,
|
||||
MTD_WAYPOINTS = 2,
|
||||
MTD_CALDATA = 3,
|
||||
MTD_MFT = 4,
|
||||
MTD_ID = 5,
|
||||
MTD_NET = 6,
|
||||
MTD_MFT_VER = 4,
|
||||
MTD_MFT_REV = 5,
|
||||
MTD_ID = 6,
|
||||
MTD_NET = 7
|
||||
} px4_mtd_types_t;
|
||||
#define PX4_MFT_MTD_TYPES {MTD_PARAMETERS, MTD_WAYPOINTS, MTD_CALDATA, MTD_MFT, MTD_ID, MTD_NET}
|
||||
#define PX4_MFT_MTD_STR_TYPES {"MTD_PARAMETERS", "MTD_WAYPOINTS", "MTD_CALDATA", "MTD_MFT", "MTD_ID", "MTD_NET"}
|
||||
#define PX4_MFT_MTD_TYPES {MTD_PARAMETERS, MTD_WAYPOINTS, MTD_CALDATA, MTD_MFT_VER, MTD_MFT_REV, MTD_ID, MTD_NET}
|
||||
#define PX4_MFT_MTD_STR_TYPES {"MTD_PARAMETERS", "MTD_WAYPOINTS", "MTD_CALDATA", "MTD_MFT_VER", "MTD_MFT_REV", "MTD_ID", "MTD_NET"}
|
||||
|
||||
typedef struct {
|
||||
const px4_mtd_types_t type;
|
||||
@@ -100,6 +101,6 @@ __EXPORT int px4_mtd_config(const px4_mtd_manifest_t *mft_mtd);
|
||||
* 0 (get !=null) item by type's value is returned at get;
|
||||
*
|
||||
************************************************************************************/
|
||||
__EXPORT int px4_mtd_query(const char *type, const char *val, const char **get = nullptr);
|
||||
__EXPORT int px4_mtd_query(const char *type, const char *val, const char **get);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
@@ -65,7 +65,7 @@ typedef struct {
|
||||
|
||||
typedef struct {
|
||||
const uint32_t nmft;
|
||||
const px4_mft_entry_s *mfts;
|
||||
const px4_mft_entry_s *mfts[];
|
||||
} px4_mft_s;
|
||||
|
||||
#include "px4_platform_common/mtd_manifest.h"
|
||||
@@ -88,6 +88,19 @@ __BEGIN_DECLS
|
||||
|
||||
__EXPORT const px4_mft_s *board_get_manifest(void);
|
||||
|
||||
/************************************************************************************
|
||||
* Name: board_get_base_eeprom_mtd_manifest
|
||||
*
|
||||
* Description:
|
||||
* A board will provide this function to return the mtd with eeprom manifest
|
||||
*
|
||||
* Returned Value:
|
||||
* pointer to mtd manifest
|
||||
*
|
||||
************************************************************************************/
|
||||
|
||||
__EXPORT const px4_mtd_manifest_t *board_get_base_eeprom_mtd_manifest(void);
|
||||
|
||||
/************************************************************************************
|
||||
* Name: px4_mft_configure
|
||||
*
|
||||
|
||||
@@ -35,6 +35,8 @@
|
||||
|
||||
__BEGIN_DECLS
|
||||
|
||||
#define MAX_MTD_INSTANCES 5u
|
||||
|
||||
// The data needed to interface with mtd device's
|
||||
|
||||
typedef struct {
|
||||
@@ -60,7 +62,7 @@ typedef struct {
|
||||
* This can be Null if there are no mtd instances.
|
||||
*
|
||||
*/
|
||||
__EXPORT mtd_instance_s *px4_mtd_get_instances(unsigned int *count);
|
||||
__EXPORT mtd_instance_s **px4_mtd_get_instances(unsigned int *count);
|
||||
|
||||
/*
|
||||
Get device complete geometry or a device
|
||||
@@ -75,7 +77,9 @@ __EXPORT int px4_mtd_get_geometry(const mtd_instance_s *instance, unsigned long
|
||||
*/
|
||||
__EXPORT ssize_t px4_mtd_get_partition_size(const mtd_instance_s *instance, const char *partname);
|
||||
|
||||
FAR struct mtd_dev_s *px4_at24c_initialize(FAR struct i2c_master_s *dev,
|
||||
uint8_t address);
|
||||
int px4_at24c_initialize(FAR struct i2c_master_s *dev,
|
||||
uint8_t address, FAR struct mtd_dev_s **mtd_dev);
|
||||
|
||||
void px4_at24c_deinitialize(void);
|
||||
|
||||
__END_DECLS
|
||||
|
||||
@@ -65,7 +65,7 @@ static constexpr wq_config_t I2C3{"wq:I2C3", 2336, -11};
|
||||
static constexpr wq_config_t I2C4{"wq:I2C4", 2336, -12};
|
||||
|
||||
// PX4 att/pos controllers, highest priority after sensors.
|
||||
static constexpr wq_config_t nav_and_controllers{"wq:nav_and_controllers", 2240, -13};
|
||||
static constexpr wq_config_t nav_and_controllers{"wq:nav_and_controllers", 2280, -13};
|
||||
|
||||
static constexpr wq_config_t INS0{"wq:INS0", 6000, -14};
|
||||
static constexpr wq_config_t INS1{"wq:INS1", 6000, -15};
|
||||
|
||||
Reference in New Issue
Block a user