I was checking a bit of code from the HID example which comes with USB Host Library, on mikroPascal for PIC32. Since I don't have the EasyPIC_Fusion_v7_for_PIC32 board, for which the example was written for, I couldn't test the HID mouse example as is.
To test if the mouse works, I copied pieces of this example into a new project and it turned out that X and Y movements were swapped and mixed with mouse buttons. The piece of code which handles this is
Code: Select all
procedure MouseReportReceived(reportData : ^byte);
var
arrCh : array[6] of byte;
i : byte;
begin
for i := 0 to 5 do
begin
arrCh[i] := reportData^;
reportData := reportData + 1
end;
mouseData.button := arrCh[0] + (word(arrCh[1]) shl 8);
mouseData.x := arrCh[2] + (word(arrCh[3]) shl 8);
mouseData.y := arrCh[4] + (word(arrCh[5]) shl 8);
HID_MOUSE_UpdatePosition(mouseData.x, mouseData.y);
end;
My questions is, are the multiple possible standards to implement different HID reports or the code from the example is supposed to do something else? As I said, I don't have EasyPIC_Fusion_v7_for_PIC32 board so I don't know how the example works.
Thank you