Skip to content
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

uc8151: add FillRectangle() and SetScroll() functions to satisfy tinyterm.Displayer interface #711

Merged
merged 1 commit into from
Oct 27, 2024

Conversation

deadprogram
Copy link
Member

This PR adds to the uc8151 display by implementing the FillRectangle() and SetScroll() functions in order to satisfy the tinyterm.Displayer interface.

@deadprogram
Copy link
Member Author

Once this can get merged, I have some related changes to tinyterm that allows it to work on the badger2040 display.

Copy link

@ydnar ydnar left a comment

Choose a reason for hiding this comment

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

Do you want to add an assertion that it satisfies the interface?

@deadprogram
Copy link
Member Author

@ydnar what would be the best way to do that? The interface is defined in package that consumes this package here: https://github.com/tinygo-org/tinyterm/blob/release/tinyterm.go#L27

@ydnar
Copy link

ydnar commented Oct 27, 2024

@ydnar what would be the best way to do that? The interface is defined in package that consumes this package here: https://github.com/tinygo-org/tinyterm/blob/release/tinyterm.go#L27

Can you define it elsewhere and have tinyterm import that and alias it?

@ydnar
Copy link

ydnar commented Oct 27, 2024

Seems like a big lift for little value...

@deadprogram
Copy link
Member Author

I'll think about a way to do it in a future PR. Thanks for review @ydnar now merging.

@deadprogram deadprogram merged commit f12454d into dev Oct 27, 2024
1 check passed
@deadprogram deadprogram deleted the uc8151-fill-rect branch October 27, 2024 23:23
Comment on lines +505 to +508
// SetScroll sets the vertical scrolling for the display, which is a NOP for this display.
func (d *Device) SetScroll(line int16) {
return
}
Copy link
Member

Choose a reason for hiding this comment

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

You have a program that calls SetScroll without first calling SetScrollArea? I think that won't work on other displays like ST7789.

Copy link
Member Author

Choose a reason for hiding this comment

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

This is for interface compatibility with tinyterm which does not call SetScrollArea(). See https://github.com/tinygo-org/tinyterm/blob/release/tinyterm.go#L27-L31

Actually, in the case of the uc8151 tinyterm only uses the software scroll, which is why the implementation here just returns without doing anything.

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.

3 participants