Skip to content

Commit

Permalink
capsules: sh1106: fix initial page calculation
Browse files Browse the repository at this point in the history
  • Loading branch information
bradjc committed Mar 31, 2024
1 parent 2fa3c49 commit 665fdb0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion capsules/extra/src/sh1106.rs
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ impl<'a, I: hil::i2c::I2CDevice> Sh1106<'a, I> {
self.write_buffer.map_or(Err(ErrorCode::NOMEM), |data| {
// Calculate which part of the data buffer we need to
// write.
let start_page_index = self.active_frame_x.get() / 8;
let start_page_index = self.active_frame_y.get() / 8;
let buffer_start_index = ((page_index - start_page_index) as usize)
* self.active_frame_width.get() as usize;
let page_len = self.active_frame_width.get() as usize;
Expand Down

0 comments on commit 665fdb0

Please sign in to comment.