Skip to content

Adding LCD test files.#58

Merged
vs-pp merged 1 commit intocomcard_v2_cifrom
vs_jan13
Jan 14, 2026
Merged

Adding LCD test files.#58
vs-pp merged 1 commit intocomcard_v2_cifrom
vs_jan13

Conversation

@vs-pp
Copy link

@vs-pp vs-pp commented Jan 14, 2026

Note

Introduces initial SPI-based support and test utilities for an ILI9488 TFT display using Circuits.GPIO/SPI.

  • New TFTTest reads key registers (0x04, 0x09, 0x0A, 0x0B, 0x0C) and writes MADCTL to verify communication and rotation
  • New Ili9488 driver: reset + two init sequences (primary new_init_display), sets RGB666 mode, memory access control, and turns on display
  • Provides fill helpers (fill_red/green/blue/white) and rectangle draw (test_rect) using window set + MEMORY_WRITE
  • SPI/GPIO setup for C2 V2 (with commented BBB pins), start/close lifecycle, and chunked pixel writes for large transfers

Written by Cursor Bugbot for commit eca9210. This will update automatically on new commits. Configure here.

@vs-pp vs-pp merged commit 6e148f0 into comcard_v2_ci Jan 14, 2026
2 checks passed
Copy link

@cursor cursor bot left a comment

Choose a reason for hiding this comment

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

This is the final PR Bugbot will review for you during this billing cycle

Your free Bugbot reviews will reset on January 19

Details

Your team is on the Bugbot Free tier. On this plan, Bugbot will review limited PRs each billing cycle for each member of your team.

To receive Bugbot reviews on all of your PRs, visit the Cursor dashboard to activate Pro and start your 14-day free trial.

"""
def start do
# Open SPI (bus "spidev0.0" or adjust if different)
{:ok, spi} = Circuits.SPI.open("spidev1.0", @spi_opts)
Copy link

Choose a reason for hiding this comment

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

Module attribute defined but not used for SPI

Low Severity

The @spi_device module attribute is defined on line 9 but not used. The Circuits.SPI.open call uses a hardcoded string "spidev1.0" instead of @spi_device. This means changing @spi_device to switch between board configurations has no effect on the actual SPI device opened. The companion file tft_spi_ili9488.ex correctly uses @spi_device.

Fix in Cursor Fix in Web

defp send_pixels(devs, pixel, pixels_left, chunk_pixels) do
count = min(pixels_left, chunk_pixels)
chunk = :binary.copy(pixel, count)
safe_send_data(devs, chunk)
Copy link

Choose a reason for hiding this comment

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

SPI error return value silently discarded in pixel loop

Medium Severity

The safe_send_data function catches SPI errors and returns {:error, e} to signal failure, but send_pixels at line 178 completely ignores this return value. When an SPI transfer fails, the error is silently swallowed and the loop continues sending subsequent chunks. The overall fill_color operation always returns :ok even if pixel data failed to transfer, making it impossible for callers to detect partial or failed screen updates.

Additional Locations (1)

Fix in Cursor Fix in Web

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant