Add an explicit flag to the radio configuration for the Waveshare HAT…#2
Conversation
…, instead of assuming only Waveshare uses CS on GPIO21
There was a problem hiding this comment.
Pull Request Overview
This PR adds an explicit is_waveshare boolean parameter to the SX1262 radio configuration to properly identify Waveshare HAT modules instead of relying on the CS pin being on GPIO 21. This change prevents incorrect assumptions about the hardware type when other radio modules (like the MeshAdv Pi Hat with Ebyte E22) also use GPIO 21 for CS.
Key changes:
- Added
is_waveshareparameter to the SX1262Radio constructor - Replaced GPIO pin-based detection logic with explicit flag checking
- Updated example configuration to use the new flag for Waveshare HATs
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/pymc_core/hardware/sx1262_wrapper.py | Added is_waveshare parameter and replaced pin-based detection with explicit flag |
| examples/common.py | Updated Waveshare configuration to use the new is_waveshare flag |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
rightup
left a comment
There was a problem hiding this comment.
Valid point, my original idea was to make it as hardware agnostic as possible but the reality is these devices need slightly different setups etc.
…med - TODO #1 and #2 - Introduced `_pending_ack_crcs` to track pending ACK CRCs in `CompanionBase`, enhancing the handling of confirmed sends. - Refactored `_track_pending_ack` and `_apply_ack` methods to utilize the new `_try_confirm_send` method for improved clarity and functionality. - Updated `CompanionRadio` to clear pending ACKs upon key import and added an ACK received listener to the dispatcher for better integration. - Enhanced the dispatcher to support asynchronous ACK handling, ensuring efficient processing of received ACKs.
feat(companion): implement multi-byte path hash encoding and management
It shouldn't assume that just because CS is on GPIO 21, the radio module is a Waveshare HAT. For example, the MeshAdv Pi Hat uses the Ebyte E22 radio module and puts CS on 21.