Midi firmware.
I am having trouble with C syntax. I program in ASM.
This is part of a midi controller usb 2.0 firmware im writing.
I am trying to define an output buffer. The maximum size of which will be 44 bytes.
These 44 bytes, are made up of 4 byte sections. 11 in total.
One of these bytes , the last, will change.
For instance.....
Code:
char INPacket[] = { 0x0B, 0xB0, 0x00, 0x69 };
Is how i did it for one button. Now on a button the last byte will be 0x00 or 0x69, on or off.
Then the others are nearly identical only the last byte can be 0 - 127, and the second bytes will progress up, to signify controll 1 , 2 , 3, etc.
I plan to read the Pots possition and put the result into the 4 bytes for that controll, repeat for all 11 controlls, and then send all at once.
Ok so how do i define a buffer that will hold 11 messages, and then lable each section to the button.
ie
inbuffer[44] sw1,sw2,sw3,sw4,nob1,nob2,nob3,slide1,slide2,slide3,slide4,
Then after scanning all of them, do this,
Code:
char INPacket[] = inbuffer[]
//make sure that the last transfer isn't busy by checking the handle
if(!USBHandleBusy(USBGenericInHandle))
{
//Send the data contained in the INPacket[] array out on
// endpoint USBGEN_EP_NUM
USBGenericInHandle = USBGenWrite(USBGEN_EP_NUM,(BYTE*)&INPacket[0],4);