|
From: Mark D. M. <mar...@gm...> - 2013-09-29 14:20:26
|
> I am using a PIC32 from Microchip with the XC32 compiler on MPLAB X. > Before I do, I was wondering if there was not a better approach. > Your suggestions are welcome, thanks! Taking a quick glance at the hardware it might make sense to try to avoid dynamic memory depending on how much else is going on within the chip. Looking at the linked code malloc/free are around in a few places, though that might not be an issue with 64kb of ram. If you're trying to avoid the heap and you're not doing much in the way of dispatching, then something like the C core of https://github.com/fundamental/rtosc might be more appliciable. If your compiler supports a few bits of C99, then it might be sufficient to just copy the basics code out of https://github.com/fundamental/rtosc/blob/master/src/rtosc.c Note, that I have not yet tried it, but I intend to attempt to fit the lib on some avr chips (eventually) with a much much smaller ram and slightly smaller code space. Hopefully a bit of advertisement is fine on this list. --Mark |