Skip to content

Conversation

@hntirgeam
Copy link

@hntirgeam hntirgeam commented Dec 24, 2025

sensei-hacker and others added 30 commits October 11, 2025 20:31
…tt_sensor

New feature: SmartPort battery sensor
…ignal

ublox: include array index to set satellites with no signal as unused
Update (fixed spelling mistakes in the page) GPS_fix_estimation.md
Yeah so basically while correcting grammar i may or may not have left a few errors in by accident, anyways i fixed those, but whoever spelled magnetometer as magnethometer pls avoid making the same mistakes
This PR adds scaling to the pan servo offset. Historically it based the degree range on a typical 1000-2000 microseconds pulse width. However, many servos need to extend that pulse width to actually get the desired output from the servo. The `osdGetPanServoOffset` function will now automatically scale the degrees to the min/max range the servo is set to use.

Changes:
- Add scaling to `osdGetPanServoOffset`
- Make the docs easier to read
- Renamed the parameter, as centi-degrees was completely the wrong term. Now deca-degrees

Requires Configurator update
This is being done as part of support for NEXUSX target.
The previously introduced target ORBITH743 has already
introduced support for the Winbond w25n02k 2Gbit/256MByte
array. This commit refactors it to increase code quality.

flash_w25n01g.c is renamed to flash_w25n.c.
The driver no longer supports just w25n01g,
but two chips of the w25n family now.
More chips might be added in future targets.
The name change reflects this new larger family support.

Cleanup of some magic numbers in flash_w25n.c

Removal of w25n01g_readExtensionBytes.
It had a magic number in it and was unused.
Rather than fixing the magic number it just gets removed.

Addition of USE_FLASH_W25N02K and use of it in targets.
Keeps target definitions more accurate and independent of
flash driver implementation details.
wchnflr and others added 26 commits December 15, 2025 12:40
Add new target OMNIBUSF4V3_ICM with board ID OB4I to support ICM42605/ICM42688 gyro.
INAV has had power/current limiting since version 3.0.0 but it was
never documented in the main Battery.md documentation file. This
commit adds comprehensive documentation for the existing feature.

Added sections:
- Power and Current Limiting overview
- Why use power limiting (battery protection, safety, compliance)
- How it works (burst vs continuous limits, PI controller)
- Configuration settings table (current and power limits)
- Three practical example configurations
- Understanding burst mode with timeline example
- OSD elements for monitoring
- Calibration tips and best practices

The power limiting feature protects batteries and ESCs by smoothly
reducing throttle when current or power exceeds configured limits.
It uses a sophisticated burst reserve system that allows brief
high-power maneuvers while protecting during sustained flight.

Settings documented:
- limit_cont_current, limit_burst_current
- limit_burst_current_time, limit_burst_current_falldown_time
- limit_cont_power, limit_burst_power
- limit_burst_power_time, limit_burst_power_falldown_time
- limit_pi_p, limit_pi_i, limit_attn_filter_cutoff

This documentation helps users understand and configure a feature
that has existed for years but remained largely unknown due to lack
of user-facing documentation.
The power limiting initialization incorrectly treated burst limit of 0
as numerically less than continuous limit, and would automatically set
burst = continuous. However, 0 means 'disabled/unlimited' not 'zero
amps/watts allowed'.

This fix allows the valid configuration:
- limit_cont_current = 1000 (100A continuous limit)
- limit_burst_current = 0 (no burst limiting - unlimited bursts)

Changes:
- Only enforce burst >= continuous when burst is enabled (> 0)
- Applied to both current and power limit initialization
- Added comments explaining the 0 = disabled semantics
Changed divisor from 1000 to 100 to correctly convert from mAh to dA.

Example: 1500 mAh × 50C / 100 = 750 dA (75A) ✓
Previously: 1500 mAh × 50C / 1000 = 75 dA (7.5A) ✗

Thanks to Qodo code review for catching this.
Replace outdated branching documentation with current maintenance
branch strategy. Uses generic terminology (current/next version)
with examples so documentation remains valid across versions.

