Hi all, I am working with the TI TUSB3200, trying to modify their example code for our own USB device. USB requires many tables which start with a length byte. I would like to use the sizeof operator to calculate this for me, as shown here:
byte code rictest[] = { sizeof(rictest), 1, 2 };
warning C198: sizeof returns 0
Hmm, I think you can make use of how Keil arranges/places variables in memory. They are not arranged in order of declaration, they are arranged alphabetically. This is a painfully bad idea. Not only is it completely unportable, and needlessly so, it will even break with the Keil tool-chain if you tell C51 to keep varables in order via the ORDER directive. Write a program to generate the .c and .h files. Then it could be used with other tools.