Merge pull request #1244 from martinbudden/bf_msp_split_stage1
Splitting MSP into serial and MSP parts - stage1
This commit is contained in:
commit
5253c72625
2
Makefile
2
Makefile
|
@ -439,8 +439,8 @@ COMMON_SRC = \
|
||||||
io/serial_4way_avrootloader.c \
|
io/serial_4way_avrootloader.c \
|
||||||
io/serial_4way_stk500v2.c \
|
io/serial_4way_stk500v2.c \
|
||||||
io/serial_cli.c \
|
io/serial_cli.c \
|
||||||
io/serial_msp.c \
|
|
||||||
io/statusindicator.c \
|
io/statusindicator.c \
|
||||||
|
msp/msp_server_fc.c \
|
||||||
rx/ibus.c \
|
rx/ibus.c \
|
||||||
rx/jetiexbus.c \
|
rx/jetiexbus.c \
|
||||||
rx/msp.c \
|
rx/msp.c \
|
||||||
|
|
|
@ -48,5 +48,4 @@ struct serialConfig_s;
|
||||||
void mspSerialInit(struct serialConfig_s *serialConfig);
|
void mspSerialInit(struct serialConfig_s *serialConfig);
|
||||||
void mspSerialProcess(void);
|
void mspSerialProcess(void);
|
||||||
void mspSerialAllocatePorts(struct serialConfig_s *serialConfig);
|
void mspSerialAllocatePorts(struct serialConfig_s *serialConfig);
|
||||||
struct serialPort_s;
|
|
||||||
void mspSerialReleasePortIfAllocated(struct serialPort_s *serialPort);
|
void mspSerialReleasePortIfAllocated(struct serialPort_s *serialPort);
|
||||||
|
|
|
@ -67,7 +67,8 @@
|
||||||
#include "io/serial_4way.h"
|
#include "io/serial_4way.h"
|
||||||
#include "io/serial_msp.h"
|
#include "io/serial_msp.h"
|
||||||
#include "io/vtx.h"
|
#include "io/vtx.h"
|
||||||
#include "io/msp_protocol.h"
|
|
||||||
|
#include "msp/msp_protocol.h"
|
||||||
|
|
||||||
#include "rx/rx.h"
|
#include "rx/rx.h"
|
||||||
#include "rx/msp.h"
|
#include "rx/msp.h"
|
||||||
|
@ -102,6 +103,10 @@
|
||||||
#include "hardware_revision.h"
|
#include "hardware_revision.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "io/serial_msp.h"
|
||||||
|
|
||||||
|
#include "io/serial_4way.h"
|
||||||
|
|
||||||
static serialPort_t *mspSerialPort;
|
static serialPort_t *mspSerialPort;
|
||||||
|
|
||||||
extern uint16_t cycleTime; // FIXME dependency on mw.c
|
extern uint16_t cycleTime; // FIXME dependency on mw.c
|
||||||
|
@ -164,6 +169,10 @@ extern int16_t motor_disarmed[MAX_SUPPORTED_MOTORS];
|
||||||
|
|
||||||
// cause reboot after MSP processing complete
|
// cause reboot after MSP processing complete
|
||||||
static bool isRebootScheduled = false;
|
static bool isRebootScheduled = false;
|
||||||
|
STATIC_UNIT_TESTED mspPort_t mspPorts[MAX_MSP_PORT_COUNT];
|
||||||
|
STATIC_UNIT_TESTED mspPort_t *currentPort;
|
||||||
|
STATIC_UNIT_TESTED bufWriter_t *writer;
|
||||||
|
|
||||||
|
|
||||||
static const char pidnames[] =
|
static const char pidnames[] =
|
||||||
"ROLL;"
|
"ROLL;"
|
||||||
|
@ -186,11 +195,6 @@ typedef enum {
|
||||||
} mspSDCardState_e;
|
} mspSDCardState_e;
|
||||||
|
|
||||||
|
|
||||||
STATIC_UNIT_TESTED mspPort_t mspPorts[MAX_MSP_PORT_COUNT];
|
|
||||||
|
|
||||||
STATIC_UNIT_TESTED mspPort_t *currentPort;
|
|
||||||
STATIC_UNIT_TESTED bufWriter_t *writer;
|
|
||||||
|
|
||||||
#define RATEPROFILE_MASK (1 << 7)
|
#define RATEPROFILE_MASK (1 << 7)
|
||||||
|
|
||||||
#define JUMBO_FRAME_SIZE_LIMIT 255
|
#define JUMBO_FRAME_SIZE_LIMIT 255
|
||||||
|
@ -490,7 +494,7 @@ void mspSerialReleasePortIfAllocated(serialPort_t *serialPort)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void mspSerialInit(serialConfig_t *serialConfig)
|
static void mspInit(void)
|
||||||
{
|
{
|
||||||
// calculate used boxes based on features and fill availableBoxes[] array
|
// calculate used boxes based on features and fill availableBoxes[] array
|
||||||
memset(activeBoxIds, 0xFF, sizeof(activeBoxIds));
|
memset(activeBoxIds, 0xFF, sizeof(activeBoxIds));
|
||||||
|
@ -587,7 +591,11 @@ void mspSerialInit(serialConfig_t *serialConfig)
|
||||||
activeBoxIds[activeBoxIdCount++] = BOXSERVO3;
|
activeBoxIds[activeBoxIdCount++] = BOXSERVO3;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
void mspSerialInit(serialConfig_t *serialConfig)
|
||||||
|
{
|
||||||
|
mspInit();
|
||||||
memset(mspPorts, 0x00, sizeof(mspPorts));
|
memset(mspPorts, 0x00, sizeof(mspPorts));
|
||||||
mspSerialAllocatePorts(serialConfig);
|
mspSerialAllocatePorts(serialConfig);
|
||||||
}
|
}
|
Loading…
Reference in New Issue