Skip to content

Sh dev#11

Open
shota3527 wants to merge 64 commits into
masterfrom
sh_dev
Open

Sh dev#11
shota3527 wants to merge 64 commits into
masterfrom
sh_dev

Conversation

@shota3527

Copy link
Copy Markdown
Owner

No description provided.

shota3527 and others added 29 commits October 29, 2023 17:22
…STATUS-frame

Put getConfigMixerProfile as the last byte in message
…ty_fix

Multirotor arming safety course hold/cruise mode fix
This was requested by flywoo support.

Also add other baros to match their internal target.
…baro-flywoof745

Add DPS310 and SPL06 to FLYWOOF745 target (and other baros)
Multiple RTH and early exit from RTH fixed. Message would only be displayed for first RTH.
…tput-fixes

Various PWM output changes. Mainly to get rid of potential conflicts
sensei-hacker pushed a commit that referenced this pull request May 30, 2026
…nd error recovery (#11)

* docs(dronecan): Finalize DroneCAN integration with tests, examples, and error recovery documentation

This commit completes the high-priority code review recommendations for the libcanard DroneCAN integration (PR iNavFlight#11313):

## Phase 1: Enhanced Unit Tests
- Added 9 new error case tests to dronecan_messages_unittest.cc (23 total tests)
- Coverage areas:
  - Truncated/malformed buffer handling (GNSSFix2_TruncatedBuffer tests all truncation points)
  - Empty payload handling (GNSSFix2_ZeroPayload)
  - Boundary value testing (battery SOC 0%-255%, uptime max values, satellite counts)
  - Signed value handling (negative currents, extreme temperatures -40°C to 125°C)
  - Variable-length array edge cases (covariance arrays with len=0)
  - State consistency (10 consecutive encode/decode cycles with buffer reuse)
- Estimated coverage improvement: >90% for decoder critical paths

## Phase 2: Comprehensive Configuration Examples
- Added 7 practical configuration examples to DroneCAN.md:
  1. GPS-only setup (DroneCAN GPS without battery monitoring)
  2. Battery monitoring-only (without GPS)
  3. Combined GPS + Battery on single CAN bus
  4. Multi-node DroneCAN network setup (3+ devices)
  5. SITL simulation configuration
  6. Hardware-specific: MATEKH743 (FDCAN, 1000 KBPS)
  7. Hardware-specific: MATEKF765SE (bxCAN, 500/1000 KBPS)
- Includes CAN bus topology diagrams, node ID assignment guidance, configuration verification commands

## Phase 3: Error Recovery Documentation
- New section in DroneCAN-Driver.md: "Error Recovery and Graceful Disable"
- Documented safe initialization sequence (interrupt enable moved to end of init)
- Explains graceful disable behavior (interrupt → TX queue cleanup → hardware stop)
- Documents automatic bus-off recovery and incomplete initialization safety
- Highlights the critical interrupt race condition fix that prevents crashes on unconfigured hardware

## Benefits
- Future developers have clear guidance on common DroneCAN configurations
- Error case tests provide confidence in decoder robustness
- Documentation of the graceful disable fix ensures maintainers understand the safety architecture
- All examples are backward-compatible and non-breaking

Related to PR iNavFlight#11313: DroneCAN/libcanard implementation

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>

* fix(tests): Correct DroneCAN unit test boundary values

The tests used values exceeding DSDL field sizes:
- state_of_charge_pct: 7-bit field (max 127), test used 255
- sats_used: 6-bit field (max 63), test used 255

Fixed by using valid boundary values that match the DSDL spec.

---------

Co-authored-by: Claude Haiku 4.5 <noreply@anthropic.com>
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.

6 participants