Conversation
7ea4b6d to
300b29e
Compare
- Replace MemoryGuard RAII (malloc/free) with persistent member vectors in Maps class. - Add pre-allocation logic in initMap to reserve space for 2048 points, reducing heap fragmentation. - Refactor renderNavLineString, renderNavPolygon and fillPolygonGeneral to use persistent buffers. - Remove legacy Unified Memory Pool system and associated orphan code. - Optimize performance by prioritizing fast SRAM for hot projection data while maintaining PSRAM compatibility.
- Add intersection check between feature bounding box and viewport in renderNavViewport. - Calculate feature bounds on-the-fly using cheap integer comparisons before performing expensive projection math. - Skip rendering of off-screen features to reduce CPU load and improve frame rates.
- Set CORE_DEBUG_LEVEL to 0 in platformio.ini to disable internal ESP-IDF logging. - Add NDEBUG flag to strip assertions from the production binary. - Comment out runtime esp_log_level_set calls in setup() to allow the compiler to remove logging code. - Reduce binary size and execution latency by eliminating blocking serial log operations.
- Fix potential null pointer dereference in cli.cpp by validating partition pointer before access. - Initialize all member variables in global constructors (Battery, GPS, BME, Compass, KalmanFilter) to prevent RAM garbage issues. - Remove unused orphan files: InternalAllocator.hpp and the legacy psram_allocator.hpp. - Correct inverted Doxygen comments for tftOn (Wake up) and tftOff (Sleep) power modes in tft.cpp.
- Replace hardcoded 3x3 (9 tiles) logic with dynamic `tilesGrid` constant. - Fix white gaps on Lilygo T4-S3 (452x600) by enabling full 4x4 (1024x1024) tile rendering. - Preserve spiral loading optimization for ICENAV_BOARD (3x3 grid) to maintain performance. - Synchronize `generateMap`, `mapRenderTask`, and `renderNavViewport` with hardware-specific grid settings.
- Redesign rendering flow to use a screen-sized display buffer instead of a full-grid buffer. - Achieve PSRAM savings - Implement internal cropping and rotation logic in `displayMap` using LovyanGFX pivots and offsets. - Simplify GUI integration by fixing `mapCanvas` at (0,0), reducing memory bus traffic and improving LVGL composition. - Dynamize `mapSprite` creation based on actual screen resolution for universal compatibility.
- Enable real-time viewport updates during manual drag by triggering `displayMap` in each GUI cycle. - Decouple map movement from LVGL object offsets; `mapCanvas` position is now static at (0,0). - Eliminate snapback behavior and improve overall scrolling fluidness.
New vector map render engine based on optimized vector map generator
- Implement hardware SIMD acceleration (ASM) for ESP32-S3 targets.
- Optimize memory alignment to 64 bytes (S3 Cache Line) for DMA-friendly buffers.
- Implement dynamic memory pool: 128KB in PSRAM for S3, 48KB in SRAM for others.
- Increase layer composition buffer to 128KB to reduce draw call slicing.
- Stabilize UI refresh rate to 30 FPS (33ms) to reduce CPU and memory bus overhead.
- Fix checkbox/switch state logic by using explicit LV_STATE_CHECKED flags.
- Optimize SATTRACK screen using "Dirty Flags" for SNR, DOP, and position changes (CPU 50% -> 10%).
- Implement smart map redrawing:
- Added 1-degree deadband for heading updates to prevent noise-triggered redraws.
- Optimized displayMap calls based on real offset changes during scroll and standby.
- Reduced idle map CPU usage to ~10-15%.
- Enabled LVGL 9.5.0 unified cache (32KB in PSRAM) to optimize font glyph and icon rendering speed.
- Created `guiTask` on Core 1 with high priority (Prio 3) to handle `lv_timer_handler()` independently from the main loop.
- Optimized `Storage::read()` to use direct `fread()` when the destination buffer is in internal SRAM (DMA capable), avoiding redundant `memcpy`. - Configured VFS mount with `allocation_unit_size = 0` for automatic sector size detection. - Ensured 64-byte alignment for the internal DMA buffer to maximize SPI transfer efficiency on ESP32-S3.
- Ported bitwise Hilbert curve math (xyToHilbert) to NavReader for efficient 2D-to-1D spatial mapping. - Transitioned from the legacy YTable structure to a flat Hilbert-indexed global binary search. - Achieved ~30% faster SD card access times and significantly smoother map scrolling fluidity. - Added support for the updated NPK2 header and neutral NAV1 tile headers (allowing binary deduplication). - Verified performance gains via granular telemetry and performed a complete cleanup of timing variables and logs. - Optimized map engine for the new v0.5.0 Pure Hilbert map ecosystem.
Implement Pure Hilbert lookup engine and support v0.5.0 maps
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.
Changelog
This PR merges significant performance improvements and stability fixes across the IceNav-v3 system, focusing on rendering, navigation, memory, and UI responsiveness.
⚡ CORE OPTIMIZATIONS & RENDERING ENGINE
transformations.
🗺 MAP ENGINE & RENDERING
~15% smaller map files), optimized with VarInt, ZigZag, and Delta encoding with neutralized headers for fast culling.
isDOPChanged,hasLocationChange,satInView) to reduce CPU usage from 50% to ~10% in idle states.⚡ NAVIGATION & ROUTING
roots.
🛡 CORE OPTIMIZATION & STABILITY
loading.
🚀 SYSTEM & PERFORMANCE
🎨 USER INTERFACE (UI)
🧹 CODE QUALITY & MAINTENANCE
🛠 STABILITY & BUG FIXES