Id-7rub / arduino-tvout

Automatically exported from code.google.com/p/arduino-tvout
0 stars 0 forks source link

Remove malloc in pollserial #56

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
Change the buffer from malloc to a static char array. This is to prevent timing 
and memory problems. It makes the serial communication more stable.

Original issue reported on code.google.com by marcelve...@gmail.com on 11 Oct 2012 at 2:55

GoogleCodeExporter commented 8 years ago
Can you go into more detail on how to change the malloc. 

Original comment by blandfo...@gmail.com on 16 Apr 2013 at 9:21

GoogleCodeExporter commented 8 years ago
Instead of x = malloc(1234); you could do something like this:
static char x[1234];

Original comment by marcelve...@gmail.com on 17 Apr 2013 at 12:50

GoogleCodeExporter commented 8 years ago
so (rxbuffer.buffer = (unsigned char*)malloc(BUFFER_SIZE*sizeof(unsigned 
char));)
will become (static char rxbuffer.buffer[(BUFFER_SIZE*sizeof(unsigned char))];)

Original comment by blandfo...@gmail.com on 17 Apr 2013 at 1:28

GoogleCodeExporter commented 8 years ago
I did this 
"static char rxbuffer.buffer(BUFFER_SIZE*sizeof(unsigned char));"
and I'm getting this error 
"error: expected initializer before '.' token"

Original comment by blandfo...@gmail.com on 20 Apr 2013 at 11:13