2013-04-15 10:55 AM
Hello Community,
i´m having a stm32f3Discovery under the Keil´s µVision4 Compiler programming in c++. I got to the point, where i could use the ''NEW'' operator. To be honest, i have no idea, what is really going on. I know in principle this operator allocates space for the given type and returns a pointer in case of success. As long i used this on a desktop PC i didn´t care, since there ia an OS under my feet. I mean, if i allocate space i guess this trigger the OS to ''talk'' to some kind of memory controller if there is enough space and where it is, and also handles the cirumstances if the memory becomes fragmented. (?) And this is where my understanding ends when it comes to bare µC´s. Do i really have to import a complete OS just for getting new/delete oportunities? And what is administrating the RAM in my STM32F3 i could ''talk'' to? Would i have do make this RAM controller by my own? For summing up the whole scenery in one question: What is going on in my stm32F3 if the compiler finds a ''NEW''? yours sincerly, Justus2013-04-18 05:54 AM
''The key idea is not to programm the sticks and switches with fix functions, rather than making the whole thing configurable''
You don't need C++ to do that. You could create a plain 'C' library of functions, so only the top-most level of your code would need to be specific to a particular product...2013-04-18 11:11 AM