Skip to content

Commit

Permalink
Fixes for binary commonality
Browse files Browse the repository at this point in the history
  • Loading branch information
GOB52 committed May 8, 2023
1 parent 0a12d54 commit 02e6adb
Show file tree
Hide file tree
Showing 8 changed files with 56 additions and 162 deletions.
97 changes: 21 additions & 76 deletions platformio.ini
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,15 @@ framework = arduino

board_build.flash_mode = qio
board_build.f_flash = 80000000L
board_build.f_cpu = 240000000L
board = m5stack-core-esp32
board_build.partitions = min_spiffs.csv

; https://www.a-quest.com/download.html Download AquesTalk ESP32 and extract ./lib folder.
lib_ldf_mode = deep
lib_deps = https://github.com/M5Stack/M5Unified.git @ ^0.1.6
h2zero/NimBLE-Arduino @ ^1.4.0
https://github.com/GOB52/gob_json.git @ ^0.0.4
https://github.com/GOB52/gob_datetime.git @ ^0.1.1
lib_deps = https://github.com/M5Stack/M5Unified.git @ 0.1.6
h2zero/NimBLE-Arduino @ 1.4.0
https://github.com/GOB52/gob_json.git @ 0.0.4
https://github.com/GOB52/gob_datetime.git @ 0.1.1

monitor_speed = 115200
monitor_filters = esp32_exception_decoder, time
Expand All @@ -29,6 +30,7 @@ upload_speed = 921600
; M5S_WXBEACON2_AUTO_REQUEST_INTERVAL_SEC : Auto request interval (Unit: second)
; M5S_WXBEACON2_AUTO_TALK_INTERVAL_SEC : Auto talk interval (Unit; second)
build_flags = -Wall -Wextra -Wreturn-local-addr -Werror=format -Werror=return-local-addr
-D BOARD_HAS_PSRAM
-D M5S_WXBEACON2_TIMEZONE_LOCATION=\"Asia/Tokyo\"
-D M5S_WXBEACON2_AUTO_REQUEST_INTERVAL_SEC=300
-D M5S_WXBEACON2_AUTO_TALK_INTERVAL_SEC=60
Expand All @@ -55,88 +57,31 @@ build_flags = -DCORE_DEBUG_LEVEL=5
-DWB2_LOG_LEVEL=5
-DMYNEWT_VAL_BLE_HS_LOG_LVL=0

; Choose board
[core2_env]
board = m5stack-core2

[m5s_env]
board = m5stack-core-esp32
board_build.partitions = min_spiffs.csv

;-----------------------------------------------------------------------
; M5Stack Core2
[env:core2_master]
extends = core2_env
[env:master]
build_type=release
build_flags=${env.build_flags} ${option_release.build_flags} -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue -DNDEBUG
build_flags=${env.build_flags} ${option_release.build_flags} -DNDEBUG

[env:core2_release]
extends = core2_env
[env:master_SDU]
build_type=release
build_flags=${env.build_flags} ${option_release.build_flags} -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue

[env:core2_master_SDU]
extends = core2_env
build_type=release
build_flags=${env.build_flags} ${option_release.build_flags} -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue -DNDEBUG -DM5S_WXBEACON2_ENABLE_SD_UPDATER
lib_deps = ${env.lib_deps}
tobozo/M5Stack-SD-Updater

[env:core2_release_SDU]
extends = core2_env
build_type=release
build_flags=${env.build_flags} ${option_release.build_flags} -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue -DM5S_WXBEACON2_ENABLE_SD_UPDATER
build_flags=${env.build_flags} ${option_release.build_flags} -DNDEBUG -DM5S_WXBEACON2_ENABLE_SD_UPDATER
lib_deps = ${env.lib_deps}
tobozo/M5Stack-SD-Updater

[env:core2_log]
extends = core2_env
build_type=release
build_flags=${env.build_flags} ${option_log.build_flags} -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue

[env:core2_debug]
extends = core2_env
build_type=debug
build_flags=${env.build_flags} ${option_debug.build_flags} -DBOARD_HAS_PSRAM -mfix-esp32-psram-cache-issue

; M5Stack BASIC
[env:basic_master]
extends = m5s_env
build_type=release
build_flags=${env.build_flags} ${option_release.build_flags} -DNDEBUG

[env:basic_release]
extends = m5s_env
build_type=release
build_flags=${env.build_flags} ${option_release.build_flags}
tobozo/M5Stack-SD-Updater @ 1.2.5

[env:basic_master_SDU]
extends = m5s_env
[env:release]
build_type=release
build_flags=${env.build_flags} ${option_release.build_flags} -DNDEBUG -DM5S_WXBEACON2_ENABLE_SD_UPDATER
lib_deps = ${env.lib_deps}
tobozo/M5Stack-SD-Updater
build_flags=${env.build_flags} ${option_release.build_flags}

[env:basic_release_SDU]
extends = m5s_env
[env:release_SDU]
build_type=release
build_flags=${env.build_flags} ${option_release.build_flags} -DM5S_WXBEACON2_ENABLE_SD_UPDATER
build_flags=${env.build_flags} ${option_release.build_flags} -DM5S_WXBEACON2_ENABLE_SD_UPDATER
lib_deps = ${env.lib_deps}
tobozo/M5Stack-SD-Updater

