Repository navigation
OIL 41, chapter Functions: host code written out twice is one function - #125
Merged
Merged
Conversation
The loops that send all and read what has arrived, of the control program's serial port on Linux and its TCP port, are ControlStream's. How a run of either simulator starts and ends, with the chain every example has and the exit codes, is SimulatorRun's; reading a whole file, for the page and --expect, SimulatorFile's; and the test whether a connection is gone SimulatorSocket's, for both hosts. The window makes each line from its fields in one place, the front end says a port is taken in one, and DocuPictures has its pattern and the panel's height once. Left as they are, with the reason in OIL.md: the hosts' Begin(), the accept loops and SimulatorAvr's notifies. The library and its sizes do not change.
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.
Nothing changes for a sketch or for whoever uses the simulator or the control program: the same commands, the same messages, the same exit codes. The library is untouched, and every example has the same flash and RAM as on main.
The second pull request of the review of the chapter Functions in OIL item 41, for FN-13 of the coding style: what the host code did alike in two or more places is one function now, so that a fix to it is made once.
.elf, started and ended a run the same way: the pins and length of the chain every example has, the command line, the result and the exit code.--expect; whether a connection is gone was tested the same way in both hosts; the window made the same line from its fields in two places each; the front end said a port is taken twice;DocuPictureswrote its pattern and the panel's height more than once.Left as they are, with the reason in OIL.md: the two hosts' start, one shared call and a check; their accept loops, whose bodies differ; and the simulator's seven registrations with simavr, which a helper would only turn into two numbers side by side that a caller could swap.
Checked:
make checkpasses: lint, clang-tidy, every host and AVR test, coverage at 100 % of lines, branches and conditions; the simulator's and the control program's own tests run the changed code.