Skip to content

v1.15.4 - Unified Module Initialization Flag Naming (2025-12-12)

What Changed?

This release unifies the initialization flag naming convention across all sensor modules (BME280, RTC, and GNSS) to improve code maintainability and discoverability. All modules now use the consistent pattern g_{module}_initialized, making the codebase easier to navigate and reducing cognitive load when working with sensor initialization states.


What's New

Refactoring: Unified Module Initialization Flags

What it does: This refactoring consolidates the naming of initialization flags across all sensor modules. Previously, each module used different naming patterns:

  • BME280: bme280_initialized (no g_ prefix)
  • RTC: g_time_initialized (semantic name, not module name)
  • GNSS: No flag (state tracked implicitly in g_gnss_data.state)

Now all modules use the unified pattern: g_{module}_initialized

Why this matters:

  • Consistency: Global flag naming follows the same pattern project-wide
  • Discoverability: Developers can easily find all initialization flags with pattern search
  • Maintainability: New module additions follow the established convention automatically

Module-specific APIs preserved: The public APIs remain unchanged for backward compatibility and semantic clarity:

bool bme280_is_initialized();   // "is initialized?" (BME280)
bool rtc_is_set();              // "is set?" (RTC - semantic, not structural)
gnss_state_t gnss_get_state();  // Returns full state machine state (GNSS)

Installation

Quick Start

# Get the release
git checkout v1.15.4

# Build
task build

# Upload
task upload

# Check it works
task monitor

What's Different from the Last Version?

🔧 Changed

  • BME280 module: Renamed bme280_initializedg_bme280_initialized for consistency
  • RTC module: Renamed g_time_initializedg_rtc_initialized for consistency
  • GNSS module: Added g_gnss_initialized flag for unified naming pattern
  • Internal implementation: All modules now follow g_{module}_initialized pattern
  • Public API: No changes - all module-specific functions work exactly as before

Is It Safe to Upgrade?

Backward Compatible: Yes ✅

  • This is a pure refactoring with no functional changes
  • All public APIs remain unchanged and work exactly as before
  • No user-facing behavior changes
  • All existing deployments will continue to work without modification
  • Safe to upgrade at any time

Tests Passed

  • ✅ Builds without errors (all compilation profiles)
  • ✅ pre-commit hooks pass
  • ✅ All 3 modules compile with unified flag naming
  • ✅ No functional behavior changes verified

Release Details

  • Date: 2025-12-12
  • Version: v1.15.4
  • Files Changed: 3
  • src/bme280_sensor.cpp
  • src/rtc_manager.cpp
  • src/gnss_manager.cpp
  • Commit: refactor(module-init): unify initialization flag naming across sensors

Next Steps

Future improvements building on this foundation:

  • Consider adding additional sensor modules with consistent initialization pattern
  • Evaluate expanding flag pattern to other module initialization
  • Monitor code coverage and maintainability improvements from unified naming