Skip to content

Commit 4939a7f

Browse files
Merge pull request #11662 from iNavFlight/release/9.1
Release/9.1 to master
2 parents e7d5cce + 2ca81dd commit 4939a7f

24 files changed

Lines changed: 615 additions & 34 deletions

File tree

docs/Display.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ Links to displays:
4040
* [banggood.com](https://inavflight.com/shop/s/bg/969147) 0.96 Inch 4Pin IIC I2C Blue OLED Display Module For Arduino
4141
* [wide.hk](http://www.wide.hk/products.php?product=I2C-0.96%22-OLED-display-module-%28-compatible-Arduino-%29) I2C 0.96" OLED display module
4242
* [witespyquad.gostorego.com](http://witespyquad.gostorego.com/accessories/readytofly-1-oled-128x64-pid-tuning-display-i2c.html) ReadyToFlyQuads 1" OLED Display
43-
* [multiwiicopter.com](http://www.multiwiicopter.com/products/1-oled) PARIS 1" OLED 128x64 PID tuning screen AIR
4443

4544
The banggood.com display is the cheapest at the time of writing and will correctly send I2C ACK signals.
4645

lib/main/STM32F7/Drivers/STM32F7xx_HAL_Driver/Src/stm32f7xx_ll_usb.c

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -506,8 +506,6 @@ HAL_StatusTypeDef USB_ActivateEndpoint(USB_OTG_GlobalTypeDef *USBx, USB_OTG_EPTy
506506
*/
507507
HAL_StatusTypeDef USB_ActivateDedicatedEndpoint(USB_OTG_GlobalTypeDef *USBx, USB_OTG_EPTypeDef *ep)
508508
{
509-
static __IO uint32_t debug = 0;
510-
511509
/* Read DEPCTLn register */
512510
if (ep->is_in == 1)
513511
{
@@ -517,10 +515,6 @@ HAL_StatusTypeDef USB_ActivateDedicatedEndpoint(USB_OTG_GlobalTypeDef *USBx, USB
517515
((ep->num) << 22 ) | (USB_OTG_DIEPCTL_SD0PID_SEVNFRM) | (USB_OTG_DIEPCTL_USBAEP));
518516
}
519517

520-
521-
debug |= ((ep->maxpacket & USB_OTG_DIEPCTL_MPSIZ ) | (ep->type << 18 ) |\
522-
((ep->num) << 22 ) | (USB_OTG_DIEPCTL_SD0PID_SEVNFRM) | (USB_OTG_DIEPCTL_USBAEP));
523-
524518
USBx_DEVICE->DEACHMSK |= USB_OTG_DAINTMSK_IEPM & ((1 << (ep->num)));
525519
}
526520
else
@@ -529,11 +523,6 @@ HAL_StatusTypeDef USB_ActivateDedicatedEndpoint(USB_OTG_GlobalTypeDef *USBx, USB
529523
{
530524
USBx_OUTEP(ep->num)->DOEPCTL |= ((ep->maxpacket & USB_OTG_DOEPCTL_MPSIZ ) | (ep->type << 18 ) |\
531525
((ep->num) << 22 ) | (USB_OTG_DOEPCTL_USBAEP));
532-
533-
debug = (uint32_t)(((uint32_t )USBx) + USB_OTG_OUT_ENDPOINT_BASE + (0)*USB_OTG_EP_REG_SIZE);
534-
debug = (uint32_t )&USBx_OUTEP(ep->num)->DOEPCTL;
535-
debug |= ((ep->maxpacket & USB_OTG_DOEPCTL_MPSIZ ) | (ep->type << 18 ) |\
536-
((ep->num) << 22 ) | (USB_OTG_DOEPCTL_USBAEP));
537526
}
538527

539528
USBx_DEVICE->DEACHMSK |= USB_OTG_DAINTMSK_OEPM & ((1 << (ep->num)) << 16);

src/main/io/serial_4way_avrootloader.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ uint8_t BL_ConnectEx(uint8_32_u *pDeviceInfo)
195195

196196
//DeviceInfo.dword=0; is set before
197197
uint8_t BootInfo[9];
198-
uint8_t BootMsg[BootMsgLen-1] = "471";
198+
uint8_t BootMsg[BootMsgLen-1] = {'4','7','1'};
199199
// x * 0 + 9
200200
#if defined(USE_SERIAL_4WAY_SK_BOOTLOADER)
201201
uint8_t BootInit[] = {0,0,0,0,0,0,0,0,0,0,0,0,0x0D,'B','L','H','e','l','i',0xF4,0x7D};

src/main/navigation/navigation.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4228,6 +4228,7 @@ void calculateAndSetActiveWaypointToLocalPosition(const fpVector3_t *pos)
42284228
posControl.activeWaypoint.bearing = calculateBearingToDestination(pos);
42294229
}
42304230
posControl.activeWaypoint.nextTurnAngle = -1; // no turn angle set (-1), will be set by WP mode as required
4231+
posControl.flags.wpTurnSmoothingActive = false; // a freshly activated WP (e.g. JUMP target) must not inherit the previous WP's smoothing-reached state
42314232

42324233
posControl.activeWaypoint.pos = *pos;
42334234

src/main/navigation/navigation_fixedwing.c

Lines changed: 14 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,13 @@ static void updatePositionHeadingController_FW(timeUs_t currentTimeUs, timeDelta
454454
}
455455

456456
if (isWaypointNavTrackingActive()) {
457+
/* Cross-track controller state. Scoped here, not in the control branch, so the
458+
* else branch can re-seed it while the controller is disengaged. */
459+
static float crossTrackErrorRate;
460+
static timeUs_t previousCrossTrackErrorUpdateTime;
461+
static float previousCrossTrackError = 0.0f;
462+
static pt1Filter_t fwCrossTrackErrorRateFilterState;
463+
457464
/* Calculate cross track error */
458465
posControl.wpDistance = calculateDistanceToDestination(&posControl.activeWaypoint.pos);
459466

@@ -466,11 +473,6 @@ static void updatePositionHeadingController_FW(timeUs_t currentTimeUs, timeDelta
466473

467474
/* If waypoint tracking enabled force craft toward and closely track along waypoint course line */
468475
if (navConfig()->fw.wp_tracking_accuracy && !needToCalculateCircularLoiter) {
469-
static float crossTrackErrorRate;
470-
static timeUs_t previousCrossTrackErrorUpdateTime;
471-
static float previousCrossTrackError = 0.0f;
472-
static pt1Filter_t fwCrossTrackErrorRateFilterState;
473-
474476
if ((currentTimeUs - previousCrossTrackErrorUpdateTime) >= HZ2US(20) && fabsf(previousCrossTrackError - navCrossTrackError) > 10.0f) {
475477
const float crossTrackErrorDtSec = US2S(currentTimeUs - previousCrossTrackErrorUpdateTime);
476478
if (fabsf(previousCrossTrackError - navCrossTrackError) < 500.0f) {
@@ -497,6 +499,13 @@ static void updatePositionHeadingController_FW(timeUs_t currentTimeUs, timeDelta
497499
adjustmentFactor = constrainf(adjustmentFactor, -limit, limit);
498500
virtualTargetBearing = wrap_36000(posControl.activeWaypoint.bearing - adjustmentFactor);
499501
}
502+
} else {
503+
/* Keep state synced to the current error while not steering, so the
504+
* controller re-engages cleanly on the next leg (no stale-data kick). */
505+
previousCrossTrackError = navCrossTrackError;
506+
previousCrossTrackErrorUpdateTime = currentTimeUs;
507+
crossTrackErrorRate = 0.0f;
508+
pt1FilterReset(&fwCrossTrackErrorRateFilterState, 0.0f);
500509
}
501510
}
502511
/*

src/main/rx/fport.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -149,8 +149,6 @@ static serialPort_t *fportPort;
149149

150150
static void reportFrameError(uint8_t errorReason) {
151151
UNUSED(errorReason);
152-
static volatile uint16_t frameErrors = 0;
153-
frameErrors++;
154152
}
155153

156154
// Receive ISR callback

src/main/target/AEDROXH7/target.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ timerHardware_t timerHardware[] = {
4242
DEF_TIM(TIM1, CH3, PE13, TIM_USE_OUTPUT_AUTO, 0, 6), // M7
4343
DEF_TIM(TIM1, CH4, PE14, TIM_USE_OUTPUT_AUTO, 0, 7), // M8
4444

45-
// LED strip: TIM2_CH1 on PA5 (AF1) — separate timer from motors
46-
DEF_TIM(TIM2, CH1, PA5, TIM_USE_LED, 0, 0), // LED strip
45+
// LED strip: TIM2_CH1 on PA5 (AF1) — dmavar=8 selects DMA2 S0, clear of motor streams 0-7
46+
DEF_TIM(TIM2, CH1, PA5, TIM_USE_LED, 0, 8), // LED strip
4747

4848
// Beeper PWM: TIM3_CH2 on PA7 (AF2)
4949
DEF_TIM(TIM3, CH2, PA7, TIM_USE_BEEPER, 0, 0), // Beeper

src/main/target/SITL/sim/xplane.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ typedef enum
169169
DREF_XITL_BATTERY_CURRENT,
170170
DREF_XITL_RSSI,
171171
DREF_XITL_FAILSAFE,
172-
172+
173173
DREF_LAST
174174
} dref_t;
175175

@@ -560,8 +560,8 @@ static void exchangeDataWithXPlane(void)
560560
}
561561

562562
gpsFakeSet(
563-
fixType,
564-
numSats,
563+
fixType,
564+
numSats,
565565
(int32_t)roundf(lattitude * 10000000),
566566
(int32_t)roundf(longitude * 10000000),
567567
(int32_t)roundf(elevation * 100),
@@ -687,7 +687,7 @@ static void* listenWorker(void* arg)
687687
// calibration of the accelerometer
688688
ENABLE_STATE(ACCELEROMETER_CALIBRATED);
689689
connectionState = CONNECTED;
690-
690+
691691
break;
692692
}
693693
case CONNECTED:

src/main/target/TBS_LUCID_H7/target.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,10 @@
3434

3535
BUSDEV_REGISTER_SPI_TAG(busdev_gyro1_mpu6000, DEVHW_MPU6000, GYRO1_SPI_BUS, GYRO1_CS_PIN, NONE, 0, DEVFLAGS_NONE, IMU_1_MPU6000_ALIGN);
3636
BUSDEV_REGISTER_SPI_TAG(busdev_gyro1_icm42688, DEVHW_ICM42605, GYRO1_SPI_BUS, GYRO1_CS_PIN, NONE, 0, DEVFLAGS_NONE, IMU_1_ICM42605_ALIGN);
37+
BUSDEV_REGISTER_SPI_TAG(busdev_gyro1_icm45686, DEVHW_ICM45686, GYRO1_SPI_BUS, GYRO1_CS_PIN, NONE, 0, DEVFLAGS_NONE, IMU_1_ICM42605_ALIGN);
3738
BUSDEV_REGISTER_SPI_TAG(busdev_gyro2_mpu6000, DEVHW_MPU6000, GYRO2_SPI_BUS, GYRO2_CS_PIN, NONE, 1, DEVFLAGS_NONE, IMU_2_MPU6000_ALIGN);
3839
BUSDEV_REGISTER_SPI_TAG(busdev_gyro2_icm42688, DEVHW_ICM42605, GYRO2_SPI_BUS, GYRO2_CS_PIN, NONE, 1, DEVFLAGS_NONE, IMU_2_ICM42605_ALIGN);
40+
BUSDEV_REGISTER_SPI_TAG(busdev_gyro2_icm45686, DEVHW_ICM45686, GYRO2_SPI_BUS, GYRO2_CS_PIN, NONE, 1, DEVFLAGS_NONE, IMU_2_ICM42605_ALIGN);
3941

4042
timerHardware_t timerHardware[] = {
4143
DEF_TIM(TIM3, CH3, PB0, TIM_USE_OUTPUT_AUTO, 0, 0), // S1

src/main/target/TBS_LUCID_H7/target.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -105,6 +105,7 @@
105105
#define IMU_2_MPU6000_ALIGN CW0_DEG_FLIP
106106

107107
#define USE_IMU_ICM42605
108+
#define USE_IMU_ICM45686
108109
#define IMU_1_ICM42605_ALIGN CW90_DEG_FLIP
109110
#define IMU_2_ICM42605_ALIGN CW0_DEG_FLIP
110111

@@ -186,4 +187,4 @@
186187

187188
#define DEFAULT_RX_TYPE RX_TYPE_SERIAL
188189
#define SERIALRX_PROVIDER SERIALRX_CRSF
189-
#define SERIALRX_UART SERIAL_PORT_USART6
190+
#define SERIALRX_UART SERIAL_PORT_USART6

0 commit comments

Comments
 (0)