Error in USB_HID example in help [Solved]

Beta Testing discussion on mikroPascal PRO for PIC.
Post Reply
Author
Message
Dany
Posts: 3854
Joined: 18 Jun 2008 11:43
Location: Nieuwpoort, Belgium
Contact:

Error in USB_HID example in help [Solved]

#1 Post by Dany » 02 Oct 2010 09:34

Hi, in the USB_HID code example in the IDE's help the following occurs:

Code: Select all

program HID_Read_Write_Interrupt;
...
var readbuff : array[64] of char; absolute 0x500;   // Buffers should be in USB RAM, please consult datasheet
var writebuff : array[64] of char; absolute 0x540;
...
Using char in stead of byte in the 2 bufferdeclarations makes them overlap 1 byte: the arrays are both 65 bytes long instead of 64 bytes. In some cases (if buffers are used entirely) this will give problems.
Thanks in advance! :D

p.s. I see in a lot of places that char is used in stead of byte (e.g. also in the mP usb descriptors). Is this something that comes from C? C has no "byte", it uses unsigned char in stead. Please let mP not be littered by C stuff! :?
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)

Post Reply

Return to “mikroPascal PRO for PIC Beta Testing”