Skip to content

tests/drivers/disp_dev: fix off by one in display area #19844

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 23, 2023

Conversation

aabadie
Copy link
Contributor

@aabadie aabadie commented Jul 22, 2023

Contribution description

This PR fixes a bug that was introduced in #17921. Especially this change:

- disp_dev_map(
-    disp_dev->dev,
-    ((max_width - RIOT_LOGO_WIDTH) >> 1), ((max_width + RIOT_LOGO_WIDTH) >> 1) - 1,
-    ((max_height - RIOT_LOGO_HEIGHT) >> 1), ((max_height + RIOT_LOGO_HEIGHT) >> 1) - 1,
-    (const uint16_t *)picture
-);
+ area.x1 = ((max_width - RIOT_LOGO_WIDTH) >> 1);
+ area.x2 = ((max_width + RIOT_LOGO_WIDTH) >> 1);
+ area.y1 = ((max_height - RIOT_LOGO_HEIGHT) >> 1);
+ area.y2 = ((max_height + RIOT_LOGO_HEIGHT) >> 1);
+ disp_dev_map(disp_dev->dev, &area, (const uint16_t *)picture);

a -1 was removed from the x2 and y2 coordinates which leads to a bad display of the RIOT logo (it looks shifted).

Testing procedure

On the adafruit-clue I can reproduce the bug (and also on stm32f429i-disc1). This PR fixes it (at least on adafruit-clue).

Issues/PRs references

Bug introduced in #17921

@aabadie aabadie added the Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors) label Jul 22, 2023
@github-actions github-actions bot added the Area: tests Area: tests and testing framework label Jul 22, 2023
@aabadie aabadie added the CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR label Jul 22, 2023
@riot-ci
Copy link

riot-ci commented Jul 22, 2023

Murdock results

✔️ PASSED

4055a0d tests/drivers/disp_dev: fix off by one in display area

Success Failures Total Runtime
17 0 17 01m:04s

Artifacts

@maribu
Copy link
Member

maribu commented Jul 23, 2023

bors merge

@bors
Copy link
Contributor

bors bot commented Jul 23, 2023

Build succeeded!

The publicly hosted instance of bors-ng is deprecated and will go away soon.

If you want to self-host your own instance, instructions are here.
For more help, visit the forum.

If you want to switch to GitHub's built-in merge queue, visit their help page.

@bors bors bot merged commit 6830419 into RIOT-OS:master Jul 23, 2023
@aabadie aabadie deleted the pr/tests/disp_dev_off branch July 23, 2023 16:08
@MrKevinWeiss MrKevinWeiss added this to the Release 2023.10 milestone Nov 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Area: tests Area: tests and testing framework CI: ready for build If set, CI server will compile all applications for all available boards for the labeled PR Type: bug The issue reports a bug / The PR fixes a bug (including spelling errors)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants