Repository navigation
fix: Arduino-IDE prototypes, INPUT_PULLUP, and documented simulator limits - #252
Merged
Merged
Conversation
The local build put every generated prototype at the top of the file. A prototype whose signature uses a typedef or a constant (Vektor add(Vektor, Vektor), void f(double m[M][N])) then failed, and a function with default arguments failed with "redefinition of default argument", although the Arduino compiler accepted the sketch. Prototypes now go directly before the first function the sketch itself defines (after inlined headers) and leave out default arguments. Comments are masked with the existing offset-preserving helper. The two builder tests that required the prototypes above the user-code marker now require them before the first function definition (approved by the user). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pinMode(pin, INPUT_PULLUP) now drives the simulated pin HIGH, as the internal pull-up resistor of the Uno does, and reports the value to the board view. Before, an open input read LOW as if a button were pressed. A toolchain integration test runs real sketches through the builder and g++ and covers the pull-up, a typedef signature, and a header with constant array sizes and default arguments. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The user guide gets a section "Grenzen der Simulation" for students and teachers: int and unsigned int are 32 bits, long and double 64 bits, sizeof, float printing without precision, parseInt without timeout, loop speed, memory size and random(). The changelog notes both fixes and points operators to the section. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
fine |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
typedeftypes in signatures (Vektor add(Vektor, Vektor)), constant array sizes (void f(double m[M][N])) or default arguments compiled with arduino-cli but failed in the local g++ build. These patterns appear in the course slides IT08 and IT11.INPUT_PULLUPreads HIGH.pinMode(pin, INPUT_PULLUP)drives the simulated pin HIGH and reports it to the board view; before, an open input read LOW as if a button were pressed. The board toggle derives the new value from the reported state, so clicking still toggles to LOW.int, 64-bitlong/double,sizeof, float printing without precision,parseIntwithout timeout, loop speed, memory,random()); CHANGELOG entries for both fixes.Tests
sketch-prototypes.test.tsand builder cases (typedef, array constants, default arguments, header). Two existing builder tests changed their position assertion from "before the user-code marker" to "before the first function definition" (approved by the maintainer).sketch-runtime-fidelity.test.tsbuilds and runs real sketches with g++ (pull-up, typedef signature, header with constant sizes and defaults)../run-tests.sh: all steps green (unit 3103, toolchain 17, Docker 32, E2E 28, production build, audit). SonarQube was not available locally.Note
The E2E test
03_compiler_cli_success_contextexpects English arduino-cli output. With an emptyLANGon a German macOS, arduino-cli answers in German and the test fails; the result is also cached instorage/cache. Not changed here.🤖 Generated with Claude Code