chore: reimplement bus read/writes

This commit is contained in:
2022-04-08 16:48:43 -03:00
parent 37a360ec07
commit 80e714e2eb
11 changed files with 130 additions and 166 deletions

View File

@@ -123,12 +123,12 @@ fn DmaController(comptime id: u2) type {
var offset: u32 = 0;
if (self.cnt.transfer_type.read()) {
offset = @sizeOf(u32); // 32-bit Transfer
const word = bus.read32(self._sad);
bus.write32(self._dad, word);
const word = bus.read(u32, self._sad);
bus.write(u32, self._dad, word);
} else {
offset = @sizeOf(u16); // 16-bit Transfer
const halfword = bus.read16(self._sad);
bus.write16(self._dad, halfword);
const halfword = bus.read(u16, self._sad);
bus.write(u16, self._dad, halfword);
}
switch (sad_adj) {