mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-09-14 15:16:40 +00:00
97 lines
5.0 KiB
INI
97 lines
5.0 KiB
INI
; Solo build for Heltec LoRa32 V4 -- extends the board base defined in
|
|||
|
|
; variants/heltec_v4/platformio.ini. Solo configs live in their own top-level
|
||
|
|
; solo/ folder, separate from the shared upstream board variants in variants/,
|
||
|
|
; so this repo's Solo-specific additions don't get mixed in with configs
|
||
|
|
; other MeshCore forks/upstream also carry.
|
||
|
|
;
|
||
|
|
; Solo build: the full standalone on-device UI (message history, contacts, map,
|
||
|
|
; tools) rather than a screen that only mirrors the phone app. Dual transport --
|
||
|
|
; the companion app can attach over BLE or USB serial, whichever it finds, and
|
||
|
|
; BLE wins while both are live. OLED board only -- the TFT variant would need
|
||
|
|
; its own DISPLAY_CLASS.
|
||
|
|
;
|
||
|
|
; This firmware needs a real input device: the solo UI cannot be driven from the
|
||
|
|
; PRG button alone. Both supported ones are wired up in target.cpp and enabled
|
||
|
|
; below, so either is enough on its own and having both is fine. The pins are
|
||
|
|
; defaults picked from what this board leaves free -- change them to match how
|
||
|
|
; the device is actually built. Pins with nothing attached read as not-pressed,
|
||
|
|
; so the unused half costs nothing.
|
||
|
|
;
|
||
|
|
; * CardKB (M5Stack I2C keyboard, addr 0x5F) on a second I2C bus. Any two free
|
||
|
|
; GPIOs -- NOT 17/18, the OLED already owns those on Wire. It's probed at
|
||
|
|
; boot, so a build with these set still runs fine with nothing plugged in.
|
||
|
|
; Pair it with Settings > Keyboard > Ext. KB = Compact, which is designed to
|
||
|
|
; need no joystick at all. The same bus is scanned for environment sensors.
|
||
|
|
; Defaults below: SDA 3, SCL 4 -- the pins heltec_v4_sensor and
|
||
|
|
; heltec_v4_expansionkit_repeater already use for their second I2C bus, i.e.
|
||
|
|
; the expansion kit's. (Those envs disagree on the order: two say SDA 3 /
|
||
|
|
; SCL 4, one says the reverse. 3/4 is the pair either way; swap them if the
|
||
|
|
; keyboard doesn't answer.)
|
||
|
|
;
|
||
|
|
; * Wired joystick: four direction pins plus a fifth "press" contact. The
|
||
|
|
; press contact drives Enter (your thumb's already on the stick) via
|
||
|
|
; PIN_USER_BTN -- overridden below (a later -D wins, no -U needed: this whole
|
||
|
|
; project builds with -w) from the PRG-button default
|
||
|
|
; the base env sets, since PRG's GPIO0 can't be moved to the stick. PRG
|
||
|
|
; becomes Back instead (PIN_BACK_BTN), so it no longer needs its own
|
||
|
|
; separately-wired button. Each contact just shorts its pin to GND;
|
||
|
|
; target.cpp enables the internal pull-ups. Drop
|
||
|
|
; UI_HAS_JOYSTICK_UPDOWN for a left/right-only stick. JOYSTICK_ROTATION (0-3)
|
||
|
|
; rotates the mapping if the stick is mounted sideways -- it's also a runtime
|
||
|
|
; setting, so leave it out unless you want a different default.
|
||
|
|
; Comment the whole block out for a CardKB-only build. UI_HAS_JOYSTICK
|
||
|
|
; replaces the single-button handling rather than adding to it (UITask.cpp
|
||
|
|
; dispatches on '#if UI_HAS_JOYSTICK ... #elif defined(PIN_USER_BTN)'), which
|
||
|
|
; costs nothing here -- that fallback only feeds KEY_NEXT/KEY_PREV, which the
|
||
|
|
; solo screens don't act on.
|
||
|
|
;
|
||
|
|
; Free on this board, per its pinout: 3, 4, 6, 23, 33, 43, 44, 45, 46, 47, 48.
|
||
|
|
; Two of those can't take an I2C pull-up: 45 selects VDD_SPI at boot, so held
|
||
|
|
; high the chip comes up expecting 1.8V flash and won't boot at all, and 46 is
|
||
|
|
; the boot-mode strap. 3 is a strapping pin too, but it only picks the JTAG
|
||
|
|
; source -- and it's what this board's own expansion kit uses for I2C anyway.
|
||
|
|
; 43/44 are UART0: unused by this build, since ARDUINO_USB_CDC_ON_BOOT (set in
|
||
|
|
; boards/heltec_v4.json) makes Serial the native USB port, but a USB-UART bridge
|
||
|
|
; may still be wired to them, so they're left alone.
|
||
|
|
[env:heltec_v4_companion_solo_dual]
|
||
|
|
extends = heltec_v4_oled
|
||
|
|
build_flags =
|
||
|
|
${heltec_v4_oled.build_flags}
|
||
|
|
-I examples/companion_radio/ui-new
|
||
|
|
-D MAX_CONTACTS=350
|
||
|
|
-D MAX_GROUP_CHANNELS=40
|
||
|
|
-D DISPLAY_CLASS=SSD1306Display
|
||
|
|
-D BLE_PIN_CODE=123456 ; dynamic, random PIN
|
||
|
|
-D DUAL_SERIAL=1 ; companion app over BLE *or* USB serial
|
||
|
|
-D OFFLINE_QUEUE_SIZE=256
|
||
|
|
-D FIRMWARE_SOLO_BUILD=1
|
||
|
|
-D UI_SENSORS_PAGE=1
|
||
|
|
-D OLED_MISC_FIXED_FONT=1 ; full Latin/Greek/Cyrillic 6x9 font, ~14 KB flash
|
||
|
|
-D ENABLE_SCREENSHOT ; same as the other solo builds — Solo Tools reads the framebuffer over USB
|
||
|
|
; CardKB on the second I2C bus. Harmless with nothing plugged in.
|
||
|
|
-D ENV_PIN_SDA=3
|
||
|
|
-D ENV_PIN_SCL=4
|
||
|
|
; Wired joystick — comment the block out for a CardKB-only build. The
|
||
|
|
; press contact (Enter) overrides PIN_USER_BTN from its PRG default;
|
||
|
|
; PRG becomes Back (PIN_BACK_BTN) instead.
|
||
|
|
-D UI_HAS_JOYSTICK=1
|
||
|
|
-D UI_HAS_JOYSTICK_UPDOWN=1
|
||
|
|
-D JOYSTICK_UP=23
|
||
|
|
-D JOYSTICK_DOWN=6
|
||
|
|
-D JOYSTICK_LEFT=47
|
||
|
|
-D JOYSTICK_RIGHT=48
|
||
|
|
-D PIN_BACK_BTN=0 ; PRG button
|
||
|
|
-D PIN_USER_BTN=33 ; joystick press contact -- Enter, overrides the PRG default above
|
||
|
|
; -D PIN_BUZZER=<gpio>
|
||
|
|
build_src_filter = ${heltec_v4_oled.build_src_filter}
|
||
|
|
+<helpers/ui/SSD1306Display.cpp>
|
||
|
|
+<helpers/ui/MomentaryButton.cpp>
|
||
|
|
+<helpers/ui/buzzer.cpp>
|
||
|
|
+<helpers/esp32/*.cpp>
|
||
|
|
+<../examples/companion_radio/*.cpp>
|
||
|
|
+<../examples/companion_radio/ui-new/*.cpp>
|
||
|
|
lib_deps =
|
||
|
|
${heltec_v4_oled.lib_deps}
|
||
|
|
densaugeo/base64 @ ~1.4.0
|
||
|
|
end2endzone/NonBlockingRTTTL@^1.3.0
|