I'm attempting to setup my 18F4550 with 2 or more different sets of USB code, depending on buttons pressed when powered on. The USB code modules will both use HID, but with different in and out buffer sizes. All of the USB code I've seen uses a #pragma udata line that specifies where the buffer will be, in one of the pages of memory that is shared directly with the USB code in the code page from 0x400-0x4FF. Both of them declare the areas for the EP0-EP15, and then the endpoint buffers.
What I need to know is how can I define arrays access specific sections of memory. Let's say the buffer size for USB1 is 0x10 bytes, and the buffer size for USB2 is 0x18 bytes. I'll need a way to define four arrays:
unsigned char USB1OUT[0x10] starting at address 0x480
unsigned char USB1IN[0x10] starting at address 0x490
unsigned char USB2OUT[0x18] starting at address 0x480
unsigned char USB2IN[0x18] starting at address 0x498
Can anyone help point out to me how to do this?
What I need to know is how can I define arrays access specific sections of memory. Let's say the buffer size for USB1 is 0x10 bytes, and the buffer size for USB2 is 0x18 bytes. I'll need a way to define four arrays:
unsigned char USB1OUT[0x10] starting at address 0x480
unsigned char USB1IN[0x10] starting at address 0x490
unsigned char USB2OUT[0x18] starting at address 0x480
unsigned char USB2IN[0x18] starting at address 0x498
Can anyone help point out to me how to do this?