3 ms·
There are quite a lot of embedded code that relies on obscure C compilers created and maintained by the CPU manufacturer. But then again you are probably not d
by DanielHB 2y ago
There are quite a lot of embedded code that relies on obscure C compilers created and maintained by the CPU manufacturer.
But then again you are probably not doing a whole lot of heap management in embedded code.
- dietr1ch 2y agoThat sounds like the kind of code that you want to be done with and never touch again. You can only dream of it not being buggy or catching up with the newest standard.
- DanielHB 2y agoNo it is more like the 10000 lines of code running in your washing machine, you will probably be updating it in the next year revision of the product. It is quite common for this code to have all variables be global and just not have any heap allocations at all. Sometimes you don't even have variables in the stack either (besides the globals).
- hn_acc1 2y agoI much prefer the purely-mechanical washing machines for this reason.. Way less to go wrong..
- DanielHB 2y agoIt is not that bad, the code is easier than your average web server and it is usually only one CPU for consumer devices. It gets bad if: 1) You add embedded linux 2) You have multiple CPUs that need to communicate with each other. 3) Both of the above (then the complexity skyrockets) (this happens in modern cars) So basically if it has a full LCD display (instead of 7-segment with a few extra toggle lights) I don't buy it. It is actually quite refreshing code to read and write, yes the quality is often bad, but it often feels like school projects where they are small enough you can hold the complete system in your head. And it usually doesn't integrate with anything else besides the eletronics in the board
- TickleSteve 2y agostatic allocation is the recommended mechanism in embedded code for reliability reasons, you have thought about you worst-case allocation and accounted for it... right? Also fragmentation and dynamic behaviour are bad things when your code has to run "forever".