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

Fix blocking::Display::set_refresh_rate() #128

Merged
merged 1 commit into from
Feb 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased]

- Fix the `blocking::Display::set_refresh_rate` calculation for the micro:bit V2
- Double the non-blocking display refresh frequency for the micro:bit V2
- Fix faulty doc test in `blocking.rs`
- Update the non-blocking display documentation to better explain when methods
Expand Down
2 changes: 1 addition & 1 deletion microbit-common/src/display/blocking.rs
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ impl Display {

/// Set refresh rate, time for matrix scan
pub fn set_refresh_rate(&mut self, freq_hz: u32) {
self.delay_ms = 1000 / freq_hz / 3;
self.delay_ms = 1000 / freq_hz / (NUM_ROWS as u32);
}

/// Convert 5x5 image to 3x9 matrix
Expand Down
Loading