rk05: update register first to not overwrite it at function exit
This commit is contained in:
parent
b3fd4994a8
commit
edf94487af
1 changed files with 3 additions and 3 deletions
6
rk05.cpp
6
rk05.cpp
|
@ -149,6 +149,9 @@ void rk05::writeWord(const uint16_t addr, uint16_t v)
|
|||
const int reg = (addr - RK05_BASE) / 2;
|
||||
fprintf(stderr, "RK05 write %s/%o: %o\n", regnames[reg], addr, v);
|
||||
|
||||
D(fprintf(stderr, "set register %o to %o\n", addr, v);)
|
||||
registers[reg] = v;
|
||||
|
||||
if (addr == RK05_CS) {
|
||||
if (v & 1) { // GO
|
||||
const int func = (v >> 1) & 7; // FUNCTION
|
||||
|
@ -273,9 +276,6 @@ void rk05::writeWord(const uint16_t addr, uint16_t v)
|
|||
}
|
||||
}
|
||||
|
||||
D(fprintf(stderr, "set register %o to %o\n", addr, v);)
|
||||
registers[reg] = v;
|
||||
|
||||
#if defined(ESP32)
|
||||
digitalWrite(LED_BUILTIN, HIGH);
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue