Hi, in the example "C:\Users\Public\Documents\Mikroelektronika\mikroPascal PRO for PIC\Examples\Development Systems\EASYPIC7\USB\HID Read Write Interrupt" i see the following in the UsbDsc.mpas file:
Code: Select all
...
const USB_HID_RPT_SIZE : char = 33; // 33 bytes! is the correct size
...
...
type hid_report_descriptor = record
report : array[USB_HID_RPT_SIZE] of char; // <------------------
end;
const hid_rpt_desc : hid_report_descriptor = (
...
In the marked line the array is of type "char", making the constant "hid_rpt_desc" 34 bytes long instead of 33 (an extra zero is added). Better to use a "byte" here, the array is no "string". It could go wrong if e.g. the usb library used "SizeOf(hid_rpt_desc)".
Also valid for the P24 mP example.
If I am not mistaking this is a difference with mC: in the latter an array of 10 chars is 10 bytes long, in mP an array of 10 chars is 11 bytes long. Why is this difference there?
Kind regards, Dany.
Forget your perfect offering. There is a crack in everything, that's how the light gets in... (L. Cohen)
Remember when we were young? We shone like the sun. (David Gilmour)