diff options
author | Pavel Pisa <pisa@cmp.felk.cvut.cz> | 2019-03-13 13:54:32 +0100 |
---|---|---|
committer | Pavel Pisa <pisa@cmp.felk.cvut.cz> | 2019-03-13 13:54:32 +0100 |
commit | 0765d399e56aa387674c3591ec4886cc37d8fccd (patch) | |
tree | e71435ec20b57d8d8a3099750a80adc261c4993e /qtmips_machine/peripspiled.cpp | |
parent | 4637416160771a6357bd8bebf61626ca599c500b (diff) | |
download | qtmips-0765d399e56aa387674c3591ec4886cc37d8fccd.tar.gz qtmips-0765d399e56aa387674c3591ec4886cc37d8fccd.tar.bz2 qtmips-0765d399e56aa387674c3591ec4886cc37d8fccd.zip |
Allow byte and half-word access to the peripherals.
Signed-off-by: Pavel Pisa <pisa@cmp.felk.cvut.cz>
Diffstat (limited to 'qtmips_machine/peripspiled.cpp')
-rw-r--r-- | qtmips_machine/peripspiled.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/qtmips_machine/peripspiled.cpp b/qtmips_machine/peripspiled.cpp index c4333e7..0404311 100644 --- a/qtmips_machine/peripspiled.cpp +++ b/qtmips_machine/peripspiled.cpp @@ -64,7 +64,7 @@ bool PeripSpiLed::wword(std::uint32_t address, std::uint32_t value) { printf("PeripSpiLed::wword address 0x%08lx data 0x%08lx\n", (unsigned long)address, (unsigned long)value); #endif - switch (address) { + switch (address & ~3) { case SPILED_REG_LED_LINE_o: spiled_reg_led_line = value; emit led_line_changed(value); @@ -90,7 +90,7 @@ std::uint32_t PeripSpiLed::rword(std::uint32_t address, bool debug_access) const (void)debug_access; std::uint32_t value = 0x00000000; - switch (address) { + switch (address & ~3) { case SPILED_REG_LED_LINE_o: value = spiled_reg_led_line; break; |