I have a small project with a LPC812 and exported it to LPCXpresso. There I added the wakeup lib from Eric O. and the code size nearly doubled. I found the relevant code line:
//Load the timer
//LPC_WKT->COUNT = (uint32_t)((float)ms * cycles_per_ms);
LPC_WKT->COUNT = ms * cycles_per_ms;
when I completely remove the multiplication line, the code size (text segment) is 6904 bytes.
cycles_per_ms defined as float (original code) results in 11048 bytes.
removing the float mul and defining cycles_per_ms as uint32_t gives 11312 bytes.
Defining cycles_per_ms as int gives 8888 bytes.
How can the difference be that big between 32 bit signed / unsigned multiplication? And why costs the unsigned int even more than the float multiplication?
I have a small project with a LPC812 and exported it to LPCXpresso. There I added the wakeup lib from Eric O. and the code size nearly doubled. I found the relevant code line:
when I completely remove the multiplication line, the code size (text segment) is 6904 bytes. cycles_per_ms defined as float (original code) results in 11048 bytes. removing the float mul and defining cycles_per_ms as uint32_t gives 11312 bytes. Defining cycles_per_ms as int gives 8888 bytes.
How can the difference be that big between 32 bit signed / unsigned multiplication? And why costs the unsigned int even more than the float multiplication?