Skip to content

Commit

Permalink
Merge remote-tracking branch 'betaflight/master' into betaflight-master
Browse files Browse the repository at this point in the history
  • Loading branch information
hydra committed Aug 29, 2017
2 parents 39d211d + 66985c5 commit 58c2140
Show file tree
Hide file tree
Showing 316 changed files with 2,854 additions and 2,346 deletions.
4 changes: 2 additions & 2 deletions .travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ elif [ $TARGET ] ; then

elif [ $GOAL ] ; then
$MAKE $GOAL || exit $?

if [ $PUBLISHCOV ] ; then
if [ "test" == "$GOAL" ] ; then
lcov --directory . -b src/test --capture --output-file coverage.info 2>&1 | grep -E ":version '402\*', prefer.*'406\*" --invert-match
Expand All @@ -76,6 +76,6 @@ elif [ $GOAL ] ; then
coveralls-lcov coverage.info # uploads to coveralls
fi
fi
else
else
$MAKE all
fi
4 changes: 2 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -61,11 +61,11 @@ after_success:
- lcov --list coverage.info # debug before upload
- coveralls-lcov coverage.info # uploads to coveralls

cache:
cache:
directories:
- downloads
- tools


#notifications:
# irc: "chat.freenode.net#cleanflight"
Expand Down
2 changes: 0 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,3 @@ Please search for existing issues *before* creating new ones.
# Developers

Please refer to the development section in the `docs/development` folder.


