rc lib: cleanup, move structs out of common_rc.h

This commit is contained in:
Beat Küng
2018-07-23 17:51:25 +02:00
committed by Lorenz Meier
parent 388b963dd8
commit 74e4619042
3 changed files with 15 additions and 13 deletions
-11
View File
@@ -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
View File
@@ -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);
+3
View File
@@ -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);
/**