mirror of
https://github.com/MarekZegare4/MeshCore-Solo.git
synced 2026-11-01 10:21:59 +00:00
feat(eink): 4.2" 400x300 build with the misc-fixed 9x15 font, wide sim
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -463,7 +463,7 @@ public:
|
||||
};
|
||||
|
||||
#ifdef SIM_EINK_PANEL_W
|
||||
// An e-ink panel (the Wio Tracker L1 E-ink's 2.13", 122x250 before rotation):
|
||||
// An e-ink panel (the Wio Tracker L1 E-ink's 2.13", 122x250 before rotation, or a 4.2" 400x300):
|
||||
// EinkGfxDisplay draws, exactly as GxEPDDisplay does on the board, into a 1-bit
|
||||
// canvas, and a frame that changed is put on the page in paper and ink. The
|
||||
// host page counts refreshes from Module.__einkRefreshes. Bodies in target.cpp,
|
||||
|
||||
@@ -194,15 +194,17 @@ if [ "$SIM_UI" = "lvgl" ]; then
|
||||
LINK_EXTRA=(-sFETCH=1) # map downloads (LvglPort.h) go through emscripten_fetch
|
||||
fi
|
||||
|
||||
# SIM_EINK=landscape|portrait: ui-new on the Wio Tracker L1 E-ink's 2.13" panel
|
||||
# (122x250, solo/wio-tracker-l1-eink's two builds) instead of the OLED ->
|
||||
# web/index.html?build=meshcore_sim_eink_landscape (or _portrait).
|
||||
# SIM_EINK=landscape|portrait|wide: ui-new on the Wio Tracker L1 E-ink's 2.13"
|
||||
# panel (122x250, solo/wio-tracker-l1-eink's two builds) or the 4.2" one
|
||||
# (400x300, its third) instead of the OLED ->
|
||||
# web/index.html?build=meshcore_sim_eink_landscape (or _portrait, _wide).
|
||||
SIM_EINK="${SIM_EINK:-}"
|
||||
if [ -n "$SIM_EINK" ]; then
|
||||
case "$SIM_EINK" in
|
||||
landscape) EINK_DEFS=(-DDISPLAY_ROTATION=1 -DEINK_LARGE_FONT=1); EXPORT_NAME=MeshCoreSimEinkLandscape ;;
|
||||
portrait) EINK_DEFS=(-DDISPLAY_ROTATION=0); EXPORT_NAME=MeshCoreSimEinkPortrait ;;
|
||||
*) echo "error: SIM_EINK must be landscape or portrait" >&2; exit 1 ;;
|
||||
landscape) EINK_DEFS=(-DDISPLAY_ROTATION=1 -DEINK_LARGE_FONT=1 -DSIM_EINK_PANEL_W=122 -DSIM_EINK_PANEL_H=250); EXPORT_NAME=MeshCoreSimEinkLandscape ;;
|
||||
portrait) EINK_DEFS=(-DDISPLAY_ROTATION=0 -DSIM_EINK_PANEL_W=122 -DSIM_EINK_PANEL_H=250); EXPORT_NAME=MeshCoreSimEinkPortrait ;;
|
||||
wide) EINK_DEFS=(-DDISPLAY_ROTATION=0 -DEINK_LARGE_FONT=2 -DSIM_EINK_PANEL_W=400 -DSIM_EINK_PANEL_H=300); EXPORT_NAME=MeshCoreSimEinkWide ;;
|
||||
*) echo "error: SIM_EINK must be landscape, portrait or wide" >&2; exit 1 ;;
|
||||
esac
|
||||
OUT_NAME="meshcore_sim_eink_$SIM_EINK"
|
||||
# Distinct factories (set above): web/mesh.html?a=... loads one beside
|
||||
@@ -213,7 +215,7 @@ if [ -n "$SIM_EINK" ]; then
|
||||
done
|
||||
# EINK_DISPLAY_MODEL is only tested for presence outside GxEPDDisplay
|
||||
# (Features.h: the e-ink settings and timings), which the sim doesn't build.
|
||||
DEFINES=("${kept[@]}" -DDISPLAY_CLASS=SimEinkDisplay -DSIM_EINK_PANEL_W=122 -DSIM_EINK_PANEL_H=250
|
||||
DEFINES=("${kept[@]}" -DDISPLAY_CLASS=SimEinkDisplay
|
||||
-DEINK_DISPLAY_MODEL=SimEinkPanel -DMAX_GROUP_CHANNELS=40 "${EINK_DEFS[@]}")
|
||||
fi
|
||||
|
||||
|
||||
@@ -158,7 +158,7 @@
|
||||
|
||||
<div id="log"></div>
|
||||
|
||||
<!-- ?build=meshcore_sim_eink_landscape (or _portrait) loads another build of
|
||||
<!-- ?build=meshcore_sim_eink_landscape (or _portrait, _wide) loads another build of
|
||||
the same UI; the e-ink driver sizes the canvas itself. -->
|
||||
<script>
|
||||
document.write('<script src="build/' +
|
||||
@@ -215,7 +215,7 @@
|
||||
}
|
||||
}
|
||||
|
||||
const SimFactory = window.MeshCoreSimEinkLandscape || window.MeshCoreSimEinkPortrait || window.MeshCoreSim;
|
||||
const SimFactory = window.MeshCoreSimEinkLandscape || window.MeshCoreSimEinkPortrait || window.MeshCoreSimEinkWide || window.MeshCoreSim;
|
||||
if (typeof SimFactory !== 'function') {
|
||||
statusEl.textContent = 'error: build/meshcore_sim.js missing or failed to load -- run variants/sim/build_wasm.sh first.';
|
||||
} else {
|
||||
|
||||
@@ -231,14 +231,14 @@
|
||||
|
||||
<script src="build/meshcore_sim.js"></script>
|
||||
<script src="build/repeater/meshcore_sim_repeater.js"></script>
|
||||
<!-- ?a=meshcore_sim_eink_landscape (or _portrait): A is that e-ink build. -->
|
||||
<!-- ?a=meshcore_sim_eink_landscape (or _portrait, _wide): A is that e-ink build. -->
|
||||
<script>
|
||||
const A_BUILD = (new URLSearchParams(location.search).get('a') || '').replace(/[^\w]/g, '');
|
||||
if (A_BUILD) document.write('<script src="build/' + A_BUILD + '.js"><\/script>');
|
||||
</script>
|
||||
<script>
|
||||
const logEl = document.getElementById('log');
|
||||
const FactoryA = (opts) => (window.MeshCoreSimEinkLandscape || window.MeshCoreSimEinkPortrait || MeshCoreSim)(opts);
|
||||
const FactoryA = (opts) => (window.MeshCoreSimEinkLandscape || window.MeshCoreSimEinkPortrait || window.MeshCoreSimEinkWide || MeshCoreSim)(opts);
|
||||
function log(msg) {
|
||||
const line = document.createElement('div');
|
||||
line.textContent = '[' + new Date().toISOString().substr(11, 12) + '] ' + msg;
|
||||
|
||||
Reference in New Issue
Block a user