4 changes: 2 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ FATFS_SRC = $(notdir $(wildcard $(FATFS_DIR)/*.c))

CSOURCES := $(shell find $(SRC_DIR) -name '*.c')

LD_FLAGS :=
LD_FLAGS :=

#
# Default Tool options - can be overridden in {mcu}.mk files.
Expand Down Expand Up @@ -338,7 +338,7 @@ targets-group-rest: $(GROUP_OTHER_TARGETS)

$(VALID_TARGETS):
$(V0) @echo "Building $@" && \
time $(MAKE) binary hex TARGET=$@ && \
$(MAKE) binary hex TARGET=$@ && \
echo "Building $@ succeeded."

$(SKIP_TARGETS):
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ Big thanks to current and past contributors:
* **Sambas** (for the original STM32F4 port).
* Bardwell, Joshua (joshuabardwell)
* ctzsnooze
* Höglund, Anders (andershoglund)
* Höglund, Anders (andershoglund)
* Ledvin, Peter (ledvinap) - **IO code awesomeness!**
* kc10kevin
* Keeble, Gary (MadmanK)
Expand Down
1 change: 0 additions & 1 deletion make/build_verbosity.mk
Original file line number Diff line number Diff line change
Expand Up @@ -19,4 +19,3 @@ export V0 :=
export V1 :=
export STDOUT :=
endif

2 changes: 1 addition & 1 deletion make/mcu/SITL.mk
Original file line number Diff line number Diff line change
Expand Up @@ -66,4 +66,4 @@ OPTIMISE_SPEED := -Ofast
OPTIMISE_SIZE := -Os

LTO_FLAGS := $(OPTIMISATION_BASE) $(OPTIMISE_SPEED)
endif
endif
6 changes: 3 additions & 3 deletions make/mcu/STM32F1.mk
Original file line number Diff line number Diff line change
Expand Up @@ -69,12 +69,12 @@ MCU_COMMON_SRC = \
drivers/system_stm32f10x.c \
drivers/timer_stm32f10x.c

DSP_LIB :=
DSP_LIB :=

ifneq ($(DEBUG),GDB)
OPTIMISE_DEFAULT := -Os
OPTIMISE_SPEED :=
OPTIMISE_SIZE :=
OPTIMISE_SPEED :=
OPTIMISE_SIZE :=

LTO_FLAGS := $(OPTIMISATION_BASE) $(OPTIMISE_DEFAULT)
endif
4 changes: 2 additions & 2 deletions make/mcu/STM32F4.mk
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ ifeq ($(PERIPH_DRIVER), HAL)
CMSIS_DIR := $(ROOT)/lib/main/STM32F4/Drivers/CMSIS
STDPERIPH_DIR = $(ROOT)/lib/main/STM32F4/Drivers/STM32F4xx_HAL_Driver
STDPERIPH_SRC = $(notdir $(wildcard $(STDPERIPH_DIR)/Src/*.c))
EXCLUDES =
EXCLUDES =
else
CMSIS_DIR := $(ROOT)/lib/main/CMSIS/CM4
STDPERIPH_DIR = $(ROOT)/lib/main/STM32F4/Drivers/STM32F4xx_StdPeriph_Driver
Expand Down Expand Up @@ -102,7 +102,7 @@ VPATH := $(VPATH):$(CMSIS_DIR)/CoreSupport:$(CMSIS_DIR)/DeviceSupport/
VPATH := $(VPATH):$(CMSIS_DIR)/Core:$(CMSIS_DIR)/Device/ST/STM32F4xx

ifeq ($(PERIPH_DRIVER), HAL)
CMSIS_SRC :=
CMSIS_SRC :=
INCLUDE_DIRS := $(INCLUDE_DIRS) \
$(STDPERIPH_DIR)/Inc \
$(USBCORE_DIR)/Inc \
Expand Down
4 changes: 2 additions & 2 deletions make/mcu/STM32F7.mk
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ DEVICE_STDPERIPH_SRC := $(STDPERIPH_SRC) \
#CMSIS
VPATH := $(VPATH):$(CMSIS_DIR)/Include:$(CMSIS_DIR)/Device/ST/STM32F7xx
VPATH := $(VPATH):$(STDPERIPH_DIR)/Src
CMSIS_SRC :=
CMSIS_SRC :=
INCLUDE_DIRS := $(INCLUDE_DIRS) \
$(STDPERIPH_DIR)/Inc \
$(USBCORE_DIR)/Inc \
Expand All @@ -114,7 +114,7 @@ ARCH_FLAGS = -mthumb -mcpu=cortex-m7 -mfloat-abi=hard -mfpu=fpv5-sp-d16 -fs

DEVICE_FLAGS = -DUSE_HAL_DRIVER -DUSE_FULL_LL_DRIVER
ifeq ($(TARGET),$(filter $(TARGET),$(F7X5XG_TARGETS)))
DEVICE_FLAGS += -DSTM32F745xx
DEVICE_FLAGS += -DSTM32F745xx
LD_SCRIPT = $(LINKER_DIR)/stm32_flash_f745.ld
STARTUP_SRC = startup_stm32f745xx.s
TARGET_FLASH := 2048
Expand Down
1 change: 0 additions & 1 deletion make/openocd.mk
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ endif
ifneq ($(OPENOCD_CFG),)
OPENOCD_COMMAND = $(OPENOCD) -f $(OPENOCD_IF) -f $(OPENOCD_CFG)
endif

5 changes: 4 additions & 1 deletion make/source.mk
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,9 @@ FC_SRC = \
cms/cms_menu_ledstrip.c \
cms/cms_menu_misc.c \
cms/cms_menu_osd.c \
cms/cms_menu_vtx_rtc6705.c \
cms/cms_menu_vtx_smartaudio.c \
cms/cms_menu_vtx_tramp.c \
common/colorconversion.c \
common/gps_conversion.c \
drivers/display_ug2864hsweg01.c \
Expand Down Expand Up @@ -164,7 +167,7 @@ FC_SRC = \
io/vtx_smartaudio.c \
io/vtx_tramp.c \
io/vtx_control.c

COMMON_DEVICE_SRC = \
$(CMSIS_SRC) \
$(DEVICE_STDPERIPH_SRC)
Expand Down
1 change: 0 additions & 1 deletion make/tools.mk
Original file line number Diff line number Diff line change
Expand Up @@ -344,4 +344,3 @@ breakpad_clean:
$(V1) [ ! -d "$(BREAKPAD_DIR)" ] || $(RM) -rf $(BREAKPAD_DIR)
$(V0) @echo " CLEAN $(BREAKPAD_DL_FILE)"
$(V1) $(RM) -f $(BREAKPAD_DL_FILE)

21 changes: 2 additions & 19 deletions src/main/blackbox/blackbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -925,25 +925,8 @@ void stopInTestMode(void)
*/
bool inMotorTestMode(void) {
static uint32_t resetTime = 0;
uint16_t inactiveMotorCommand;
if (feature(FEATURE_3D)) {
inactiveMotorCommand = flight3DConfig()->neutral3d;
#ifdef USE_DSHOT
} else if (isMotorProtocolDshot()) {
inactiveMotorCommand = DSHOT_DISARM_COMMAND;
#endif
} else {
inactiveMotorCommand = motorConfig()->mincommand;
}

int i;
bool atLeastOneMotorActivated = false;

// set disarmed motor values
for (i = 0; i < MAX_SUPPORTED_MOTORS; i++)
atLeastOneMotorActivated |= (motor_disarmed[i] != inactiveMotorCommand);

if (atLeastOneMotorActivated) {
if (!ARMING_FLAG(ARMED) && areMotorsRunning()) {
resetTime = millis() + 5000; // add 5 seconds
return true;
} else {
Expand Down Expand Up @@ -1645,7 +1628,7 @@ void blackboxUpdate(timeUs_t currentTimeUs)
// Did we run out of room on the device? Stop!
if (isBlackboxDeviceFull()) {
#ifdef USE_FLASHFS
if (blackboxState != BLACKBOX_STATE_ERASING
if (blackboxState != BLACKBOX_STATE_ERASING
&& blackboxState != BLACKBOX_STATE_START_ERASE
&& blackboxState != BLACKBOX_STATE_ERASED) {
#endif
Expand Down
1 change: 0 additions & 1 deletion src/main/build/build_config.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,4 +38,3 @@
#define REQUIRE_CC_ARM_PRINTF_SUPPORT
#define REQUIRE_PRINTF_LONG_SUPPORT
#endif

4 changes: 3 additions & 1 deletion src/main/build/debug.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,5 +49,7 @@ const char * const debugModeNames[DEBUG_COUNT] = {
"ALTITUDE",
"FFT",
"FFT_TIME",
"FFT_FREQ"
"FFT_FREQ",
"FRSKY_D_RX",
"GYRO_RAW"
};
4 changes: 3 additions & 1 deletion src/main/build/debug.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ typedef enum {
DEBUG_MIXER,
DEBUG_AIRMODE,
DEBUG_PIDLOOP,
DEBUG_NOTCH,
DEBUG_GYRO_NOTCH,
DEBUG_RC_INTERPOLATION,
DEBUG_VELOCITY,
DEBUG_DTERM_FILTER,
Expand All @@ -68,6 +68,8 @@ typedef enum {
DEBUG_FFT,
DEBUG_FFT_TIME,
DEBUG_FFT_FREQ,
DEBUG_FRSKY_D_RX,
DEBUG_GYRO_RAW,
DEBUG_COUNT
} debugType_e;

Expand Down
8 changes: 4 additions & 4 deletions src/main/build/version.h
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@
* along with Cleanflight. If not, see <http://www.gnu.org/licenses/>.
*/

#pragma once

#include "common/utils.h"

#define FC_FIRMWARE_NAME "Cleanflight"
#define FC_VERSION_MAJOR 2 // increment when a major release is made (big new feature, etc)
#define FC_VERSION_MINOR 1 // increment when a minor release is made (small new feature, change etc)
#define FC_VERSION_PATCH_LEVEL 0 // increment when a bug is fixed

#define STR_HELPER(x) #x
#define STR(x) STR_HELPER(x)
#define FC_VERSION_STRING STR(FC_VERSION_MAJOR) "." STR(FC_VERSION_MINOR) "." STR(FC_VERSION_PATCH_LEVEL)

#define MW_VERSION 231

extern const char* const targetName;

#define GIT_SHORT_REVISION_LENGTH 7 // lower case hexadecimal digits.
Expand Down
2 changes: 1 addition & 1 deletion src/main/cms/cms.c
Original file line number Diff line number Diff line change
Expand Up @@ -610,7 +610,7 @@ static void cmsTraverseGlobalExit(const CMS_Menu *pMenu)
}

long cmsMenuExit(displayPort_t *pDisplay, const void *ptr)
{
{
int exitType = (int)ptr;
switch (exitType) {
case CMS_EXIT_SAVE:
Expand Down
1 change: 0 additions & 1 deletion src/main/cms/cms.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,4 +25,3 @@ void cmsUpdate(uint32_t currentTimeUs);
#define CMS_EXIT (0)
#define CMS_EXIT_SAVE (1)
#define CMS_EXIT_SAVEREBOOT (2)

9 changes: 5 additions & 4 deletions src/main/cms/cms_menu_builtin.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,11 +44,12 @@
#include "cms/cms_menu_ledstrip.h"
#include "cms/cms_menu_misc.h"

// User supplied menus
// VTX supplied menus

#include "cms/cms_menu_vtx_rtc6705.h"
#include "cms/cms_menu_vtx_smartaudio.h"
#include "cms/cms_menu_vtx_tramp.h"

#include "io/vtx_rtc6705_cms.h"
#include "io/vtx_smartaudio_cms.h"
#include "io/vtx_tramp.h"

// Info

Expand Down
102 changes: 102 additions & 0 deletions src/main/cms/cms_menu_vtx_rtc6705.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
/*
* 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 <http://www.gnu.org/licenses/>.
*/

#include <stdbool.h>
#include <stdint.h>
#include <ctype.h>

#include "platform.h"

#ifdef CMS

#include "common/printf.h"
#include "common/utils.h"

#include "cms/cms.h"
#include "cms/cms_types.h"

#include "io/vtx_string.h"
#include "io/vtx_rtc6705.h"


static uint8_t cmsx_vtxBand;
static uint8_t cmsx_vtxChannel;
static uint8_t cmsx_vtxPower;

static const char * const rtc6705BandNames[] = {
"BOSCAM A",
"BOSCAM B",
"BOSCAM E",
"FATSHARK",
"RACEBAND",
};

static OSD_TAB_t entryVtxBand = {&cmsx_vtxBand, ARRAYLEN(rtc6705BandNames) - 1, &rtc6705BandNames[0]};
static OSD_UINT8_t entryVtxChannel = {&cmsx_vtxChannel, 1, 8, 1};
static OSD_TAB_t entryVtxPower = {&cmsx_vtxPower, RTC6705_POWER_COUNT - 1, &rtc6705PowerNames[0]};

static void cmsx_Vtx_ConfigRead(void)
{
cmsx_vtxBand = vtxRTC6705Config()->band - 1;
cmsx_vtxChannel = vtxRTC6705Config()->channel;
cmsx_vtxPower = vtxRTC6705Config()->power;
}

static void cmsx_Vtx_ConfigWriteback(void)
{
vtxRTC6705ConfigMutable()->band = cmsx_vtxBand + 1;
vtxRTC6705ConfigMutable()->channel = cmsx_vtxChannel;
vtxRTC6705ConfigMutable()->power = cmsx_vtxPower;
}

static long cmsx_Vtx_onEnter(void)
{
cmsx_Vtx_ConfigRead();

return 0;
}

static long cmsx_Vtx_onExit(const OSD_Entry *self)
{
UNUSED(self);

cmsx_Vtx_ConfigWriteback();

return 0;
}


static OSD_Entry cmsx_menuVtxEntries[] =
{
{"--- VTX ---", OME_Label, NULL, NULL, 0},
{"BAND", OME_TAB, NULL, &entryVtxBand, 0},
{"CHANNEL", OME_UINT8, NULL, &entryVtxChannel, 0},
{"POWER", OME_TAB, NULL, &entryVtxPower, 0},
{"BACK", OME_Back, NULL, NULL, 0},
{NULL, OME_END, NULL, NULL, 0}
};

CMS_Menu cmsx_menuVtxRTC6705 = {
.GUARD_text = "MENUVTX",
.GUARD_type = OME_MENU,
.onEnter = cmsx_Vtx_onEnter,
.onExit= cmsx_Vtx_onExit,
.onGlobalExit = NULL,
.entries = cmsx_menuVtxEntries
};

#endif // CMS
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,7 @@

#pragma once

#include "cms/cms.h"
#include "cms/cms_types.h"

extern CMS_Menu cmsx_menuVtxRTC6705;
Loading

0 comments on commit 58c2140

Please sign in to comment.