[env:basic_map]
extends = m5s_env
build_type=release
build_flags=${env.build_flags} ${option_release.build_flags} -Wl,-Map,output.map
tobozo/M5Stack-SD-Updater @1.2.5

[env:basic_log]
extends = m5s_env
[env:log]
build_type=release
build_flags=${env.build_flags} ${option_log.build_flags}
build_flags=${env.build_flags} ${option_log.build_flags}

[env:basic_debug]
extends = m5s_env
[env:debug]
build_type=debug
build_flags=${env.build_flags} ${option_debug.build_flags}


build_flags=${env.build_flags} ${option_debug.build_flags}
7 changes: 2 additions & 5 deletions src/himawari/himawari_screen.cpp
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
/*
Render himawari image
*/
#ifdef ARDUINO_M5STACK_Core2

WARNING : Works only with devices that have PSRAM (Need huge memories)
*/
#include "himawari_screen.hpp"
#include "wb2/wxbeacon2_log.hpp"
#include "res/resource.h"
Expand All @@ -29,5 +28,3 @@ void HimawariScreen::render(m5gfx::M5GFX* dst, const bool force)
dst->setFont(ofont);
dst->setTextColor(TFT_WHITE, TFT_BLACK);
}

#endif
9 changes: 4 additions & 5 deletions src/himawari/himawari_screen.hpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
/*
Render himawari image
*/
#ifdef ARDUINO_M5STACK_Core2
# ifndef HIMAWARI_SCREEN_HPP
# define HIMAWARI_SCREEN_HPP
WARNING : Works only with devices that have PSRAM (Need huge memories)
*/
#ifndef HIMAWARI_SCREEN_HPP
#define HIMAWARI_SCREEN_HPP

#include <M5GFX.h>
#include <gob_datetime.hpp>
Expand Down Expand Up @@ -32,5 +32,4 @@ class HimawariScreen
const uint8_t* _jpg{};
};

# endif
#endif
9 changes: 3 additions & 6 deletions src/himawari/himawari_task.cpp
Original file line number Diff line number Diff line change
@@ -1,9 +1,7 @@
/*
Request image of Weather Satellite "Himawari"
M5Stack Core2 only
WARNING : Works only with devices that have PSRAM (Need huge memories)
*/
#ifdef ARDUINO_M5STACK_Core2

#include <Arduino.h>
#include <WiFi.h>
#include <HTTPClient.h>
Expand Down Expand Up @@ -85,9 +83,9 @@ PROGMEM const char* areaTable[] =

PROGMEM const char HIMAWARI_URI_FORMAT[] = "https://www.data.jma.go.jp/mscweb/data/himawari/img/%s/%s_%s_%02d%02d.jpg";
// DigiCert Global Root CA of www.data.jma.go.jp.
// Expire at Mon, 10 Nov 2031 00:00:00 GMT
// If you get an X509 error, get the latest root certificate and rewrite this part.
PROGMEM const char root_ca_ECC[] =
R"***(-----BEGIN CERTIFICATE-----
R"***(-----BEGIN CERTIFICATE-----
MIIDdzCCAl+gAwIBAgIBADANBgkqhkiG9w0BAQsFADBdMQswCQYDVQQGEwJKUDEl
MCMGA1UEChMcU0VDT00gVHJ1c3QgU3lzdGVtcyBDTy4sTFRELjEnMCUGA1UECxMe
U2VjdXJpdHkgQ29tbXVuaWNhdGlvbiBSb290Q0EyMB4XDTA5MDUyOTA1MDAzOVoX
Expand Down Expand Up @@ -295,4 +293,3 @@ bool request(const goblib::datetime::OffsetDateTime& odt, const Area area, const
}
//
}
#endif
8 changes: 3 additions & 5 deletions src/himawari/himawari_task.hpp
Original file line number Diff line number Diff line change
@@ -1,10 +1,9 @@
/*
Request image of Weather Satellite "Himawari"
M5Stack Core2 only
WARNING : Works only with devices that have PSRAM (Need huge memories)
*/
#ifdef ARDUINO_M5STACK_Core2
# ifndef HIMAWARI_TASK_HPP
# define HIMAWARI_TASK_HPP
#ifndef HIMAWARI_TASK_HPP
#define HIMAWARI_TASK_HPP

#include "himawari.hpp"
#include <gob_datetime.hpp>
Expand All @@ -21,5 +20,4 @@ bool request(const goblib::datetime::OffsetDateTime& odt, const Area = Area::Jap

//
}
# endif
#endif
1 change: 1 addition & 0 deletions src/jma/jma_task.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ jma::progress_callback callbackOnProgress;
PROGMEM const char JMA_FORECAST_URI_FORMAT[] = "https://www.jma.go.jp/bosai/forecast/data/forecast/%06d.json";

// DigiCert Global Root CA of www.jma.go.jp.
// If you get an X509 error, get the latest root certificate and rewrite this part.
PROGMEM const char root_ca_JMA[] =
R"***(-----BEGIN CERTIFICATE-----
MIIDdzCCAl+gAwIBAgIBADANBgkqhkiG9w0BAQsFADBdMQswCQYDVQQGEwJKUDEl
Expand Down
Loading

0 comments on commit 02e6adb

Please sign in to comment.