Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
For code that targets an embedded device or some severely resource-constrained environment.
1
vote
Accepted
Is my design for data reading over an I2C bus and writing back to UART good enough?
There should be no need to use variadic functions in an embedded system. … Never use int anywhere in an embedded system. …
10
votes
Generic enum to text lookup in C
Type issues:
The native so-called "primitive data types" in c (int, long etc) should never be used in embedded systems. … This is particularly important in embedded systems, where bit-wise operations are common. …
1
vote
Statically allocated memory pool in C for embedded systems
I'd use stdint.h over inttypes.h because the former is mandatory for all C systems, including embedded ("freestanding") systems. inttypes.h is not necessarily supported by embedded compilers and apart …
1
vote
Text Parsing in C on a microcontroller
Some important remarks regarding performance:
Calling strcmp repeatedly on the same data in some if - else if listing is naive and very inefficient. This will kill significant amounts of execution ti …
1
vote
Accepted
Double-ended queue for Embedded Systems with different data size
Don't do that, there's no need to use such pointless non-standard extensions and they are very unlikey to be supported by embedded systems compilers. Use uint8_t* instead. …
1
vote
Software ECC embedded with a parallel NAND Flash interface
From what I remember ST Cortex M4 has some "wannabe cache"-like feature, "ART accelerator", something like that. This is supposedly mainly there to reduce wait states. But if it works like normal data …
2
votes
State-machine class based upon arduino toolchain
An idiomatic state machine for a bare metal embedded system usually looks like this:
void main()
{
for(;;)
{
pet_wdog();
result = state_machine(state);
state = error_handler(result); // …
3
votes
Ring buffer for Arduino
Review addressing the embedded system aspects, assuming the target is Arduino/AVR 328P:
Implementing destructors for a class to be used in a bare metal embedded system is very fishy. … Embedded systems should always use the stdint.h types. This is an 8-bitter so all arithmetic should preferably be done on uint8_t integers whenever possible. …
3
votes
Accepted
Embedded IoT: local data storage (Second Update)
It's good that you use * const for read-only pointer tables, since this typically makes them flash allocated on embedded systems, as opposed to RAM where they shouldn't be. … It's ok to use uint8_t as the string type, particularly in embedded systems. However please note that this might upset compilers when you call standard libs with that type. …
4
votes
Accepted
Efficiently swapping the first and last five bits in an unsigned 16-bit integer in C
Programming 8-bitters in C is tricky, particularly when dealing with antique ones like Z80. The things you absolutely must consider are:
Keep to 8 bit arithmetic whenever possible.
Ensure that no bi …