diff --git a/firmware/.gitignore b/firmware/.gitignore new file mode 100644 index 0000000..9daeafb --- /dev/null +++ b/firmware/.gitignore @@ -0,0 +1 @@ +test diff --git a/firmware/Makefile b/firmware/Makefile index 5dc5f6c..9bdfe66 100644 --- a/firmware/Makefile +++ b/firmware/Makefile @@ -29,5 +29,5 @@ deploy: crt_emu_lpc11_13_nxp -g -2 -pLPC1343 -wire=winusb -flash-erase crt_emu_lpc11_13_nxp -g -2 -pLPC1343 -wire=winusb -flash-load=obj/$(NAME).axf -test: +test: test.c gcc test.c -o test -lusb-1.0 diff --git a/firmware/src/usbhidrom_main.c b/firmware/src/usbhidrom_main.c index 1345bd8..3ce9dbc 100644 --- a/firmware/src/usbhidrom_main.c +++ b/firmware/src/usbhidrom_main.c @@ -22,6 +22,8 @@ #include "rom_drivers.h" #include "config.h" +#include + #define EN_TIMER32_1 (1<<10) #define EN_IOCON (1<<16) #define EN_USBREG (1<<14) @@ -34,11 +36,11 @@ ROM ** rom = (ROM **)0x1fff1ff8; * Get HID Input Report -> InReport */ -volatile uint8_t buffer[8]; +static uint8_t buffer[64]; void GetInReport (uint8_t src[], uint32_t length) { - src[0] = buffer[0]; + memcpy(src, buffer, length); } /* @@ -46,7 +48,7 @@ void GetInReport (uint8_t src[], uint32_t length) */ void SetOutReport (uint8_t dst[], uint32_t length) { - buffer[0] = dst[0]; + memcpy(buffer, dst, length); } int main (void)