From 8044d08fb3540d05014be1830177ca61a0617222 Mon Sep 17 00:00:00 2001 From: Martin Budden Date: Sun, 12 Nov 2017 21:25:54 +0000 Subject: [PATCH] Renamed fc_msp* files to msp* --- make/source.mk | 4 +-- src/main/fc/fc_init.c | 2 +- src/main/fc/fc_tasks.c | 2 +- src/main/interface/cli.c | 4 +-- src/main/interface/fc_msp.h | 26 ------------------- src/main/interface/{fc_msp.c => msp.c} | 7 +++-- src/main/{msp => interface}/msp.h | 5 ++++ .../interface/{fc_msp_box.c => msp_box.c} | 2 +- .../interface/{fc_msp_box.h => msp_box.h} | 0 src/main/io/displayport_msp.c | 2 +- src/main/msp/msp_serial.c | 6 +++-- src/main/msp/msp_serial.h | 2 +- src/main/osd_slave/osd_slave_init.c | 2 +- src/main/telemetry/msp_shared.c | 2 +- src/main/telemetry/smartport.c | 2 +- src/test/unit/cli_unittest.cc | 4 +-- src/test/unit/telemetry_crsf_msp_unittest.cc | 4 +-- 17 files changed, 27 insertions(+), 49 deletions(-) delete mode 100644 src/main/interface/fc_msp.h rename src/main/interface/{fc_msp.c => msp.c} (99%) rename src/main/{msp => interface}/msp.h (89%) rename src/main/interface/{fc_msp_box.c => msp_box.c} (99%) rename src/main/interface/{fc_msp_box.h => msp_box.h} (100%) diff --git a/make/source.mk b/make/source.mk index 7cf45d8f8..f2b5396fb 100644 --- a/make/source.mk +++ b/make/source.mk @@ -53,8 +53,8 @@ COMMON_SRC = \ fc/fc_hardfaults.c \ fc/fc_tasks.c \ fc/runtime_config.c \ - interface/fc_msp.c \ - interface/fc_msp_box.c \ + interface/msp.c \ + interface/msp_box.c \ io/beeper.c \ io/serial.c \ io/statusindicator.c \ diff --git a/src/main/fc/fc_init.c b/src/main/fc/fc_init.c index ae537be90..eaad12a8d 100644 --- a/src/main/fc/fc_init.c +++ b/src/main/fc/fc_init.c @@ -76,8 +76,8 @@ #include "fc/rc_controls.h" #include "fc/runtime_config.h" -#include "interface/fc_msp.h" #include "interface/cli.h" +#include "interface/msp.h" #include "msp/msp_serial.h" diff --git a/src/main/fc/fc_tasks.c b/src/main/fc/fc_tasks.c index 0878a0edf..c576cfc00 100644 --- a/src/main/fc/fc_tasks.c +++ b/src/main/fc/fc_tasks.c @@ -52,7 +52,7 @@ #include "flight/pid.h" #include "interface/cli.h" -#include "interface/fc_msp.h" +#include "interface/msp.h" #include "io/beeper.h" #include "io/dashboard.h" diff --git a/src/main/interface/cli.c b/src/main/interface/cli.c index 125323edd..b70867a8d 100755 --- a/src/main/interface/cli.c +++ b/src/main/interface/cli.c @@ -99,8 +99,8 @@ extern uint8_t __config_end; #include "flight/servos.h" #include "interface/cli.h" -#include "interface/fc_msp.h" -#include "interface/fc_msp_box.h" +#include "interface/msp.h" +#include "interface/msp_box.h" #include "interface/msp_protocol.h" #include "interface/settings.h" diff --git a/src/main/interface/fc_msp.h b/src/main/interface/fc_msp.h deleted file mode 100644 index 964ff7046..000000000 --- a/src/main/interface/fc_msp.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * This file is part of Cleanflight. - * - * Cleanflight is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 3 of the License, or - * (at your option) any later version. - * - * Cleanflight is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with Cleanflight. If not, see . - */ - -#pragma once - -#include "msp/msp.h" - -void mspInit(void); -mspResult_e mspFcProcessCommand(mspPacket_t *cmd, mspPacket_t *reply, mspPostProcessFnPtr *mspPostProcessFn); -void mspFcProcessReply(mspPacket_t *reply); - -void mspSerialProcessStreamSchedule(void); diff --git a/src/main/interface/fc_msp.c b/src/main/interface/msp.c similarity index 99% rename from src/main/interface/fc_msp.c rename to src/main/interface/msp.c index eca4bbc8f..73e1b1a47 100644 --- a/src/main/interface/fc_msp.c +++ b/src/main/interface/msp.c @@ -74,8 +74,8 @@ #include "flight/pid.h" #include "flight/servos.h" -#include "interface/fc_msp.h" -#include "interface/fc_msp_box.h" +#include "interface/msp.h" +#include "interface/msp_box.h" #include "interface/msp_protocol.h" #include "io/asyncfatfs/asyncfatfs.h" @@ -95,11 +95,10 @@ #include "io/vtx.h" #include "io/vtx_string.h" -#include "msp/msp.h" #include "msp/msp_serial.h" -#include "rx/msp.h" #include "rx/rx.h" +#include "rx/msp.h" #include "scheduler/scheduler.h" diff --git a/src/main/msp/msp.h b/src/main/interface/msp.h similarity index 89% rename from src/main/msp/msp.h rename to src/main/interface/msp.h index 702898bb9..96683fbb5 100644 --- a/src/main/msp/msp.h +++ b/src/main/interface/msp.h @@ -43,3 +43,8 @@ struct serialPort_s; typedef void (*mspPostProcessFnPtr)(struct serialPort_s *port); // msp post process function, used for gracefully handling reboots, etc. typedef mspResult_e (*mspProcessCommandFnPtr)(mspPacket_t *cmd, mspPacket_t *reply, mspPostProcessFnPtr *mspPostProcessFn); typedef void (*mspProcessReplyFnPtr)(mspPacket_t *cmd); + + +void mspInit(void); +mspResult_e mspFcProcessCommand(mspPacket_t *cmd, mspPacket_t *reply, mspPostProcessFnPtr *mspPostProcessFn); +void mspFcProcessReply(mspPacket_t *reply); diff --git a/src/main/interface/fc_msp_box.c b/src/main/interface/msp_box.c similarity index 99% rename from src/main/interface/fc_msp_box.c rename to src/main/interface/msp_box.c index 7ffa253f6..e0b6ac810 100644 --- a/src/main/interface/fc_msp_box.c +++ b/src/main/interface/msp_box.c @@ -32,7 +32,7 @@ #include "flight/mixer.h" -#include "interface/fc_msp_box.h" +#include "interface/msp_box.h" #include "sensors/sensors.h" diff --git a/src/main/interface/fc_msp_box.h b/src/main/interface/msp_box.h similarity index 100% rename from src/main/interface/fc_msp_box.h rename to src/main/interface/msp_box.h diff --git a/src/main/io/displayport_msp.c b/src/main/io/displayport_msp.c index 4bdc14f74..434ca3868 100644 --- a/src/main/io/displayport_msp.c +++ b/src/main/io/displayport_msp.c @@ -31,7 +31,7 @@ #include "drivers/display.h" -#include "interface/fc_msp.h" +#include "interface/msp.h" #include "interface/msp_protocol.h" #include "io/displayport_msp.h" diff --git a/src/main/msp/msp_serial.c b/src/main/msp/msp_serial.c index 9500296b4..03c585886 100644 --- a/src/main/msp/msp_serial.c +++ b/src/main/msp/msp_serial.c @@ -21,13 +21,15 @@ #include "platform.h" +#include "build/debug.h" + #include "common/streambuf.h" #include "common/utils.h" -#include "build/debug.h" + +#include "interface/msp.h" #include "io/serial.h" -#include "msp/msp.h" #include "msp/msp_serial.h" static mspPort_t mspPorts[MAX_MSP_PORT_COUNT]; diff --git a/src/main/msp/msp_serial.h b/src/main/msp/msp_serial.h index 003293736..488f06def 100644 --- a/src/main/msp/msp_serial.h +++ b/src/main/msp/msp_serial.h @@ -17,7 +17,7 @@ #pragma once -#include "msp/msp.h" +#include "interface/msp.h" // Each MSP port requires state and a receive buffer, revisit this default if someone needs more than 3 MSP ports. #define MAX_MSP_PORT_COUNT 3 diff --git a/src/main/osd_slave/osd_slave_init.c b/src/main/osd_slave/osd_slave_init.c index d4e85832c..f58a928f6 100644 --- a/src/main/osd_slave/osd_slave_init.c +++ b/src/main/osd_slave/osd_slave_init.c @@ -60,7 +60,7 @@ #include "fc/runtime_config.h" #include "interface/cli.h" -#include "interface/fc_msp.h" +#include "interface/msp.h" #include "msp/msp_serial.h" diff --git a/src/main/telemetry/msp_shared.c b/src/main/telemetry/msp_shared.c index 67bcb842f..3b7ea0349 100644 --- a/src/main/telemetry/msp_shared.c +++ b/src/main/telemetry/msp_shared.c @@ -10,7 +10,7 @@ #include "common/utils.h" -#include "interface/fc_msp.h" +#include "interface/msp.h" #include "rx/crsf.h" diff --git a/src/main/telemetry/smartport.c b/src/main/telemetry/smartport.c index 82c75a8f9..cc5e44f58 100644 --- a/src/main/telemetry/smartport.c +++ b/src/main/telemetry/smartport.c @@ -38,7 +38,7 @@ #include "flight/pid.h" #include "flight/navigation.h" -#include "interface/fc_msp.h" +#include "interface/msp.h" #include "io/beeper.h" #include "io/motors.h" diff --git a/src/test/unit/cli_unittest.cc b/src/test/unit/cli_unittest.cc index 25a8b12f3..1787d5085 100644 --- a/src/test/unit/cli_unittest.cc +++ b/src/test/unit/cli_unittest.cc @@ -39,8 +39,8 @@ extern "C" { #include "flight/pid.h" #include "flight/servos.h" #include "interface/cli.h" - #include "interface/fc_msp.h" - #include "interface/fc_msp_box.h" + #include "interface/msp.h" + #include "interface/msp_box.h" #include "interface/settings.h" #include "io/beeper.h" #include "io/ledstrip.h" diff --git a/src/test/unit/telemetry_crsf_msp_unittest.cc b/src/test/unit/telemetry_crsf_msp_unittest.cc index 12396285e..724542682 100644 --- a/src/test/unit/telemetry_crsf_msp_unittest.cc +++ b/src/test/unit/telemetry_crsf_msp_unittest.cc @@ -46,13 +46,11 @@ extern "C" { #include "fc/config.h" #include "flight/imu.h" - #include "interface/fc_msp.h" + #include "interface/msp.h" #include "io/serial.h" #include "io/gps.h" - #include "msp/msp.h" - #include "rx/rx.h" #include "rx/crsf.h"