From e5bbdbd5d6d9e148ac28dd8a68688d33650efa28 Mon Sep 17 00:00:00 2001 From: Koki Shinjo Date: Thu, 25 Apr 2024 13:01:26 +0900 Subject: [PATCH] [sdp_landmark_information] update --- .../sdp_landmark_information/src/main.cpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/sketchbooks/sdp_landmark_information/src/main.cpp b/sketchbooks/sdp_landmark_information/src/main.cpp index 01ce0c99..b423811b 100644 --- a/sketchbooks/sdp_landmark_information/src/main.cpp +++ b/sketchbooks/sdp_landmark_information/src/main.cpp @@ -126,16 +126,32 @@ bool load_config_from_FS(fs::FS &fs, String filename = "/config.json") { } void setup() { +#if defined(M5STACK_FIRE) M5.begin(true, true, true, false); Serial.begin(115200); Serial2.begin(115200, SERIAL_8N1, 22, 21); +#elif defined(M5STACK_CORE2) + M5.begin(true, true, true, false); + Serial.begin(115200); + Serial2.begin(115200, SERIAL_8N1, 22, 21); +#endif // LCD Print M5.Lcd.printf("SDP LANDMARK INFORMATION HOST\n"); // Load config from FS +#if defined(M5STACK_FIRE) SPIFFS.begin(); SD.begin(); +#elif defined(M5STACK_CORE2) + SPIFFS.begin(); + if (!SD.begin()) { + M5.lcd.println("Card Mount Failed"); + while (1) { + delay(1000); + } + } +#endif if (not load_config_from_FS(SD, "/config.json")) { if (not load_config_from_FS(SPIFFS, "/config.json")) { Serial.println("Failed to load config file");