Hi, i'm using Keil Evaluation Boards to program my STM32F4Discovery. I was wondering, why can't I use boolean or bit type data? Or it's because i'm using the Evaluation version? I want to use "true" or "false" value, maybe i can use another type data besides that two buddies? I'll be happy and glad if anybody can help me with this one. Sorry for my bad english...
Lost of embedded programs have quite a limited number of global boolean variables, so the amount of memory consumed by using a byte instead of a bit is often very marginal.
At the same time, lots of embedded programs have quite limited code space, in which case the code size becomes just as critical as RAM space might be.
Often, programs wastes too much RAM by using global variables for something that could have been local variables.
And for lots of processors, a char or maybe even a full int variable can be much quicker to work with than a bit variable because of better matching to the processor instruction set. So boolean variables accessed by interrupts can give a big difference in interrupt latency if stored as a single bit or as a byte - besides the fact that if memory controller or instruction set doesn't have single-bit support then a single bit stored in a word can't be atomically updated resulting in lots of potential timing issues between main loop and interrupt handlers or between different threads.