mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-07-14 11:00:37 +08:00
rc lib: cleanup, move structs out of common_rc.h
This commit is contained in:
@@ -7,19 +7,8 @@
|
||||
#include "sbus.h"
|
||||
#include "st24.h"
|
||||
#include "sumd.h"
|
||||
#include "dsm.h"
|
||||
|
||||
#pragma pack(push, 1)
|
||||
typedef uint8_t dsm_frame_t[DSM_BUFFER_SIZE]; /**< DSM dsm frame receive buffer */
|
||||
typedef uint8_t dsm_buf_t[DSM_FRAME_SIZE * 2]; // Define working buffer
|
||||
|
||||
typedef struct dsm_decode_t {
|
||||
dsm_frame_t frame;
|
||||
dsm_buf_t buf;
|
||||
} dsm_decode_t;
|
||||
|
||||
typedef uint8_t sbus_frame_t[SBUS_FRAME_SIZE + (SBUS_FRAME_SIZE / 2)];
|
||||
|
||||
typedef struct rc_decode_buf_ {
|
||||
union {
|
||||
dsm_decode_t dsm;
|
||||
|
||||
+12
-2
@@ -42,8 +42,6 @@
|
||||
#pragma once
|
||||
|
||||
#include <stdint.h>
|
||||
#include <px4_config.h>
|
||||
#include <board_config.h>
|
||||
#include <px4_defines.h>
|
||||
|
||||
__BEGIN_DECLS
|
||||
@@ -53,6 +51,18 @@ __BEGIN_DECLS
|
||||
#define DSM_MAX_CHANNEL_COUNT 18 /**< Max channel count of any DSM RC */
|
||||
#define DSM_BUFFER_SIZE (DSM_FRAME_SIZE + DSM_FRAME_SIZE / 2)
|
||||
|
||||
|
||||
#pragma pack(push, 1)
|
||||
typedef uint8_t dsm_frame_t[DSM_BUFFER_SIZE]; /**< DSM dsm frame receive buffer */
|
||||
typedef uint8_t dsm_buf_t[DSM_FRAME_SIZE * 2]; // Define working buffer
|
||||
|
||||
typedef struct dsm_decode_t {
|
||||
dsm_frame_t frame;
|
||||
dsm_buf_t buf;
|
||||
} dsm_decode_t;
|
||||
|
||||
#pragma pack(pop)
|
||||
|
||||
__EXPORT int dsm_init(const char *device);
|
||||
__EXPORT void dsm_deinit(void);
|
||||
__EXPORT void dsm_proto_init(void);
|
||||
|
||||
@@ -49,6 +49,9 @@ __BEGIN_DECLS
|
||||
#define SBUS_FRAME_SIZE 25
|
||||
#define SBUS_BUFFER_SIZE (SBUS_FRAME_SIZE + SBUS_FRAME_SIZE / 2)
|
||||
|
||||
typedef uint8_t sbus_frame_t[SBUS_FRAME_SIZE + (SBUS_FRAME_SIZE / 2)];
|
||||
|
||||
|
||||
__EXPORT int sbus_init(const char *device, bool singlewire);
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user