On supported PIC18 devices, the tool can give your application a byte array in the verified unused space after the USB reservation. This is useful for a log fragment, a display staging buffer or file contents.
The library declares USB_ExtraRAM[] for you. It is ordinary application byte storage. It does not create another USB endpoint or send anything automatically.
' Requires Extra byte-buffer size of at least 2 in the tool.
' Do not declare USB_ExtraRAM again.
USB_ExtraRAM[0] = 100
USB_ExtraRAM[1] = 25
USB_EXTRA_RAM_BYTES is the configured size. Valid array indices go from 0 to that size minus 1. Use an index variable large enough for the size you chose.
The compile-time values USB_EXTRA_RAM_BASE and USB_EXTRA_RAM_AVAILABLE describe the starting address and maximum available space. Let the library place the array. Do not declare another At array at the same addresses.
This feature leaves the safe limit for automatically allocated variables unchanged. Do not turn parts of the Byte array into aliased Word/Dword variables across bank boundaries. For multi-byte values, store and rebuild individual bytes in a defined order, as in the HID data examples.
Changing the class, packet sizes or ping-pong setting can move the array's start and change how much space is available. Generate and compile again after any of those changes.
Created with the Personal Edition of HelpNDoc: Free iPhone documentation generator