Repository navigation
A shift brings one column per step and ends with the space behind its char - #151
Merged
Merged
Conversation
… char The reference promises that a shifting char or text comes in until its last char stands at the right edge, and gives the shift interval as the time per column. The first step of a char brought two of its columns at once, the step that ended a char one more empty column, and the end of a text another: "Hi" stopped with three empty columns at the right edge, a single char with two. As decided, every char now comes in one column per step with the space behind it and no more, so that chars shifted one after another keep their distance; a text ends once the space behind its last char has come in, in a call that shifts nothing. The reference says so. Reading the next char in the step that ends a char instead ended a text without that call, but avr-gcc kept the reading out of line for its second caller, 46 to 64 bytes of flash; as built, the examples that shift text are 14 to 20 bytes smaller. The tests that pinned the old steps follow, the pace of a shift among them, and the panels of ScrollText and Messages at their time in simavr, each the same text one column behind. RightEdge() and ShiftUntilReady() moved into the test support, as the tests of the text use them too.
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.
What changes for a user
A char or a text that shifts in now moves one column per step, from the first step on. Each char brings the space behind it and no more, so chars shifted in one after another keep their distance. A text ends once the space behind its last char has come in.
Before, the shift did not keep what the reference promised: that the shift interval is the time per column, and that the last char ends at the right edge.
"Hi" stopped with three empty columns at the right edge, a single char with two. Now each stops with the one space behind its last char, and the reference says so.
The moving examples change accordingly: in simavr, ScrollText and Messages show the same text one column behind at the same moment.
Why
OIL 41, the chapter Tests: rewriting the tests of other chain lengths, the first test that wrote the end of a shift down found that the code and the reference disagreed. As decided, a char brings its space and nothing more.
How it was checked
New tests, each failing before the fix:
The tests that pinned the old steps follow the new ones: the pace of a shift, the step count of a repeating text, and where a wide char ends. So do the expected panels of ScrollText and Messages, each looked at.
make checkpasses, with coverage at 100 % of lines, branches and conditions, and every example in simavr.Flash on the Uno, main → this branch, in bytes; RAM is unchanged:
A text now ends in a call that shifts nothing, after the step that brought its last space. Ending it in that step instead would have needed a second call of the function that reads the next char, which avr-gcc then kept out of line: 46 to 64 bytes more. Nothing touches the transfer code.