Working on SD and netowrking

This commit is contained in:
2026-08-09 20:34:44 -06:00
parent 0014e8697f
commit e06b429db9
4 changed files with 730 additions and 0 deletions
+31
View File
@@ -112,3 +112,34 @@
// logging exists, throughput should be derived from actual logging writes and
// this benchmark disabled by setting the interval to 0 (measure once at boot).
#define STORAGE_SPEED_MEASURE_INTERVAL_MS 0
// --- Audio logging ----------------------------------------------------------
//
// The DataLogger (docs/audio_logging.md) writes one multichannel WAV file
// per rotation. The Node collection task feeds it interleaved 40-channel PCM
// as chunks; the logger appends them and only the consumer touches the card.
//
// Stream rate: 40 ch x 48 kHz x 2 B = 3,840,000 B/s. The 128 KB pool holds
// ~34 ms of audio, so collection rounds must stay <= ~25 ms (<= 96 KB) or
// the pool must grow (see docs/audio_logging.md section 7).
// WAV parameters (must match what the Nodes produce).
#define STORAGE_AUDIO_SAMPLE_RATE_HZ 48000
#define STORAGE_AUDIO_CHANNELS 40 // 10 nodes x 4 mics
#define STORAGE_AUDIO_BITS 16
// Chunk pool: STORAGE_LOG_POOL_SIZE chunks of STORAGE_LOG_CHUNK_SIZE bytes,
// allocated with MALLOC_CAP_DMA. 128 KB total.
#define STORAGE_LOG_CHUNK_SIZE (16 * 1024)
#define STORAGE_LOG_POOL_SIZE 8
// Recording directory and rotation policy.
#define STORAGE_LOG_DIR STORAGE_MOUNT_POINT "/audio"
#define STORAGE_LOG_ROTATE_BYTES (1024LL * 1024 * 1024) // 1 GiB / file
#define STORAGE_LOG_FLUSH_BYTES (16LL * 1024 * 1024) // f_sync cadence
// Overflow warning LED: lights while chunks are being dropped because the SD
// card cannot keep up. GPIO 4 is unused by the SD card lines (SPI 5/18/19/23,
// SDMMC 6-11). Change both values if a different LED is wired.
#define STORAGE_WARN_LED_GPIO 4
#define STORAGE_WARN_LED_ACTIVE_HIGH true