Skip to content

Commit 8eedc89

Browse files
authored
fix held ctrl-amiga-amiga (#37)
move CLK set high to amiga_release_reset disable key sending whilst in reset - which would change CLK state
1 parent a99a311 commit 8eedc89

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/platform/amiga/keyboard_serial_io.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,8 @@ void amiga_send(uint8_t keycode, bool up)
164164
amiga_release_reset();
165165
}
166166

167-
// copy input code, roll left, move msb to lsb
167+
if (!in_reset) {
168+
// copy input code, roll left, move msb to lsb
168169
sendcode = keycode | (up == true ? 0x80 : 0x00);
169170
sendcode <<= 1;
170171
if (up || (keycode & 0x80))
@@ -186,6 +187,7 @@ void amiga_send(uint8_t keycode, bool up)
186187
// shift the bit pattern for next iteration
187188
bit_mask >>= 1;
188189
}
190+
}
189191

190192
// set /dat to input for 5ms to signal end of key
191193
_keyboard_gpio_set(KBD_AMIGA_DAT, HIGH);
@@ -207,13 +209,13 @@ void amiga_assert_reset()
207209
// (thanks @reinauer for submitting this in issue #31 and testing on your a3000)
208210
_keyboard_gpio_set(KBD_AMIGA_CLK, LOW);
209211
sleep_us(500000);
210-
_keyboard_gpio_set(KBD_AMIGA_CLK, HIGH);
211212
}
212213

213214
void amiga_release_reset()
214215
{
215216
// ahprintf("[akb] *** RESET BEING RELEASED ***\n");
216217
_keyboard_gpio_set(KBD_AMIGA_RST, HIGH);
218+
_keyboard_gpio_set(KBD_AMIGA_CLK, HIGH);
217219
}
218220

219221
void amiga_service()

0 commit comments

Comments
 (0)