mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-07-26 14:58:12 +00:00
feat(gat562-30s): add solo build envs, fix joystick/GPS/buzzer/display
- SSD1306Display: track _text_sz in setTextSize(); override getCharWidth() and getLineHeight() so line spacing scales with text size (fixes text overlap on splash/clock screens at size 2) - gat562_30s_mesh_kit variant.h: fix PIN_GPS_EN 33→34 (IO2/P1.02 controls GPS module power via Q3/Q5 transistors; 33 = BEE_EN = buzzer) - gat562_30s_mesh_kit variant.h: correct joystick pin comments (P0.xx labels were cyclically wrong; pin numbers already correct) - gat562_30s_mesh_kit target.h/cpp: declare and instantiate joystick_up/down under UI_HAS_JOYSTICK_UPDOWN guard (fixes compile error in solo envs) - gat562_30s_mesh_kit platformio.ini: add solo_ble and solo_dual environments with GPS, BLE, joystick up/down, QSPI flash, and buzzer (NonBlockingRTTTL) - gat562_mesh_watch13 platformio.ini: add solo_ble environment with GPS Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -53,6 +53,7 @@ void SSD1306Display::startFrame(Color bkg) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void SSD1306Display::setTextSize(int sz) {
|
void SSD1306Display::setTextSize(int sz) {
|
||||||
|
_text_sz = sz;
|
||||||
display.setTextSize(sz);
|
display.setTextSize(sz);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,7 @@ class SSD1306Display : public DisplayDriver {
|
|||||||
Adafruit_SSD1306 display;
|
Adafruit_SSD1306 display;
|
||||||
bool _isOn;
|
bool _isOn;
|
||||||
uint8_t _color;
|
uint8_t _color;
|
||||||
|
int _text_sz = 1;
|
||||||
RefCountedDigitalPin* _peripher_power;
|
RefCountedDigitalPin* _peripher_power;
|
||||||
|
|
||||||
bool i2c_probe(TwoWire& wire, uint8_t addr);
|
bool i2c_probe(TwoWire& wire, uint8_t addr);
|
||||||
@@ -31,6 +32,9 @@ public:
|
|||||||
}
|
}
|
||||||
bool begin();
|
bool begin();
|
||||||
|
|
||||||
|
int getCharWidth() const override { return 6 * _text_sz; }
|
||||||
|
int getLineHeight() const override { return 8 * _text_sz; }
|
||||||
|
|
||||||
bool isOn() override { return _isOn; }
|
bool isOn() override { return _isOn; }
|
||||||
void turnOn() override;
|
void turnOn() override;
|
||||||
void turnOff() override;
|
void turnOff() override;
|
||||||
|
|||||||
@@ -112,6 +112,71 @@ lib_deps =
|
|||||||
densaugeo/base64 @ ~1.4.0
|
densaugeo/base64 @ ~1.4.0
|
||||||
end2endzone/NonBlockingRTTTL@^1.3.0
|
end2endzone/NonBlockingRTTTL@^1.3.0
|
||||||
|
|
||||||
|
[env:GAT562_30S_Mesh_Kit_solo_ble]
|
||||||
|
extends = GAT562_30S_Mesh_Kit
|
||||||
|
board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
|
||||||
|
board_upload.maximum_size = 712704
|
||||||
|
build_flags =
|
||||||
|
${GAT562_30S_Mesh_Kit.build_flags}
|
||||||
|
-I examples/companion_radio/ui-new
|
||||||
|
-D DISPLAY_CLASS=SSD1306Display
|
||||||
|
-D MAX_CONTACTS=350
|
||||||
|
-D MAX_GROUP_CHANNELS=40
|
||||||
|
-D BLE_PIN_CODE=123456
|
||||||
|
-D OFFLINE_QUEUE_SIZE=256
|
||||||
|
-D FIRMWARE_SOLO_BUILD=1
|
||||||
|
-D MESHCORE_VERSION='"1.17"'
|
||||||
|
-D UI_SENSORS_PAGE=1
|
||||||
|
-D UI_HAS_JOYSTICK_UPDOWN=1
|
||||||
|
-D ADVERT_NAME='"@@MAC"'
|
||||||
|
-D QSPIFLASH=1
|
||||||
|
-D ENV_INCLUDE_GPS=1
|
||||||
|
; -D MESH_PACKET_LOGGING=1
|
||||||
|
; -D MESH_DEBUG=1
|
||||||
|
build_src_filter = ${GAT562_30S_Mesh_Kit.build_src_filter}
|
||||||
|
+<helpers/nrf52/SerialBLEInterface.cpp>
|
||||||
|
+<helpers/ui/buzzer.cpp>
|
||||||
|
+<../examples/companion_radio/*.cpp>
|
||||||
|
+<../examples/companion_radio/ui-new/*.cpp>
|
||||||
|
lib_deps =
|
||||||
|
${GAT562_30S_Mesh_Kit.lib_deps}
|
||||||
|
adafruit/RTClib @ ^2.1.3
|
||||||
|
densaugeo/base64 @ ~1.4.0
|
||||||
|
end2endzone/NonBlockingRTTTL@^1.3.0
|
||||||
|
|
||||||
|
[env:GAT562_30S_Mesh_Kit_solo_dual]
|
||||||
|
extends = GAT562_30S_Mesh_Kit
|
||||||
|
board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
|
||||||
|
board_upload.maximum_size = 712704
|
||||||
|
build_flags =
|
||||||
|
${GAT562_30S_Mesh_Kit.build_flags}
|
||||||
|
-I examples/companion_radio/ui-new
|
||||||
|
-D DISPLAY_CLASS=SSD1306Display
|
||||||
|
-D MAX_CONTACTS=350
|
||||||
|
-D MAX_GROUP_CHANNELS=40
|
||||||
|
-D BLE_PIN_CODE=123456
|
||||||
|
-D OFFLINE_QUEUE_SIZE=256
|
||||||
|
-D FIRMWARE_SOLO_BUILD=1
|
||||||
|
-D MESHCORE_VERSION='"1.17"'
|
||||||
|
-D UI_SENSORS_PAGE=1
|
||||||
|
-D UI_HAS_JOYSTICK_UPDOWN=1
|
||||||
|
-D ADVERT_NAME='"@@MAC"'
|
||||||
|
-D QSPIFLASH=1
|
||||||
|
-D ENV_INCLUDE_GPS=1
|
||||||
|
-D DUAL_SERIAL=1
|
||||||
|
; -D MESH_PACKET_LOGGING=1
|
||||||
|
; -D MESH_DEBUG=1
|
||||||
|
build_src_filter = ${GAT562_30S_Mesh_Kit.build_src_filter}
|
||||||
|
+<helpers/nrf52/SerialBLEInterface.cpp>
|
||||||
|
+<helpers/ui/buzzer.cpp>
|
||||||
|
+<../examples/companion_radio/*.cpp>
|
||||||
|
+<../examples/companion_radio/ui-new/*.cpp>
|
||||||
|
lib_deps =
|
||||||
|
${GAT562_30S_Mesh_Kit.lib_deps}
|
||||||
|
adafruit/RTClib @ ^2.1.3
|
||||||
|
densaugeo/base64 @ ~1.4.0
|
||||||
|
end2endzone/NonBlockingRTTTL@^1.3.0
|
||||||
|
|
||||||
[env:GAT562_30S_Mesh_Kit_kiss_modem]
|
[env:GAT562_30S_Mesh_Kit_kiss_modem]
|
||||||
extends = GAT562_30S_Mesh_Kit
|
extends = GAT562_30S_Mesh_Kit
|
||||||
build_src_filter = ${GAT562_30S_Mesh_Kit.build_src_filter}
|
build_src_filter = ${GAT562_30S_Mesh_Kit.build_src_filter}
|
||||||
|
|||||||
@@ -15,6 +15,10 @@ GAT56230SMeshKitBoard board;
|
|||||||
MomentaryButton joystick_left(JOYSTICK_LEFT, 1000, true, false, false);
|
MomentaryButton joystick_left(JOYSTICK_LEFT, 1000, true, false, false);
|
||||||
MomentaryButton joystick_right(JOYSTICK_RIGHT, 1000, true, false, false);
|
MomentaryButton joystick_right(JOYSTICK_RIGHT, 1000, true, false, false);
|
||||||
MomentaryButton back_btn(PIN_BACK_BTN, 1000, true, false, true);
|
MomentaryButton back_btn(PIN_BACK_BTN, 1000, true, false, true);
|
||||||
|
#ifdef UI_HAS_JOYSTICK_UPDOWN
|
||||||
|
MomentaryButton joystick_up(JOYSTICK_UP, 1000, true, false, false);
|
||||||
|
MomentaryButton joystick_down(JOYSTICK_DOWN, 1000, true, false, false);
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,10 @@
|
|||||||
extern MomentaryButton joystick_left;
|
extern MomentaryButton joystick_left;
|
||||||
extern MomentaryButton joystick_right;
|
extern MomentaryButton joystick_right;
|
||||||
extern MomentaryButton back_btn;
|
extern MomentaryButton back_btn;
|
||||||
|
#ifdef UI_HAS_JOYSTICK_UPDOWN
|
||||||
|
extern MomentaryButton joystick_up;
|
||||||
|
extern MomentaryButton joystick_down;
|
||||||
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
extern GAT56230SMeshKitBoard board;
|
extern GAT56230SMeshKitBoard board;
|
||||||
|
|||||||
@@ -86,10 +86,10 @@ extern "C"
|
|||||||
* Buttons
|
* Buttons
|
||||||
*/
|
*/
|
||||||
#define PIN_BUTTON1 (9) // Menu / User Button
|
#define PIN_BUTTON1 (9) // Menu / User Button
|
||||||
#define PIN_BUTTON2 (28) // Joystick Up
|
#define PIN_BUTTON2 (28) // Joystick Up (P0.28, IC pin 35)
|
||||||
#define PIN_BUTTON3 (4) // Joystick Down
|
#define PIN_BUTTON3 (4) // Joystick Down (P0.04, IC pin 37)
|
||||||
#define PIN_BUTTON4 (30) // Joystick Left
|
#define PIN_BUTTON4 (30) // Joystick Left (P0.30, IC pin 34)
|
||||||
#define PIN_BUTTON5 (31) // Joystick Right
|
#define PIN_BUTTON5 (31) // Joystick Right (P0.31, IC pin 33)
|
||||||
#define PIN_BUTTON6 (26) // Joystick Press
|
#define PIN_BUTTON6 (26) // Joystick Press
|
||||||
#define PIN_BACK_BTN PIN_BUTTON1
|
#define PIN_BACK_BTN PIN_BUTTON1
|
||||||
#define JOYSTICK_UP PIN_BUTTON2
|
#define JOYSTICK_UP PIN_BUTTON2
|
||||||
@@ -216,7 +216,7 @@ extern "C"
|
|||||||
#define GPS_THREAD_INTERVAL 50
|
#define GPS_THREAD_INTERVAL 50
|
||||||
#define PIN_GPS_TX PIN_SERIAL1_RX
|
#define PIN_GPS_TX PIN_SERIAL1_RX
|
||||||
#define PIN_GPS_RX PIN_SERIAL1_TX
|
#define PIN_GPS_RX PIN_SERIAL1_TX
|
||||||
#define PIN_GPS_EN (33)
|
#define PIN_GPS_EN (34) // IO2 = P1.02 — GPS module power enable
|
||||||
#define PIN_GPS_PPS (17)
|
#define PIN_GPS_PPS (17)
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|||||||
@@ -87,6 +87,45 @@ lib_deps =
|
|||||||
${GAT562_Mesh_Watch13.lib_deps}
|
${GAT562_Mesh_Watch13.lib_deps}
|
||||||
densaugeo/base64 @ ~1.4.0
|
densaugeo/base64 @ ~1.4.0
|
||||||
|
|
||||||
|
[env:GAT562_Mesh_Watch13_solo_ble]
|
||||||
|
extends = GAT562_Mesh_Watch13
|
||||||
|
board_build.ldscript = boards/nrf52840_s140_v6_extrafs.ld
|
||||||
|
board_upload.maximum_size = 712704
|
||||||
|
build_flags =
|
||||||
|
${GAT562_Mesh_Watch13.build_flags}
|
||||||
|
-I examples/companion_radio/ui-new
|
||||||
|
-D DISPLAY_CLASS=SSD1306Display
|
||||||
|
-D MAX_CONTACTS=350
|
||||||
|
-D MAX_GROUP_CHANNELS=40
|
||||||
|
-D BLE_PIN_CODE=123456
|
||||||
|
-D OFFLINE_QUEUE_SIZE=256
|
||||||
|
-D FIRMWARE_SOLO_BUILD=1
|
||||||
|
-D MESHCORE_VERSION='"1.17"'
|
||||||
|
-D UI_SENSORS_PAGE=1
|
||||||
|
-D ADVERT_NAME='"@@MAC"'
|
||||||
|
; GPS — re-enable (base undefines it); Serial1 pins 15/16 from variant
|
||||||
|
-D ENV_INCLUDE_GPS=1
|
||||||
|
-D GPS_BAUD_RATE=9600
|
||||||
|
; Buzzer available on IO3 (pin 21) — uncomment to enable
|
||||||
|
; -D PIN_BUZZER=21
|
||||||
|
; -D PIN_VIBRATION=36
|
||||||
|
; -D MESH_PACKET_LOGGING=1
|
||||||
|
; -D MESH_DEBUG=1
|
||||||
|
build_src_filter = ${GAT562_Mesh_Watch13.build_src_filter}
|
||||||
|
+<helpers/nrf52/SerialBLEInterface.cpp>
|
||||||
|
+<helpers/ui/MomentaryButton.cpp>
|
||||||
|
+<helpers/ui/GenericVibration.cpp>
|
||||||
|
+<../examples/companion_radio/*.cpp>
|
||||||
|
+<../examples/companion_radio/ui-new/*.cpp>
|
||||||
|
; If PIN_BUZZER is enabled above, also add:
|
||||||
|
; +<helpers/ui/buzzer.cpp>
|
||||||
|
lib_deps =
|
||||||
|
${GAT562_Mesh_Watch13.lib_deps}
|
||||||
|
adafruit/RTClib @ ^2.1.3
|
||||||
|
densaugeo/base64 @ ~1.4.0
|
||||||
|
; If PIN_BUZZER is enabled, also add:
|
||||||
|
; end2endzone/NonBlockingRTTTL@^1.3.0
|
||||||
|
|
||||||
[env:GAT562_Mesh_Watch13_kiss_modem]
|
[env:GAT562_Mesh_Watch13_kiss_modem]
|
||||||
extends = GAT562_Mesh_Watch13
|
extends = GAT562_Mesh_Watch13
|
||||||
build_src_filter = ${GAT562_Mesh_Watch13.build_src_filter}
|
build_src_filter = ${GAT562_Mesh_Watch13.build_src_filter}
|
||||||
|
|||||||
Reference in New Issue
Block a user