edogaldo wrote:vitor_boss wrote:This is the problem, before that call the code use the same loop for a 288 bytes Serial.write and a lot of Serial.print and all work fine, only that lines aren't giving outputs
code is at https://github.com/noisymime/speeduino/ ... /comms.ino
Hi vitor, I can't see any uint8_t/uint16_t in the code you linked, it would be better if you post the real code you are using..
I changed the code trying to make it work but doesn't. I have changed int to uint16_t to keep data alignment across platforms.
victor_pv wrote:stevestrong wrote:If it is about this part of your code, then it will not work at least because sizeof(response) is actually not explicitly defined, but only indirectly through a variable value. So I assume you have a bug in your code.
Didn't you have some compiler warnings?
I think I agree with Steve on that. If I understand it right, sizeof is calculated at compile time, but you seem to use a variable to set the size.
Wouldn't be better to change the serial.write line to this?
Serial.write((byte *)&response, npage_size[currentPage]);
As to why would it work on a different mcu, you probably should check if the Serial.write implementation is the same or not.
Thanks, I will try that