-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathConfig.h
More file actions
74 lines (61 loc) · 3.73 KB
/
Copy pathConfig.h
File metadata and controls
74 lines (61 loc) · 3.73 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#ifndef Config_h
#define Config_h
// ============================================================
// MONEO V2 — Config.h
// ============================================================
// ─── PIN CONFIGURATION ───────────────────────────────────────
const int TOUCH_PIN = 1;
const int SD_CARD_PIN = 21;
const int I2S_BCLK_PIN = 42;
const int I2S_LRCLK_PIN = 41;
// ─── STATUS LED ──────────────────────────────────────────────
// The XIAO ESP32-S3 user LED is active-LOW: driving the pin LOW lights it,
// HIGH turns it off. Use these names so the polarity is never guessed again.
#define LED_ON LOW
#define LED_OFF HIGH
// ─── TOUCH SENSOR ────────────────────────────────────────────
const int TOUCH_THRESHOLD = 50000;
const unsigned long DEBOUNCE_DELAY = 1000;
// ─── STARTUP ─────────────────────────────────────────────────
const unsigned long SERIAL_WAIT_MS = 100; // max wait for USB serial at boot
// ─── AUDIO SETTINGS ──────────────────────────────────────────
const int SAMPLE_RATE = 16000;
const int BITS_PER_SAMPLE = 8;
const int NUM_CHANNELS = 1;
const int I2S_BUFFER_SIZE = 512;
// ─── RECORDING SETTINGS ──────────────────────────────────────
// Each PSRAM buffer holds exactly SEGMENT_DURATION_S of audio. When full, it
// is handed to the writer while capture continues into the other (ping-pong).
const unsigned int SEGMENT_DURATION_S = 10;
const size_t PSRAM_BUFFER_SIZE = (size_t)SAMPLE_RATE
* NUM_CHANNELS
* (BITS_PER_SAMPLE / 8)
* SEGMENT_DURATION_S;
// ─── TIME / NTP ──────────────────────────────────────────────
// Clock is synced once at boot (after WiFi), then WiFi is disconnected.
// The ESP32's RTC tracks time from that point; no repeat NTP requests needed.
#define NTP_SERVER "pool.ntp.org"
const long GMT_OFFSET_SEC = 0; // UTC; adjust for local timezone
const int DAYLIGHT_OFFSET_SEC = 0;
// ─── WIFI — add as many networks as needed ───────────────────
// Format: { "SSID", "PASSWORD" }
#define WIFI_NETWORK_COUNT 2
extern const char* WIFI_NETWORKS[WIFI_NETWORK_COUNT][2];
const unsigned long WIFI_CONNECT_TIMEOUT_MS = 10000;
// ─── AI API — auto-detected from key prefix ──────────────────
// Paste your own API key here. Provider is detected automatically:
// sk-... → OpenAI (gpt-4o-audio-preview)
// AIza... → Gemini (gemini-2.5-flash-lite)
// gsk_... → Groq
#define AI_API_KEY "YOUR_API_KEY_HERE"
// ─── FEATURE TOGGLES ─────────────────────────────────────────
#define DEBUG_LOGS_ENABLED 1
// ─── DEBUG HELPER ────────────────────────────────────────────
#if DEBUG_LOGS_ENABLED
#define DLOG(x) Serial.println(x)
#define DLOGF(...) Serial.printf(__VA_ARGS__)
#else
#define DLOG(x)
#define DLOGF(...)
#endif
#endif