Fix for T114#38
Open
nilu96 wants to merge 11 commits into
Open
Conversation
Because the base board nrf52840_dk_adafruit only defines one SPI, I added a variant that defines all pins according to pin map of hardware rev 2.1 and specifies SPI_INTERFACES_COUNT (2)
memory allocation at startup led to crash at boot
Problem: If a packet is added to queue for TX early after startup before the first call of update_noise_floor(). Then, medium_free() calls update_modem_status() which updates last_status_update. This leads to check_modem_status() always returning without any action (especially without updating noise floor). Because medium_free() is called periodically (because of stuck TX queue), check_modem_status() will never call update_noise_floor(). Because there is no valid noise floor, medium_free() will always return false --> stuck TX queue. Easy fix: never update modem status without updating noise floor as well. This bug only appears in TNC mode, when interference avoidance is active.
Unfortunately, I did not find a way to set airtime limits at runtime with rnodeconf, when in TNC mode. I added the option to add build flags to set airtime limits at compile-time. Airtime limits are essential for respecting duty cycles on most EU frequency bands.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixed errors for Heltec T114:
This pull request introduces a new board variant for the Heltec T114 (nRF52840) and refactors pin assignments throughout the codebase to use named constants from the new variant. This defines missing SPI1, improves maintainability and clarity by centralizing pin definitions and making the code less error-prone. Additionally, the pull request updates build configuration for the new variant, adjusts memory allocation settings, and makes minor logic improvements.
Board Variant Addition and Pin Refactoring:
variants/heltec_t114/variant.handvariant.cpp, defining all pin mappings, peripherals, and board-specific constants. [1] [2]Boards.hto use the new named constants (e.g.,PIN_BAT_ADC_CTL,PIN_SPI_MOSI,PIN_TFT_CS, etc.) instead of hardcoded numbers, avoiding duplicate definitions and improving maintainability. [1] [2]Build System and Configuration Updates:
platformio.inito use the newheltec_t114variant, set the variants directory, and adjusted build flags for memory allocation (e.g., reducedRNS_HEAP_POOL_BUFFER_SIZEand addedRNS_CONTAINER_ALLOCATOR). [1] [2]Logic and Feature Improvements:
setup()with#ifdef HAS_RNSto avoid errors if the RNS library is not present.HAS_BLE) and the MCU is nRF52, preventing unnecessary BLE operations.