Skip to content

Commit

Permalink
Merge branch 'release_7.1.1' into abo_autolanding_landing_disarm_fix
Browse files Browse the repository at this point in the history
  • Loading branch information
breadoven committed Apr 21, 2024
2 parents 1d919de + 66e4526 commit 814f687
Show file tree
Hide file tree
Showing 26 changed files with 1,422 additions and 102 deletions.
4 changes: 2 additions & 2 deletions docs/Settings.md
Original file line number Diff line number Diff line change
Expand Up @@ -1844,11 +1844,11 @@ Allows to chose when the home position is reset. Can help prevent resetting home

### inav_use_gps_no_baro

_// TODO_
Defines if INAV should use only use GPS data for altitude estimation when barometer is not available. If set to ON, INAV will allow GPS assisted modes and RTH even when there is no barometer installed.

| Default | Min | Max |
| --- | --- | --- |
| OFF | OFF | ON |
| ON | OFF | ON |

---

Expand Down
10 changes: 8 additions & 2 deletions src/main/blackbox/blackbox.c
Original file line number Diff line number Diff line change
Expand Up @@ -1308,10 +1308,16 @@ static void writeSlowFrame(void)
static void loadSlowState(blackboxSlowState_t *slow)
{
memcpy(&slow->flightModeFlags, &rcModeActivationMask, sizeof(slow->flightModeFlags)); //was flightModeFlags;
// Also log Nav auto selected flight modes rather than just those selected by boxmode
if (!IS_RC_MODE_ACTIVE(BOXANGLE) && FLIGHT_MODE(ANGLE_MODE)) {
// Also log Nav auto enabled flight modes rather than just those selected by boxmode
if (FLIGHT_MODE(ANGLE_MODE)) {
slow->flightModeFlags |= (1 << BOXANGLE);
}
if (FLIGHT_MODE(NAV_ALTHOLD_MODE)) {
slow->flightModeFlags |= (1 << BOXNAVALTHOLD);
}
if (FLIGHT_MODE(NAV_RTH_MODE)) {
slow->flightModeFlags |= (1 << BOXNAVRTH);
}
if (navigationGetHeadingControlState() == NAV_HEADING_CONTROL_AUTO) {
slow->flightModeFlags |= (1 << BOXHEADINGHOLD);
}
Expand Down
4 changes: 4 additions & 0 deletions src/main/fc/fc_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,10 @@ static void updateArmingStatus(void)
DISABLE_ARMING_FLAG(ARMING_DISABLED_NO_PREARM);
}

if (ARMING_FLAG(ARMING_DISABLED_LANDING_DETECTED) && !IS_RC_MODE_ACTIVE(BOXARM)) {
DISABLE_ARMING_FLAG(ARMING_DISABLED_LANDING_DETECTED);
}

/* CHECK: Arming switch */
// If arming is disabled and the ARM switch is on
// Note that this should be last check so all other blockers could be cleared correctly
Expand Down
3 changes: 2 additions & 1 deletion src/main/fc/settings.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2288,9 +2288,10 @@ groups:
field: use_gps_velned
type: bool
- name: inav_use_gps_no_baro
description: "Defines if INAV should use only use GPS data for altitude estimation when barometer is not available. If set to ON, INAV will allow GPS assisted modes and RTH even when there is no barometer installed."
field: use_gps_no_baro
type: bool
default_value: OFF
default_value: ON
- name: inav_allow_dead_reckoning
description: "Defines if INAV will dead-reckon over short GPS outages. May also be useful for indoors OPFLOW navigation"
default_value: OFF
Expand Down
153 changes: 70 additions & 83 deletions src/main/navigation/navigation.c

Large diffs are not rendered by default.

17 changes: 9 additions & 8 deletions src/main/navigation/navigation_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ typedef enum {
NAV_FSM_EVENT_SWITCH_TO_NAV_STATE_RTH_INITIALIZE = NAV_FSM_EVENT_STATE_SPECIFIC_1,
NAV_FSM_EVENT_SWITCH_TO_NAV_STATE_RTH_TRACKBACK = NAV_FSM_EVENT_STATE_SPECIFIC_2,
NAV_FSM_EVENT_SWITCH_TO_RTH_HEAD_HOME = NAV_FSM_EVENT_STATE_SPECIFIC_3,
NAV_FSM_EVENT_SWITCH_TO_RTH_HOVER_ABOVE_HOME = NAV_FSM_EVENT_STATE_SPECIFIC_4,
NAV_FSM_EVENT_SWITCH_TO_RTH_LOITER_ABOVE_HOME = NAV_FSM_EVENT_STATE_SPECIFIC_4,
NAV_FSM_EVENT_SWITCH_TO_RTH_LANDING = NAV_FSM_EVENT_STATE_SPECIFIC_5,

NAV_FSM_EVENT_COUNT,
Expand All @@ -199,7 +199,7 @@ typedef enum {
NAV_PERSISTENT_ID_RTH_INITIALIZE = 8,
NAV_PERSISTENT_ID_RTH_CLIMB_TO_SAFE_ALT = 9,
NAV_PERSISTENT_ID_RTH_HEAD_HOME = 10,
NAV_PERSISTENT_ID_RTH_HOVER_PRIOR_TO_LANDING = 11,
NAV_PERSISTENT_ID_RTH_LOITER_PRIOR_TO_LANDING = 11,
NAV_PERSISTENT_ID_RTH_LANDING = 12,
NAV_PERSISTENT_ID_RTH_FINISHING = 13,
NAV_PERSISTENT_ID_RTH_FINISHED = 14,
Expand Down Expand Up @@ -230,7 +230,7 @@ typedef enum {
NAV_PERSISTENT_ID_CRUISE_ADJUSTING = 34,

NAV_PERSISTENT_ID_WAYPOINT_HOLD_TIME = 35,
NAV_PERSISTENT_ID_RTH_HOVER_ABOVE_HOME = 36,
NAV_PERSISTENT_ID_RTH_LOITER_ABOVE_HOME = 36,
NAV_PERSISTENT_ID_UNUSED_4 = 37, // was NAV_STATE_WAYPOINT_HOVER_ABOVE_HOME
NAV_PERSISTENT_ID_RTH_TRACKBACK = 38,

Expand Down Expand Up @@ -261,8 +261,8 @@ typedef enum {
NAV_STATE_RTH_CLIMB_TO_SAFE_ALT,
NAV_STATE_RTH_TRACKBACK,
NAV_STATE_RTH_HEAD_HOME,
NAV_STATE_RTH_HOVER_PRIOR_TO_LANDING,
NAV_STATE_RTH_HOVER_ABOVE_HOME,
NAV_STATE_RTH_LOITER_PRIOR_TO_LANDING,
NAV_STATE_RTH_LOITER_ABOVE_HOME,
NAV_STATE_RTH_LANDING,
NAV_STATE_RTH_FINISHING,
NAV_STATE_RTH_FINISHED,
Expand Down Expand Up @@ -331,9 +331,10 @@ typedef enum {

/* Additional flags */
NAV_CTL_LAND = (1 << 14),
NAV_AUTO_WP_DONE = (1 << 15), //Waypoint mission reached the last waypoint and is idling
NAV_AUTO_WP_DONE = (1 << 15), // Waypoint mission reached the last waypoint and is idling

NAV_MIXERAT = (1 << 16), //MIXERAT in progress
NAV_MIXERAT = (1 << 16), // MIXERAT in progress
NAV_CTL_HOLD = (1 << 17), // Nav loiter active at position or will be when position reached
} navigationFSMStateFlags_t;

typedef struct {
Expand Down Expand Up @@ -400,7 +401,7 @@ typedef enum {
RTH_HOME_ENROUTE_INITIAL, // Initial position for RTH approach
RTH_HOME_ENROUTE_PROPORTIONAL, // Prorpotional position for RTH approach
RTH_HOME_ENROUTE_FINAL, // Final position for RTH approach
RTH_HOME_FINAL_HOVER, // Final hover altitude (if rth_home_altitude is set)
RTH_HOME_FINAL_LOITER, // Final loiter altitude (if rth_home_altitude is set)
RTH_HOME_FINAL_LAND, // Home position and altitude
} rthTargetMode_e;

Expand Down
3 changes: 3 additions & 0 deletions src/main/target/AOCODARCF4V3/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
target_stm32f405xg(AOCODARCF4V3_SD)
target_stm32f405xg(AOCODARCF4V3)

40 changes: 40 additions & 0 deletions src/main/target/AOCODARCF4V3/config.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* 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 <stdint.h>

#include "platform.h"

#include "fc/fc_msp_box.h"
//#include "fc/config.h"

#include "io/piniobox.h"
#include "drivers/serial.h"
#include "io/serial.h"
void targetConfiguration(void)
{
pinioBoxConfigMutable()->permanentId[0] = BOX_PERMANENT_ID_USER1;
pinioBoxConfigMutable()->permanentId[1] = BOX_PERMANENT_ID_USER2;
pinioBoxConfigMutable()->permanentId[2] = BOX_PERMANENT_ID_USER3;
// beeperConfigMutable()->pwmMode = true;
serialConfigMutable()->portConfigs[findSerialPortIndexByIdentifier(SERIAL_PORT_USART5)].functionMask = FUNCTION_MSP;
serialConfigMutable()->portConfigs[findSerialPortIndexByIdentifier(SERIAL_PORT_USART5)].msp_baudrateIndex = BAUD_115200;
serialConfigMutable()->portConfigs[4].functionMask = FUNCTION_VTX_TRAMP;
serialConfigMutable()->portConfigs[4].peripheral_baudrateIndex = BAUD_115200;
serialConfigMutable()->portConfigs[findSerialPortIndexByIdentifier(SERIAL_PORT_USART2)].functionMask = FUNCTION_RX_SERIAL;
serialConfigMutable()->portConfigs[findSerialPortIndexByIdentifier(SERIAL_PORT_USART3)].functionMask = FUNCTION_ESCSERIAL;
serialConfigMutable()->portConfigs[findSerialPortIndexByIdentifier(SERIAL_PORT_USART1)].functionMask = FUNCTION_GPS;
}
46 changes: 46 additions & 0 deletions src/main/target/AOCODARCF4V3/target.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
/*
* This file is part of INAV.
*
* INAV 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.
*
* INAV 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 INAV. If not, see <http://www.gnu.org/licenses/>.
*/


#include <stdint.h>

#include "platform.h"
#include "drivers/io.h"
#include "drivers/timer.h"
#include "drivers/pwm_mapping.h"
#include "drivers/bus.h"

timerHardware_t timerHardware[] = {
DEF_TIM(TIM5, CH4, PA3, TIM_USE_PPM, 0, 0 ), // PPM IN

DEF_TIM(TIM8, CH1, PC6, TIM_USE_OUTPUT_AUTO, 0, 1 ), // S1
DEF_TIM(TIM8, CH2, PC7, TIM_USE_OUTPUT_AUTO, 0, 1 ), // S2
DEF_TIM(TIM8, CH3, PC8, TIM_USE_OUTPUT_AUTO, 0, 1 ), // S3
DEF_TIM(TIM8, CH4, PC9, TIM_USE_OUTPUT_AUTO, 0, 0 ), // S4

DEF_TIM(TIM2, CH1, PA15, TIM_USE_OUTPUT_AUTO, 0, 0 ), // S5
DEF_TIM(TIM1, CH1, PA8, TIM_USE_OUTPUT_AUTO, 0, 1 ), // S6

DEF_TIM(TIM2, CH3, PB10, TIM_USE_OUTPUT_AUTO, 0, 0 ), // S7
DEF_TIM(TIM2, CH4, PB11, TIM_USE_OUTPUT_AUTO, 0, 0 ), // S8

DEF_TIM(TIM3, CH4, PB1, TIM_USE_LED, 0, 0 ), // LED_STRIP


};

const int timerHardwareCount = sizeof(timerHardware) / sizeof(timerHardware[0]);
Loading

0 comments on commit 814f687

Please sign in to comment.