Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
50b053f
feat(device): VPP target.platformOptions + BoardInfoResolver foundation
marconetsf May 23, 2026
f22a90e
feat(compile): isolate strucpp behind a precompiled archive
marconetsf May 23, 2026
16b1151
fix(compile): pass --library precompiledLibDir for arduino-cli discovery
marconetsf May 23, 2026
2a4aa11
fix(compile): route Arduino HAL + upload paths through BoardInfoResol…
marconetsf May 23, 2026
6ca56b1
Merge remote-tracking branch 'origin/v4.2.0-rc1' into feat/vpp-compil…
marconetsf May 25, 2026
8ef8f03
refactor(board-info): unify BoardInfoSchema in hardware/types as the …
marconetsf May 25, 2026
3d105f5
fix(simulator): drop pin-mapping override that choked the debug-seria…
marconetsf May 25, 2026
3a957f6
Merge remote-tracking branch 'origin/development' into feat/vpp-compi…
marconetsf May 27, 2026
691b61c
fix(compiler): drive toolchain via argv + lint precompile boundary
marconetsf May 27, 2026
65e57b2
refactor(compiler): stash precompile sources up-front for crash recovery
marconetsf May 27, 2026
4caaa6e
perf(compiler): cap precompile parallelism at os.cpus().length
marconetsf May 27, 2026
65232c2
fix(compiler): hard-fail when toolchain exposes no arch subdir property
marconetsf May 27, 2026
97f4956
feat(compiler): emit Modbus defines from the VPP screen for Arduino b…
marconetsf May 27, 2026
004c3d5
fix(compiler): unbreak Modbus TCP build on VPP Arduino boards (ESP826…
marconetsf May 28, 2026
2aa28d0
feat(vendor-screen): honor password, ip-address, mac-address field ty…
marconetsf May 28, 2026
dac9585
feat(devices-dropdown): group boards by source VPP package, built-ins…
marconetsf May 28, 2026
5792a4e
feat(package-manager): add VPP catalog browser with version action menu
marconetsf May 28, 2026
64863b5
feat(package-manager): isolate VPP catalog mock behind USE_LOCAL_MOCK…
marconetsf May 28, 2026
7e5d839
feat(package-manager): wire VPP catalog to real CDN backend
marconetsf May 29, 2026
516d21b
fix(compiler): inject -I{core,variant} into precompile so c_blocks_co…
marconetsf May 29, 2026
4d14ecc
fix(c-blocks): undef Arduino min/max macros before strucpp headers
marconetsf May 29, 2026
485ac14
feat(vpp): map GPIO pin-mapping to runtime-v4 plugin config
marconetsf May 29, 2026
9b36823
feat(package-manager): verify VPP Ed25519 signature before import
marconetsf Jun 1, 2026
0034040
feat(package-manager): surface import/uninstall failures in a modal
marconetsf Jun 1, 2026
9abc3cd
style(package-manager): apply prettier to signature verifier
marconetsf Jun 1, 2026
6adea2a
refactor(package-manager): move trusted-keys to the shared surface
marconetsf Jun 1, 2026
b2544dc
Merge branch 'development' into feat/vpp-package-signing
marconetsf Jun 2, 2026
b4b0281
Merge vpp work onto development with shared-zone BoardInfoResolver
thiagoralves Jun 2, 2026
38c61a3
Merge branch 'development' into feat/vpp-package-signing
marconetsf Jun 2, 2026
fbfa5b8
fix(package-manager): reject symlinks/non-regular entries when verifying
marconetsf Jun 2, 2026
a7d4715
fix(compile): read board HAL via boardInfo.halSourceFile (covers VPP …
thiagoralves Jun 2, 2026
a8c6ad9
fix(compile): unblock Arduino upload + drop the redundant compileOnly…
thiagoralves Jun 2, 2026
26e9a7a
feat(device-dropdown): group boards by vendor with searchable filter
thiagoralves Jun 2, 2026
0ebae1f
refactor(dropdown): extract DropdownSearchInput atom, use in device d…
thiagoralves Jun 2, 2026
7e3e7e0
fix(device-dropdown): vendor heading + first-keystroke focus loss
thiagoralves Jun 2, 2026
f2247b1
fix(select): add disableTypeahead prop, use on device dropdown
thiagoralves Jun 2, 2026
eff15d2
debug(dropdown-search): instrument focus + keydown to track the steal
thiagoralves Jun 2, 2026
c1b65cc
fix(device-dropdown): restore input focus after filter unmounts check…
thiagoralves Jun 2, 2026
243bea3
debug+fix(device-dropdown): catch Radix's focus-out via native focuso…
thiagoralves Jun 2, 2026
b1052d8
chore(dropdown-search): strip diagnostic logs + speculative interceptors
thiagoralves Jun 2, 2026
7c0d466
feat(debugger): VPP-owned debug-channel resolution via declarative De…
thiagoralves Jun 2, 2026
0d00598
fix(compile): thread vppModbusState into runCompilePipeline + drop de…
thiagoralves Jun 2, 2026
73ccf8a
fix(precompile): order `-I avr-libstdcpp` before core/variant -I's
thiagoralves Jun 3, 2026
ba99566
fix(variables-table): scope location dropdown by active target capabi…
thiagoralves Jun 3, 2026
81220fc
fix(pin-mapping): scope pins per target board (preserve on switch)
thiagoralves Jun 3, 2026
2db529e
fix(vpp-screen): honor conditional visibility + scope field DOM ids p…
marconetsf Jun 3, 2026
db29c3d
Merge fix/vpp-modbus-screen-ui: VPP Modbus screen conditional visibil…
marconetsf Jun 3, 2026
9ffa7bf
Merge branch 'development' into feat/vpp-package-signing
marconetsf Jun 3, 2026
3b6282f
feat(vpp-screen): expandable cards + toggle switches for form sections
marconetsf Jun 3, 2026
d092bf4
Merge feat/vpp-modbus-screen-cards: expandable cards + toggle switche…
marconetsf Jun 3, 2026
e530e81
Merge branch 'feat/vpp-on-dev' into feat/vpp-compile-pipeline-port
thiagoralves Jun 3, 2026
ede53bb
fix(vpp-screen): widen form-layout label to fit long field names
thiagoralves Jun 3, 2026
c726fed
fix(vendor-screen): mark workspace dirty synchronously on screen edit
thiagoralves Jun 3, 2026
b9f3d10
fix(build): always save full project before build/debug, drop per-act…
thiagoralves Jun 3, 2026
5494a4f
Merge remote-tracking branch 'origin/feat/vpp-package-signing' into f…
thiagoralves Jun 3, 2026
8f76fec
fix(package-manager): wire openModal in PackageManagerEditor
thiagoralves Jun 3, 2026
5d385aa
feat(start-screen): per-project 3-dot menu (remove from list / delete…
thiagoralves Jun 3, 2026
64dbc24
fix(start-screen): 3-dot menu always visible, anchored to folder body
thiagoralves Jun 3, 2026
8ee017f
chore(format): apply prettier to 5 files flagged by CI
thiagoralves Jun 3, 2026
a5470e8
Merge remote-tracking branch 'origin/development' into feat/vpp-compi…
thiagoralves Jun 3, 2026
ab4123e
test+chore: close coverage gaps on touched files, fix vi.hoisted test
thiagoralves Jun 3, 2026
68b5810
refactor(compile): extract resolveBoardSelection into shared step
thiagoralves Jun 3, 2026
7e8e2c6
fix(compile): handle per-board pin-mapping dict shape
thiagoralves Jun 4, 2026
34d4c1e
Merge remote-tracking branch 'origin/development' into feat/vpp-compi…
thiagoralves Jun 4, 2026
7acbd06
chore: gate vitest-only test out of jest, resolve build-save conflict
thiagoralves Jun 4, 2026
99a604e
chore(ui): rename "Add from the internet" → "Add from catalog"
thiagoralves Jun 4, 2026
bfb3c0c
feat(vpp): Arduino Opta VPP rewrite + per-board libraries + REAL I/O
thiagoralves Jun 4, 2026
24565d4
fix(ui): package-manager selection cue + alias re-pick + console auto…
thiagoralves Jun 4, 2026
65be936
fix(rename): drop "main" POU restriction + carry LD/FBD rungs through…
thiagoralves Jun 4, 2026
e796b3e
chore(lint): underscore-prefix unused reject in handleLibraryInstalla…
thiagoralves Jun 4, 2026
4074842
chore(lint): autofix simple-import-sort/imports on shared pipeline
thiagoralves Jun 4, 2026
c8f9342
chore(format): prettier-normalize the vpp_config.h conditional
thiagoralves Jun 4, 2026
14c4a7c
chore(format): prettier sweep on the VPP work
thiagoralves Jun 4, 2026
69352ba
Merge branch 'development' into feat/vpp-compile-pipeline-port
thiagoralves Jun 4, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 3 additions & 7 deletions jest.config.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,9 @@
"testEnvironmentOptions": {
"url": "http://localhost/"
},
"testMatch": [
"<rootDir>/src/**/?(*.)+(spec|test).(ts|tsx)",
"<rootDir>/src/**/__tests__/**/*.(ts|tsx)"
],
"transformIgnorePatterns": [
"node_modules/(?!strucpp)"
],
"testMatch": ["<rootDir>/src/**/?(*.)+(spec|test).(ts|tsx)", "<rootDir>/src/**/__tests__/**/*.(ts|tsx)"],
"testPathIgnorePatterns": ["/node_modules/", "src/frontend/utils/__tests__/notify-no-write-permission.test.ts"],
"transformIgnorePatterns": ["node_modules/(?!strucpp)"],
"transform": {
"\\.(ts|tsx|js|jsx)$": [
"ts-jest",
Expand Down
18 changes: 17 additions & 1 deletion resources/sources/Baremetal/Baremetal.ino
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,11 @@
#undef abs
#undef round

// Triggers arduino-cli's library discovery for the OpenPLCUserLib precompiled
// archive. Without this include arduino-cli still finds the library on disk
// but skips linking against the .a (no header match in the sketch).
#include <OpenPLCUserLib.h>

#include "openplc.h"
#include "defines.h"
#include "arduino_runtime_glue.h"
Expand All @@ -39,12 +44,16 @@
#endif

// ---------------------------------------------------------------------------
// AVR: provide sized operator delete (virtual destructors generate this)
// AVR: provide sized operator delete (virtual destructors generate this).
// Non-AVR libstdc++ already declares operator delete(void*, size_t) noexcept;
// redeclaring here causes a signature mismatch on ARM/mbed cores.
// ---------------------------------------------------------------------------
#ifdef __AVR__
void operator delete(void* ptr, unsigned int)
{
free(ptr);
}
#endif

// ---------------------------------------------------------------------------
// I/O Buffer definitions (declared extern in openplc.h, must be defined
Expand All @@ -56,6 +65,13 @@ IEC_BOOL *bool_output[MAX_DIGITAL_OUTPUT/8][8] = {};
IEC_UINT *int_input[MAX_ANALOG_INPUT] = {};
IEC_UINT *int_output[MAX_ANALOG_OUTPUT] = {};
#if !defined(__AVR_ATmega328P__) && !defined(__AVR_ATmega168__) && !defined(__AVR_ATmega32U4__) && !defined(__AVR_ATmega16U4__)
// REAL-typed I/O at %ID / %QD. Populated by `runtime_bind_located_vars`
// when the IEC program declares a REAL variable AT %ID<n> / %QD<n>.
// Drivers that want to deliver engineering-unit values (volts, mA, °C)
// instead of raw ADC counts write into these slots — the Opta HAL is
// the first consumer.
IEC_REAL *real_input[MAX_REAL_INPUT] = {};
IEC_REAL *real_output[MAX_REAL_OUTPUT] = {};
IEC_UINT *int_memory[MAX_MEMORY_WORD] = {};
IEC_UDINT *dint_memory[MAX_MEMORY_DWORD] = {};
IEC_ULINT *lint_memory[MAX_MEMORY_LWORD] = {};
Expand Down
26 changes: 16 additions & 10 deletions resources/sources/Baremetal/ModbusSlave.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@ Copyright (C) 2022 OpenPLC - Thiago Alves
*/

#include "ModbusSlave.h"
#include "debug_dispatch.hpp" // Phase 4 debugger — strucpp::debug::handle_*
// Debug surface comes via the extern "C" shims in arduino_runtime_glue.h
// (openplc_debug_*) so this TU stays free of strucpp template-heavy headers
// and compiles cleanly in arduino-cli's path with the core's default C++
// standard (gnu++14 on mbed and others). The shims forward to
// strucpp::debug::handle_* inside arduino_runtime_glue.cpp, which is part
// of the precompiled OpenPLCUserLib archive built with -std=gnu++17.
#include "arduino_runtime_glue.h"

//Global Modbus vars
struct MBinfo modbus;
Expand Down Expand Up @@ -1073,7 +1079,7 @@ void writeMultipleCoils(uint16_t startreg, uint16_t numoutputs, uint16_t bytecou
// Response: [FC, arrCount, STATUS_OK, (count×arrCount as u16 BE)]
void debugInfo()
{
uint8_t arrCount = strucpp::debug::handle_array_count();
uint8_t arrCount = openplc_debug_array_count();

// Cap at what the Modbus frame can hold: 3 header bytes + 2 bytes/array.
// Realistic projects have <=10 arrays, so this is never a real limit.
Expand All @@ -1086,7 +1092,7 @@ void debugInfo()
uint16_t pos = 4;
for (uint8_t i = 0; i < arrCount; i++)
{
uint16_t c = strucpp::debug::handle_elem_count(i);
uint16_t c = openplc_debug_elem_count(i);
mb_frame[pos++] = (uint8_t)(c >> 8);
mb_frame[pos++] = (uint8_t)(c & 0xFF);
}
Expand Down Expand Up @@ -1128,8 +1134,8 @@ void debugSetTrace(uint8_t arr, uint16_t elem, uint8_t flag,
return;
}

uint8_t status = strucpp::debug::handle_set(
arr, elem, (bool)flag, (const uint8_t *)value, len);
uint8_t status = openplc_debug_set(
arr, elem, (uint8_t)flag, (const uint8_t *)value, len);

mb_frame_len = 3;
mb_frame[1] = MB_FC_DEBUG_SET;
Expand Down Expand Up @@ -1162,7 +1168,7 @@ void debugSetTrace(uint8_t arr, uint16_t elem, uint8_t flag,
// size_hi, size_lo, data...]
void debugGetTrace(uint8_t arr, uint16_t startidx, uint16_t endidx)
{
uint16_t arrCount = strucpp::debug::handle_elem_count(arr);
uint16_t arrCount = openplc_debug_elem_count(arr);
if (arrCount == 0 || startidx >= arrCount ||
endidx >= arrCount || startidx > endidx)
{
Expand All @@ -1178,7 +1184,7 @@ void debugGetTrace(uint8_t arr, uint16_t startidx, uint16_t endidx)

for (uint16_t elem = startidx; elem <= endidx; elem++)
{
uint16_t varSize = strucpp::debug::handle_size(arr, elem);
uint16_t varSize = openplc_debug_size(arr, elem);
// Bounds check — stop packing if this one won't fit.
if ((11 + responseSize + varSize) > MAX_MB_FRAME) break;
if (varSize == 0) {
Expand All @@ -1187,7 +1193,7 @@ void debugGetTrace(uint8_t arr, uint16_t startidx, uint16_t endidx)
lastElemIdx = elem;
continue;
}
uint16_t n = strucpp::debug::handle_read(arr, elem, responsePtr);
uint16_t n = openplc_debug_read(arr, elem, responsePtr);
if (n == 0) {
lastElemIdx = elem;
continue;
Expand Down Expand Up @@ -1272,7 +1278,7 @@ void debugGetTraceList(uint16_t numIndexes, uint8_t *indexArray)
uint16_t elem = (uint16_t)localIndex[i * 3 + 1] << 8 |
(uint16_t)localIndex[i * 3 + 2];

uint16_t varSize = strucpp::debug::handle_size(arr, elem);
uint16_t varSize = openplc_debug_size(arr, elem);
if (varSize == 0)
{
// Out-of-bounds or string stub — skip gracefully.
Expand All @@ -1281,7 +1287,7 @@ void debugGetTraceList(uint16_t numIndexes, uint8_t *indexArray)
}
if ((response_idx + varSize) > MAX_MB_FRAME) break;

uint16_t n = strucpp::debug::handle_read(arr, elem, &mb_frame[response_idx]);
uint16_t n = openplc_debug_read(arr, elem, &mb_frame[response_idx]);
if (n == 0)
{
lastReqIdx = i;
Expand Down
8 changes: 4 additions & 4 deletions resources/sources/Baremetal/ModbusSlave.h
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ Copyright (C) 2022 OpenPLC - Thiago Alves
#include "Controllino.h"
#endif

// Scan-cycle counter defined by the Arduino sketch — reported in
// DEBUG_GET / DEBUG_GET_LIST responses so the editor can detect cycle
// boundaries.
extern uint32_t scan_counter;
// scan_counter is declared in arduino_runtime_glue.h with C linkage; the
// .cpp includes that header to bring the declaration into scope, so this
// file deliberately does NOT redeclare it (a second declaration would
// conflict with the C-linkage one and break the build).

// Status codes (match strucpp::debug::STATUS_* in debug_dispatch.hpp, kept
// as macros here so the Modbus layer doesn't have to include the C++
Expand Down
21 changes: 8 additions & 13 deletions resources/sources/Baremetal/c_blocks_code.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,14 @@
#undef max
#endif

// STruC++ runtime types — IEC_BOOL/IEC_INT/.../IEC_REAL all live under
// `namespace strucpp` as IECVar<T> wrappers. The auto-generated POU
// struct (emitted just below this preamble at compile time) refers to
// them as `strucpp::IEC_*` so the user's `*name = 5` write routes
// through `IECVar::operator=` and respects forcing on the IEC side.
//
// The user's setup() / loop() bodies meanwhile keep the historical
// raw-type aliases at file scope for any user-local variables
// (e.g. `IEC_INT my_temp = 0;` stays a plain int16_t). The struct
// field's `strucpp::IEC_INT*` resolves separately and never collides
// with these typedefs.
#include "iec_var.hpp"
#include "iec_string.hpp"
// Static baseline — compiled by arduino-cli in the core's native C++
// standard (gnu++11 on AVR, gnu++14 on mbed/Renesas, etc.), so it MUST
// stay free of strucpp template-heavy headers. The typedefs below are
// plain C — no namespace, no templates — and parse in every supported
// standard. When the user's project declares C/C++ blocks, the editor
// instead emits the dynamic version under <build>/<board>/src/, where
// the pre-compile pipeline picks it up with -std=gnu++17 and links it
// into the precompiled OpenPLCUserLib archive.

/*********************/
/* IEC Types defs */
Expand Down
54 changes: 52 additions & 2 deletions resources/sources/arduino/arduino_runtime_glue.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
#include "arduino_runtime_glue.h"
#include "openplc.h"
#include "generated.hpp"
#include "debug_dispatch.hpp"

// ---------------------------------------------------------------------------
// Storage
Expand Down Expand Up @@ -64,8 +65,18 @@ void runtime_bind_located_vars()
break;
#if !defined(__AVR_ATmega328P__) && !defined(__AVR_ATmega168__) && !defined(__AVR_ATmega32U4__) && !defined(__AVR_ATmega16U4__)
case LocatedSize::DWord:
// OpenPLC convention: %ID<n> is REAL. Drivers that
// deliver engineering-unit readings (volts, mA, °C, …)
// bind here instead of int_input. Declaring DINT AT
// %ID<n> is not supported on arduino-cli; the
// variable's bytes would still land in this slot but
// the runtime treats them as a float.
if (lv.byte_index < MAX_REAL_INPUT) {
real_input[lv.byte_index] = (::IEC_REAL*)lv.pointer;
}
break;
case LocatedSize::LWord:
// dint_input / lint_input not available on all boards
// lint_input not available on arduino-cli targets.
break;
#endif
default: break;
Expand All @@ -82,8 +93,15 @@ void runtime_bind_located_vars()
break;
#if !defined(__AVR_ATmega328P__) && !defined(__AVR_ATmega168__) && !defined(__AVR_ATmega32U4__) && !defined(__AVR_ATmega16U4__)
case LocatedSize::DWord:
// OpenPLC convention: %QD<n> is REAL. Drivers that
// accept engineering-unit setpoints (volts on an
// analog DAC, °C, …) bind here instead of int_output.
if (lv.byte_index < MAX_REAL_OUTPUT) {
real_output[lv.byte_index] = (::IEC_REAL*)lv.pointer;
}
break;
case LocatedSize::LWord:
// dint_output / lint_output not available on all boards
// lint_output not available on arduino-cli targets.
break;
#endif
default: break;
Expand Down Expand Up @@ -171,3 +189,35 @@ void runtime_plc_cycle()

strucpp::__CURRENT_TIME_NS += (int64_t)base_tick_ns;
}

// ---------------------------------------------------------------------------
// Debug dispatch shims — C-linkage wrappers around strucpp::debug::handle_*.
// Declared in arduino_runtime_glue.h; ModbusSlave.cpp calls these by name so
// it never has to include the strucpp template-heavy debug_dispatch.hpp.
// ---------------------------------------------------------------------------

extern "C" uint8_t openplc_debug_array_count()
{
return strucpp::debug::handle_array_count();
}

extern "C" uint16_t openplc_debug_elem_count(uint8_t arr)
{
return strucpp::debug::handle_elem_count(arr);
}

extern "C" uint16_t openplc_debug_size(uint8_t arr, uint16_t elem)
{
return strucpp::debug::handle_size(arr, elem);
}

extern "C" uint16_t openplc_debug_read(uint8_t arr, uint16_t elem, uint8_t* dest)
{
return strucpp::debug::handle_read(arr, elem, dest);
}

extern "C" uint8_t openplc_debug_set(uint8_t arr, uint16_t elem, uint8_t forcing,
const uint8_t* bytes, uint16_t len)
{
return strucpp::debug::handle_set(arr, elem, forcing != 0, bytes, len);
}
19 changes: 19 additions & 0 deletions resources/sources/arduino/arduino_runtime_glue.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,25 @@ void runtime_discover_tasks();
// Per-cycle helpers (call once per scan cycle from scheduler()/loop()).
void runtime_plc_cycle();

// ---------------------------------------------------------------------------
// Debug dispatch shims — extern "C" wrappers around strucpp::debug::handle_*.
//
// ModbusSlave.cpp used to include `debug_dispatch.hpp` directly to reach
// these calls, but that pulled the strucpp template-heavy headers into the
// sketch's TU (compiled by arduino-cli with the core's default C++ standard
// — typically gnu++14 on mbed). The strucpp runtime needs C++17, so the
// direct include broke every non-AVR build. Wrapping the surface here lets
// ModbusSlave.cpp speak plain C against a stable ABI while the actual
// strucpp invocations stay in arduino_runtime_glue.cpp, which is compiled
// into the precompiled OpenPLCUserLib archive with -std=gnu++17.
// ---------------------------------------------------------------------------

uint8_t openplc_debug_array_count(void);
uint16_t openplc_debug_elem_count(uint8_t arr);
uint16_t openplc_debug_size(uint8_t arr, uint16_t elem);
uint16_t openplc_debug_read(uint8_t arr, uint16_t elem, uint8_t* dest);
uint8_t openplc_debug_set(uint8_t arr, uint16_t elem, uint8_t forcing, const uint8_t* bytes, uint16_t len);

#ifdef __cplusplus
}
#endif
Expand Down
11 changes: 11 additions & 0 deletions resources/sources/arduino/openplc.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ extern IEC_UINT *int_output[MAX_ANALOG_OUTPUT];
#define MAX_DIGITAL_OUTPUT 56
#define MAX_ANALOG_INPUT 32
#define MAX_ANALOG_OUTPUT 32
#define MAX_REAL_INPUT 32
#define MAX_REAL_OUTPUT 32
#define MAX_MEMORY_WORD 20
#define MAX_MEMORY_DWORD 20
#define MAX_MEMORY_LWORD 20
Expand All @@ -57,6 +59,15 @@ extern IEC_BOOL *bool_input[MAX_DIGITAL_INPUT/8][8];
extern IEC_BOOL *bool_output[MAX_DIGITAL_OUTPUT/8][8];
extern IEC_UINT *int_input[MAX_ANALOG_INPUT];
extern IEC_UINT *int_output[MAX_ANALOG_OUTPUT];
/* REAL-typed I/O at %ID / %QD addresses. Convention follows OpenPLC:
* `%ID<n>` means a 32-bit REAL input at byte offset n. Modules whose
* driver wants to deliver engineering units (volts, mA, °C, …) rather
* than raw ADC counts bind to these — see the Arduino Opta HAL for
* the canonical example. Declaring `VAR AT %ID<n> : DINT` is not
* supported on arduino-cli targets; if you need integer values at %ID
* use %MD (memory) or %IW + manual scaling on the IEC side. */
extern IEC_REAL *real_input[MAX_REAL_INPUT];
extern IEC_REAL *real_output[MAX_REAL_OUTPUT];
extern IEC_UINT *int_memory[MAX_MEMORY_WORD];
extern IEC_UDINT *dint_memory[MAX_MEMORY_DWORD];
extern IEC_ULINT *lint_memory[MAX_MEMORY_LWORD];
Expand Down
19 changes: 19 additions & 0 deletions resources/sources/arduino/vpp_config.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// vpp_config.h — placeholder stub for non-VPP arduino-cli boards.
//
// VPP-enabled boards (Arduino Opta, P1AM, etc., declared `vppIo: true`
// in their package manifest) have this file overwritten at compile
// time by the editor's `generateVppConfigContent` step, populated with
// per-board configuration-screen #defines.
//
// Non-VPP boards leave this stub in place: HAL drivers can `#include
// "vpp_config.h"` unconditionally without needing per-target gating
// (the stub guarantees the include resolves; the macros it would
// define just aren't present, so any `#ifdef VPP_…` blocks compile
// out cleanly).

#ifndef VPP_CONFIG_H
#define VPP_CONFIG_H

// No VPP configuration is baked into this build.

#endif // VPP_CONFIG_H
Loading
Loading