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

Add raw random noise example #108

Merged
merged 2 commits into from
Feb 12, 2020
Merged

Add raw random noise example #108

merged 2 commits into from
Feb 12, 2020

Conversation

jamwaffles
Copy link
Collaborator

@jamwaffles jamwaffles commented Feb 12, 2020

Hi! Thank you for helping out with SSD1306 development! Please:

  • Check that you've added documentation to any new methods
  • Rebase from master if you're not already up to date
  • Add or modify an example if there are changes to the public API
  • Add a CHANGELOG.md entry in the Unreleased section under the appropriate heading (Added, Fixed, Changed, etc)
  • Run rustfmt on the project with cargo fmt --all - CI will not pass without this step
  • Check that your branch is up to date with master and that CI is passing once the PR is opened

PR description

This is the result of an email discussion with @nebelgrau77 who is asking for assistance sending raw bytes to the display, without using GraphicsMode, etc. The example emulates an old TV with a white noise effect using random crap from the rand crate in no-std mode.

@jamwaffles jamwaffles marked this pull request as ready for review February 12, 2020 12:47
@jamwaffles
Copy link
Collaborator Author

@therealprof This raises the question of moving some common stuff in the crate like initialisation routines into a trait so that all modes (including RawMode can use them). Let's leave that for another PR, but it's food for thought.

@therealprof
Copy link
Collaborator

@jamwaffles Yes, I'm very up for that. Also we might want to reconsider the use of traits and maybe move to a simple enum instead for better code optimisation.

Comment on lines +22 to +25
extern crate cortex_m;
extern crate cortex_m_rt as rt;
extern crate panic_semihosting;
extern crate stm32f1xx_hal as hal;
Copy link
Collaborator

Choose a reason for hiding this comment

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

It would be great if we could slowly move to edition 2018 code. 😅

I also don't quite see the point of using semihosting in examples like this which only adds another stumbling block without any benefits.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yeah I want to upgrade all the examples in one big PR. Those imports are bugging me.

I also don't quite see the point of using semihosting in examples like this

What would be a better panic_* to use in your opinion?

Copy link
Collaborator

Choose a reason for hiding this comment

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

panic_halt or panic_abort.

Copy link
Collaborator

@therealprof therealprof left a comment

Choose a reason for hiding this comment

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

Other than those nits which we can also address separately, this looks good to me.

@therealprof
Copy link
Collaborator

Hm, I thought you re-enabled the regular merge feature? I can only squash and merge.

@jamwaffles
Copy link
Collaborator Author

Hm, I thought you re-enabled the regular merge feature? I can only squash and merge.

Hasn't that always been the case? At any rate, that's what I'd prefer to do anyway.

@jamwaffles jamwaffles merged commit ec608a7 into master Feb 12, 2020
@jamwaffles jamwaffles deleted the white-noise-example branch February 12, 2020 13:55
@therealprof
Copy link
Collaborator

Hasn't that always been the case? At any rate, that's what I'd prefer to do anyway.

Rewriting the commits and autosquashing it means you're causing problems for people with work-in-progress stuff. I was hoping that the setting I recently recommended would only prevent merges of PRs with merges in them which is the bad stuff, but it seems it disables all merge commits.

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.

2 participants