Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 23 additions & 5 deletions src/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# BOARD SELECTION - Change this to match your ESP32 board
# ============================================================================
# Supported boards: "ESP32-C6", "ESP32-C3"
BOARD_TYPE = "ESP32-C6" # Change to "ESP32-C3" if using ESP32-C3 board
BOARD_TYPE = "ESP32-C6" # or select "ESP32-C3" or "ESP32-S3"

# ============================================================================
# Board-Specific Pin Configurations
Expand Down Expand Up @@ -42,13 +42,31 @@
'BTN_MENU2': 11,
}

# ESP32-S3 Pin Configuration (XIAO S3)
_ESP32_S3_CONFIG = {
'I2C_SDA': 5,
'I2C_SCL': 6,
'BTN_UP': 1,
'BTN_DOWN': 2,
'BTN_LEFT': 3,
'BTN_RIGHT':4,
'BTN_A': 9,
'BTN_B': 0,
'BTN_MENU1': 8,
'BTN_MENU2': 7,
}



# Select configuration based on board type
if BOARD_TYPE == "ESP32-C3":
_CONFIG = _ESP32_C3_CONFIG
elif BOARD_TYPE == "ESP32-C6":
_CONFIG = _ESP32_C6_CONFIG
elif BOARD_TYPE == "ESP32-S3":
_CONFIG = _ESP32_S3_CONFIG
else:
raise ValueError(f"Unknown BOARD_TYPE: {BOARD_TYPE}. Supported: 'ESP32-C6', 'ESP32-C3'")
raise ValueError(f"Unknown BOARD_TYPE: {BOARD_TYPE}. Supported: 'ESP32-C6', 'ESP32-C3', 'ESP32-S3'")

# Display Configuration
DISPLAY_WIDTH = 128
Expand All @@ -68,7 +86,7 @@
BTN_MENU2 = _CONFIG['BTN_MENU2']

# Free the raw config dicts — all values have been extracted above
del _ESP32_C6_CONFIG, _ESP32_C3_CONFIG, _CONFIG
del _ESP32_C6_CONFIG, _ESP32_C3_CONFIG, _ESP32_S3_CONFIG, _CONFIG

# WiFi Features
# Disable if wlan.scan() causes hard freezes on your firmware/board combination.
Expand All @@ -78,7 +96,7 @@
SHOW_DEBUG_MENUS = True

# Software Version
VERSION = "0.9.1"
VERSION = "0.9.0"

# Game Constants
FPS = 12 # Target frames per second
Expand All @@ -98,4 +116,4 @@
SLEEP_MODE = "basic"
SLEEP_TIMEOUT_SEC = 900 # Seconds of inactivity before sleeping (15 minutes)
SLEEP_FPS = 2 # Game update rate while in basic sleep
SLEEP_FRAME_TIME_MS = 1000 // SLEEP_FPS
SLEEP_FRAME_TIME_MS = 1000 // SLEEP_FPS
3 changes: 2 additions & 1 deletion tools/build_firmware.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ PORT="${3:-}"
case "$BOARD" in
esp32c6) MICROPY_BOARD="ESP32_GENERIC_C6" ;;
esp32c3) MICROPY_BOARD="ESP32_GENERIC_C3" ;;
*) echo "Unknown board: $BOARD. Use esp32c6 or esp32c3."; exit 1 ;;
esp32s3) MICROPY_BOARD="ESP32_GENERIC_S3" ;;
*) echo "Unknown board: $BOARD. Use esp32c6, esp32s3 or esp32c3."; exit 1 ;;
esac

PROJECT_DIR="$(cd "$(dirname "$0")/.." && pwd)"
Expand Down