diff --git a/src/memu/kbd_pico.c b/src/memu/kbd_pico.c index 991c25a..52fd4cf 100644 --- a/src/memu/kbd_pico.c +++ b/src/memu/kbd_pico.c @@ -2,13 +2,8 @@ #include #include -#include -// #include "types.h" #include "win.h" #include "diag.h" -// #include "vid.h" -// #include "mon.h" -// #include "memu.h" #include "kbd.h" #include "common.h" @@ -27,6 +22,8 @@ #define KBD_VERSION 3 #elif (TUSB_VERSION_MINOR == 14) | (TUSB_VERSION_MINOR == 15) #define KBD_VERSION 4 +#elif (TUSB_VERSION_MINOR == 17) +#define KBD_VERSION 5 #endif // TUSB_VERSION_MINOR #endif // TUSB_VERSION_MAJOR #endif // KBD_VERSION @@ -34,6 +31,12 @@ #error Unknown USB Version for keyboard #endif // KBD_VERSION +#if KBD_VERSION == 5 +#include "class/hid/hid_host.h" +#else +#include "class/hid/hid.h" +#endif + static const int usb_map[] = { 'a', // 0x04 - Keyboard a and A @@ -179,7 +182,7 @@ static void set_leds (uint8_t leds) }; #if KBD_VERSION == 3 bool bRes = tuh_control_xfer (kbd_addr, &ledreq, &led_flags, NULL); -#elif KBD_VERSION == 4 +#elif KBD_VERSION >= 4 tuh_xfer_t ledxfer = { .daddr = kbd_addr, .setup = &ledreq, @@ -445,7 +448,7 @@ void tuh_hid_report_received_cb(uint8_t dev_addr, uint8_t instance, uint8_t cons } } -#elif ( KBD_VERSION == 3 ) | ( KBD_VERSION == 4 ) +#elif ( KBD_VERSION >= 3 ) void hid_task (void) { static int n = 0; diff --git a/src/memu/sound.pio b/src/memu/sound.pio index cd58bbb..3ad35c8 100644 --- a/src/memu/sound.pio +++ b/src/memu/sound.pio @@ -5,15 +5,15 @@ ; .wrap_target set x, 14 side 0x01 ; Loop 15 times (decrement is after test) -left: +sleft: out pins, 1 side 0x00 ; Output left channel bits - jmp x--, left side 0x01 ; Loop + jmp x--, sleft side 0x01 ; Loop out pins, 1 side 0x02 ; Final bit with LRCK high ; set x, 14 side 0x03 ; Loop 15 times (decrement is after test) -right: +sright: out pins, 1 side 0x02 ; Output right channel bits - jmp x--, right side 0x03 ; Loop + jmp x--, sright side 0x03 ; Loop out pins, 1 side 0x00 ; Final bit with LRCK low .wrap ;