Changes:
- Document maintenance-X.x branches for backward-compatible changes
- Document maintenance-(X+1).x for breaking changes
- Update workflow examples to branch from maintenance branches
- Remove outdated release_x.y.z branch references
- Add guidance on choosing correct target branch

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
…yntax

Update all code examples in JavaScript Programming documentation to use
the fully namespaced inav.* syntax instead of destructuring.

Changes:
- Remove const { flight, override, ... } = inav; destructuring
- Replace flight.* with inav.flight.*
- Replace override.* with inav.override.*
- Replace gvar[ with inav.gvar[
- Replace rc[ with inav.rc[
- Replace waypoint.* with inav.waypoint.*
- Replace edge() with inav.events.edge()
- Replace sticky() with inav.events.sticky()
- Replace delay() with inav.events.delay()
- Replace timer() with inav.events.timer()
- Replace whenChanged() with inav.events.whenChanged()

This aligns the documentation with the transpiler changes that removed
backward compatibility for destructuring syntax. Users now access all
INAV APIs through the fully qualified inav namespace.

Files updated:
- index.md
- JAVASCRIPT_PROGRAMMING_GUIDE.md
- OPERATIONS_REFERENCE.md
- TESTING_GUIDE.md
- TIMER_WHENCHANGED_EXAMPLES.md
- TIMER_WHENCHANGED_IMPLEMENTATION.md
- api_definitions_summary.md
- api_maintenance_guide.md
- implementation_summary.md
- GENERATE_CONSTANTS_README.md
Issue: USB Mass Storage mode broken on H743 in INAV 8.0.1+ due to USB
library update v2.5.3 → v2.11.3. Windows shows 'Virtual COM Port in FS
Mode' error instead of enumerating MSC device.

Root Cause: H7 MSC initialization used VCP_Desc (CDC descriptor) then
added MSC class. New USB library interprets this as composite mode but
INAV wasn't configured for composite, causing descriptor conflicts that
Windows rejects.

Solution: Standalone MSC Mode (not composite)
- Created MSC_Desc descriptor structure for pure MSC device
- MSC mode now uses MSC descriptors (device class 0x00, PID 22314)
- Normal VCP mode unchanged (still uses VCP_Desc)
- No CDC functionality during MSC mode
- Simpler than composite mode, no API changes needed

Changes:
- src/main/vcp_hal/usbd_desc.c: Add MSC_Desc and descriptor functions
- src/main/vcp_hal/usbd_desc.h: Export MSC_Desc
- src/main/drivers/usb_msc_h7xx.c: Use MSC_Desc instead of VCP_Desc

Testing Results:
✅ USB enumeration works on Linux
✅ Device detected as 'STM32 Mass Storage in FS Mode'
✅ SCSI device created (sda)
✅ Size detected correctly (31.3 GB)
⚠️  Requires SD card inserted for storage backend to work

Benefits:
- Normal VCP operation completely unaffected
- MSC mode enumerates properly on Windows/Linux
- No composite mode complexity
- Matches F4 architecture (MSC-only mode)

References:
- Issue: iNavFlight#10800
This commit fixes two critical issues with H7 SDIO SD card access:

1. **USB MSC alignment bug**: H7 SDIO DMA requires 32-byte aligned buffers,
   but the USB MSC library's bot_data buffer is only 16-byte aligned. This
   caused all USB MSC read/write operations to fail with SD_ADDR_MISALIGNED
   errors. Fix: Use an aligned intermediate buffer for H7+SDIO in USB MSC mode.

2. **Aggressive error handling**: Any SDIO DMA failure immediately triggered
   a full card reset, causing recording gaps and reliability issues. This was
   particularly problematic when USB interrupts interfered with SDIO DMA.
   Fix: Retry operations up to 3 times with 1ms delays before resetting card.

Technical details:
- Added __attribute__((aligned(32))) buffer for H7 USB MSC SDIO operations
- Added operationRetries counter and SDCARD_MAX_OPERATION_RETRIES constant
- Both read and write paths now retry transient failures
- Retry counter reset on successful operations and card init

This should significantly improve H7 SDIO reliability for both blackbox
logging and USB mass storage mode.

Fixes iNavFlight#10800
Implements Qodo bot suggestion to prevent infinite hangs if SD card
becomes unresponsive during USB MSC operations.

Changes:
- Added 5-second timeout to all polling loops in STORAGE_Read()
- Added 5-second timeout to all polling loops in STORAGE_Write()
- Returns error (-1) to USB host if timeout occurs
- Timeout applies to both 'waiting for operation to start' and
  'waiting for operation to complete' phases

This prevents system hangs when:
- SD card becomes unresponsive
- SDIO DMA completion interrupts are blocked
- Card is removed during operation

Timeout is generous (5 seconds per block) to handle slow cards while
still providing protection against total system freeze.
…sc-standalone-mode

Fix H743 USB MSC regression and SDIO reliability issues
Apply Qodo bot suggestions to improve documentation:

1. Add "Propagating Changes Between Maintenance Branches" section
   - Explains how changes should be merged forward from current to next version
   - Prevents regressions and lost fixes in future major versions
   - Provides clear example for maintainers

2. Simplify fork update workflow
   - Replace multi-step checkout/merge/push with direct push command
   - More efficient: git push origin upstream/maintenance-9.x:maintenance-9.x
   - No local checkout needed
…anching-strategy

docs: Update Development.md with maintenance branch workflow
…iting-documentation

Power and Current Limiting fix and documentation
…ary)

Adds documentation for new INAV 9.0 JavaScript programming features:

New Features:
- PID controller output access (inav.pid[0-3].output)
- Flight mode detection (inav.flight.mode.poshold, .rth, etc.)
- Let/const variables for compile-time named expressions
- Ternary operator for conditional value assignment

Changes:
- Add Variables section with let/const and ternary operator docs
- Update Available Objects to list PID and flight modes
- Add Flight Mode Detection subsection with examples
- Add PID Controller Outputs subsection with examples
- Update index.md feature list
- Update Tips section for consistency

All examples use namespaced syntax (inav.flight.*, inav.override.*, etc.)
for clarity and explicitness.
…t-programming-updates

Docs: Update JavaScript programming documentation
…conditions-enabled-mask

Add guard for logic conditions bitmask if max exceeds 64
Add airspeed TPA support (backport from iNavFlight#11042)  via merge from master
Add target OMNIBUSF4V3_ICM to OMNIBUSF4 and mark as SKIP_RELEASES
This wing target is performance-constrained and wing aircraft typically
don't benefit from dynamic notch filtering, which is primarily designed
for detecting and filtering multirotor motor noise.

Disabling the dynamic notch filter by default reduces CPU overhead
and improves task scheduling margin on this board.
Adds cygwin1.dll to the Windows SITL build artifact so users
don't need Cygwin installed to run the SITL executable.

Cherry-picked from PR iNavFlight#11133.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
…disable-dynamic-notch

BLUEBERRYF435WING: Disable dynamic notch filter by default
…-dll

Include cygwin1.dll in Windows SITL artifact
…128ha-flash-support

Add support for Puya PY25Q128HA flash chip
const uint32_t drawAllIntervalUs = (hz > 0) ? (1000000 / hz) : 0;


if (drawAllIntervalUs == 0 || (currentTimeUs - lastDrawAllTimeUs) >= drawAllIntervalUs) {
Copy link

@vmzhivetyev vmzhivetyev Dec 24, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's a nitpick obv but I would factor this out into a variable(s) with some meaningful name

https://refactoring.guru/extract-variable

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

smth like this

const bool forceDraw = (drawAllIntervalUs == 0);
const bool intervalExceeded = (currentTimeUs - lastDrawAllTimeUs) >= drawAllIntervalUs;

if (forceDraw || intervalExceeded) {

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.