Skip to content

Dev portable 1#3

Merged
raffmont merged 32 commits into
raffmont:mainfrom
riscv-prg32:dev-portable-1
Jun 11, 2026
Merged

Dev portable 1#3
raffmont merged 32 commits into
raffmont:mainfrom
riscv-prg32:dev-portable-1

Conversation

@raffmont

Copy link
Copy Markdown
Owner

No description provided.

raffmont and others added 30 commits June 8, 2026 12:00
When PRG32_PIN_BUZZER is not defined (< 0, e.g., in QEMU/desktop targets),
calls to prg32_audio_tone() and prg32_audio_sample_u8() would previously
return instantly. This not only prevented audio playback but completely
bypassed vTaskDelay(), causing severe timing issues in game loops (such
as infinite firing speed in wing_commander).
This commit resolves both issues by routing tones to the I2S synth engine:
- A new `hz_to_midi_note()` helper converts requested frequencies to the
  closest matching MIDI note.
- The fallback exactly mimics the setup menu's audio test tune, registering
  the `setup_audio_wave` sine wave to sample ID 63 and instrument ID 31.
- Tones are then played via `prg32_audio_note_on` and `prg32_audio_note_off`.
- `vTaskDelay()` is now strictly enforced for both tone and sample playback,
  guaranteeing that games maintain correct timing even if audio is disabled.
Additionally, a basic square wave (`builtin_beep_wave`) was included under
an `#if 0` block as an optional reference for a traditional "buzzer" sound.
fix: restored screen working configurations
fix: diffs with old working repo
fix: set PRG32_PIN_RGB_LED to 8
Aligned entire repository to new QEMU flash image 'qemu_flash.bin'
… to BSSID

This commit resolves an issue where the ESP32-C6 was caught in a loop of
connection timeouts (Reason 201 NO AP FOUND) on borderline weak signals
because it was scanning blindly too fast and failing to lock onto the AP.
Changes included:
- Increased active scan dwell time (min=100ms, max=300ms) in the initial
  `scan_networks` pass to reliably discover borderline networks.
- Removed the strict `selected_ap_locked` condition in `prg32_wifi_start_mode`
  so the connection sequence correctly utilizes the target channel and
  BSSID explicitly discovered during the boot scan.
- Explicitly set `WIFI_ALL_CHANNEL_SCAN` and `WIFI_CONNECT_AP_BY_SIGNAL`
  in the connection configuration to ensure maximum reliability.
These changes allow the framework to isolate the router's beacons out of
the noise floor, skipping blind channel hopping and connecting instantly.
This commit ensures the firmware falls back to a default, known Cartridge
Store server address if no mDNS service or saved URL is available.
Changes included:
- Added `PRG32_STORE_SERVER_URL` macro definition in `prg32_config.h`.
- Initialized NVS explicitly in `prg32_init()` to allow writing the default
  Store URL into the flash storage immediately upon boot.
- Added a fallback in `prg32_setup_store.c` to gracefully use the default
  URL if the user actively clears the saved NVS configuration and proceeds
  straight to the browse menu.
 RAM Optimization, Cartridge Store and Wi-Fi Stability
- Wraps WiFi credentials in `prg32_config.h` with `#ifndef` and conditionally includes `prg32_env.h`
- Adds `prg32_env.h` to `.gitignore` to prevent committing secrets
- Provides `prg32_env.h.example` as a template for local overrides
feat: add local environment file support for WiFi credentials
@raffmont raffmont merged commit c5fcf34 into raffmont:main Jun 11, 2026
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants