I'm cretin there is no way to achieve this but figured I had better ask. I have a situation where I will be sending data to a computer via USB. I'm using an atmega 328 with a usb driver (v-usb). Because of the nature of my data I'm using a custom size. Much like CAN on a the OBD2 network. I first send a head instructing the length and type of data then send each line sequentially with a line number.
(header containing length and other info)
and so on.
For the report ID I just have a size of 8 and on the device side I assemble the data in to an array. The write way to often for EEprom (I'd burn that out in a matter of day). So I'm forced to use a static data size. My issue is that the atmega does not have much memory and I'm near %100. The data must be read in its full size. So I must read from usb in to an array first.
So my question is can the compiler be told in any way that this data size is dynamic. As far as I know, that's not possible as I need to prepare the memory. The data could stretch to 1024 at times and it must be global.
unsigned char data;
The data is read from the main and used in the other cpp files. Just curious if this is the best way to accomplish this