Skip to content

Fix generic spi graphics setup - #3287

Open
mikmog wants to merge 3 commits into
nanoframework:mainfrom
mikmog:fix-generic-spi-graphics-setup
Open

Fix generic spi graphics setup#3287
mikmog wants to merge 3 commits into
nanoframework:mainfrom
mikmog:fix-generic-spi-graphics-setup

Conversation

@mikmog

@mikmog mikmog commented Apr 6, 2026

Copy link
Copy Markdown
Contributor

Description

Fixes two issues in Generic_SPI graphic driver.

  • OS_DELAY cmd enum unintended use. Calculates wait in milliseconds. Cmd enum has value of 1.
  • SetupDisplayAttributes, Setting height for wrong side.

Motivation and Context

Discovered during development. Breakout to own PR.
General improvements and bug fixes.

How Has This Been Tested?

On an ESP32_S3 Feather and Ili9488 display

Screenshots

Types of changes

  • Improvement (non-breaking change that improves a feature, code or algorithm)
  • Bug fix (non-breaking change which fixes an issue with code or algorithm)
  • New feature (non-breaking change which adds functionality to code)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Config and build (change in the configuration and build system, has no impact on code or features)
  • Dev Containers (changes related with Dev Containers, has no impact on code or features)
  • Dependencies/declarations (update dependencies or assembly declarations and changes associated, has no impact on code or features)
  • Documentation (changes or updates in the documentation, has no impact on code or features)

Checklist

  • My code follows the code style of this project (only if there are changes in source code).
  • My changes require an update to the documentation (there are changes that require the docs website to be updated).
  • I have updated the documentation accordingly (the changes require an update on the docs in this repo).
  • I have read the CONTRIBUTING document.
  • I have tested everything locally and all new and existing tests passed (only if there are changes in source code).

@coderabbitai

coderabbitai Bot commented Apr 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited)

Review profile: ASSERTIVE

Plan: Team

Run ID: 40f58b60-a6ce-4d4e-a109-7135240ecce7

📥 Commits

Reviewing files that changed from the base of the PR and between f37471b and db04234.

📒 Files selected for processing (1)
  • src/nanoFramework.Graphics/Graphics/Displays/Generic_SPI.cpp

Included review availability: Your plan provides up to 2 included reviews per hour; 1 remains after this review.


📝 Summary

Summary by CodeRabbit

Bug Fixes

  • Corrected display dimension handling for configured screen heights.
  • Fixed display sleep timing calculations.

Walkthrough

This change fixes two SPI display driver issues. Sleep delays now use the command size directly. Configured display height now updates Attributes.ShorterSide.

Changes

SPI Display Driver Corrections

Layer / File(s) Summary
Sleep delay calculation
src/nanoFramework.Graphics/Graphics/Displays/Generic_SPI.cpp
ProcessCommand calculates sleep delays from *size without multiplying by the command byte.
Display attribute assignment
src/nanoFramework.Graphics/Graphics/Displays/Generic_SPI.cpp
The height fallback branch assigns configured height to Attributes.ShorterSide and removes the empty statement.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Merge Risk: ⚪ Minimal · up to db042

This updates Generic SPI display sleep timing and height assignment to use the intended values. The current change corrects both behaviors with no identified merge-blocking risk.

🚥 Pre-merge checks | ✅ 4
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Title check ✅ Passed The title is concise, descriptive, under 50 characters, and accurately summarizes the Generic SPI graphics fixes. It does not reference another PR or issue and does not end with a full stop.
Description check ✅ Passed The description clearly relates to the changeset. It identifies both Generic_SPI driver fixes and includes testing information.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@josesimoes josesimoes added the Area: Common libs Everything related with common libraries label Apr 6, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes two correctness issues in the Generic_SPI display driver so that generic SPI-based display initialization behaves as intended (sleep delays actually delay, and configured dimensions map to the correct attribute side).

Changes:

  • Fix sleep-delay handling in ProcessCommand() by removing unintended multiplication by the command enum value.
  • Fix SetupDisplayAttributes() to apply configured Height to Attributes.ShorterSide (and remove a stray semicolon).

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Ellerbach Ellerbach left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks, looks good

@coderabbitai

coderabbitai Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

Note

GitHub couldn't provide a complete incremental comparison for this pull request, so CodeRabbit is performing a full review instead. This review may take a little longer.

@josesimoes
josesimoes enabled auto-merge (squash) September 7, 2026 15:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Area: Common libs Everything related with common libraries Type: bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants