Skip to content

Commit

Permalink
Memory size should be multiplied by register size
Browse files Browse the repository at this point in the history
  • Loading branch information
golemparts committed Oct 12, 2023
1 parent 95ca188 commit beea319
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/gpio/gpiomem/rp1.rs
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,11 @@ const GPIO_STATUS: usize = 0x0000;
const GPIO_CTRL: usize = 0x0004;

// rp1-gpiomem contains IO_BANK0-2, SYS_RIO0-2, PADS_BANK0-2, PADS_ETH
const MEM_SIZE: usize = 0x30000;
const MEM_SIZE: usize = 0x30000 * std::mem::size_of::<u32>();

// We'll only be working with IO_BANK0 and PADS_BANK0
const IO_BANK0_OFFSET: usize = 0x00;
const PADS_BANK0_OFFST: usize = 0x20000;
const PADS_BANK0_OFFSET: usize = 0x20000;

pub struct GpioMem {
mem_ptr: *mut u32,
Expand Down

0 comments on commit beea319

Please sign in to comment.