Skip to content

v1.4.2 - Hardware Configuration Centralization (2025-11-17)

Overview

A minor release implementing centralized hardware configuration management. This release consolidates all hardware pin definitions and configuration constants from five distributed module headers into a single include/config.h file, improving code maintainability and enabling build-time hardware configuration override.

Implementation: Feature 001-centralize-config | Branch: 001-centralize-config | Commit: d4306cb

What's New

🔧 Hardware Configuration Centralization

Consolidated Configuration File

New include/config.h centralizes all hardware constants:

Before(v1.4.1): Configuration scattered across 5 module headers

// cosmic_detector.h
#define DETECT_PIN1 12
#define LED_PIN1 14

// spi_control.h
#define SPI_DEFAULT_CLOCK 100000

// adc_sensor.h
#define ADC_DEFAULT_PIN 32
// ... plus additional defines in serial_communication.h, bme280_sensor.h

After(v1.4.2): Single source of truth

// include/config.h - comprehensive hardware configuration
#define DETECT_PIN1 12        // Detection channels
#define LED_PIN1 14           // LED feedback
#define SPI_DAC_CS_PIN1 5     // SPI DAC control
#define ADC_INPUT_PIN 32      // ADC input
#define SERIAL_BAUD_RATE 115200  // Serial communication
// ... all 15+ constants with build-time override support via #ifndef

Build-Time Configuration Override

All constants support compile-time override without source code changes:

# Override ADC channel jumper position(ch1, ch2, or ch3)
PLATFORMIO_BUILD_FLAGS="-DADC_DEPEND_CHANNEL=2" pio run -t upload

# Override multiple values
PLATFORMIO_BUILD_FLAGS="-DDETECT_PIN1=25 -DLED_PIN1=26" pio run -t upload

Benefits:

  • Hardware Variant Support: Test different pin configurations without code modifications
  • Build-Time Flexibility: Configure at compile time via PlatformIO or command line
  • Zero Runtime Overhead: All configuration resolved at preprocessing stage
  • Backward Compatibility: Old macro names still work via mapping

Updated Modules

Modified headers(5 files):

  • include/cosmic_detector.h - includes config.h, removed duplicate definitions
  • include/spi_control.h - includes config.h, backward-compat aliases(DAC_CS_PIN*)
  • include/adc_sensor.h - includes config.h, backward-compat alias(ADC_DEFAULT_PIN)
  • include/serial_communication.h - includes config.h
  • include/bme280_sensor.h - includes config.h

Modified implementations(2 files):

  • src/cosmic_detector.cpp - GPIO_NUM_12/19/27 → (gpio_num_t)DETECT_PIN1/2/3
  • src/main.cpp - local variable ADC_IN → ADC_INPUT_PIN macro

Documentation Improvements

Refactoring Roadmap Cleanup:

  • Removed detailed implementation steps from config.h section(312 lines)
  • Consolidated section structure for clarity
  • Added status tags to planned features(⏳ 計画中)
  • Improved information density(combined metadata into single-line format)
  • Document reduced from 619 to 289 lines while preserving all critical information

Result: Cleaner roadmap focused on ongoing v1.5.0 and v2.0.0 planning

📊 Code Metrics

Metric Value Change
RAM Usage 6.9% (22,592 bytes) -
Flash Usage 22.6% (296,409 bytes) -
Build Time ~2.5 seconds -
Lines Changed 0 (firmware), -334 (docs) -
Warnings 0 -
Errors 0 -

🔧 Documentation Structure

REFACTORING_ROADMAP.md Organization

├── Project Status Analysis
│   ├── Strengths
│   ├── Areas for Improvement
│   └── Resolved in v1.4.1
├── Medium-term Goals (v1.5.0)
│   ├── 1. Configuration Management (✅ Completed)
│   ├── 2. Runtime Configuration (⏳ Planned)
│   ├── 3. Error Handling (⏳ Planned)
│   └── 4. Data Structure Unification (⏳ Planned)
├── Long-term Goals (v2.0.0+)
│   ├── Multi-board Support
│   ├── Real-time Data Visualization
│   └── ML-based Event Classification
├── Implementation Priority Matrix
└── Next Steps (v1.5.0)

Installation

Via Git Tag

git checkout v1.4.2
# or
git clone --branch v1.4.2 https://gitlab.com/osechi/kurikintons.git

Build from Source

# Build firmware
task build

# Upload to ESP32
task upload

# Monitor serial output
task monitor

Changelog

Added

  • None (documentation-only release)

Changed

  • Reorganized REFACTORING_ROADMAP.md for improved clarity
  • Consolidated section headers for consistency
  • Combined priority, estimate, and expected effect metadata
  • Streamlined project status documentation

Removed

  • Detailed implementation steps (ステップ1-6) from config.h section
  • Redundant metadata fields (Cost, Detailed Dates)
  • "設定の分散化" from improvements section (already resolved)

Fixed

  • None (cleanup release)

Documentation

  • Reduced REFACTORING_ROADMAP.md from 619 to 289 lines
  • Improved readability through structural reorganization
  • Enhanced maintenance by removing completed implementation details

Known Issues

None. This is a stable patch release.

Breaking Changes

None. This release is fully backward compatible with v1.4.1.

Testing

All changes have been verified:

  • ✅ Firmware unchanged (no new build required)
  • ✅ Documentation structure verified
  • ✅ Navigation references updated
  • ✅ No regressions introduced

Supported Hardware

  • Microcontroller: ESP32-WROOM-32E
  • SPI DAC: 3-channel digital potentiometer control
  • Sensors: BME280 (temperature, humidity, pressure)
  • ADC: 12-bit converter with configurable channel jumper
  • I2C: Standard 100kHz I2C bus
  • UART: 115200 baud serial communication

Compatibility

Dependency Version Status
PlatformIO >=6.1.18
Arduino ESP32 3.20017
Adafruit BME280 2.3.0
Adafruit BusIO 1.17.4

Upgrading from v1.4.1

This is a documentation-only patch release:

  1. No Firmware Changes Required: v1.4.1 firmware continues to work
  2. Documentation Update: Pull latest documentation for improved development guidance
  3. Optional Upgrade: Only recommended if working on v1.5.0 features
git pull origin main
git checkout v1.4.2
  • REFACTORING_ROADMAP.md - Long-term development plan
  • docs/hardware.md - General hardware information
  • docs/api.md - Module APIs and data structures
  • docs/getting-started.md - Setup and usage guide

Contributors

  • Shota Takahashi (documentation refactoring)

License

MIT License - See LICENSE file for details

Release Information

  • Date: November 17, 2025
  • Version: 1.4.2
  • Git Tag: v1.4.2
  • Commits: 2 (69019dc, b67ac3b)
  • Files Changed: 1 modified (REFACTORING_ROADMAP.md), 1 auto-generated (CHANGELOG.md)