Mark Odell (@mrfirmware)
I'd stick with the ARM Cortex-M0 class CPUs for better (free) tools. Check out the ST STM32G030. For that many units you might consider CAN. If not, then RS-485...
I don't really know what you're asking for but maybe offsetof() can help you?#include <stddef.h>
...
size_t const index = offsetof(union Setings, str.TimeFormat);...
You bet. Be sure to specify a C ISO standard, e.g. "C11" and then stick to it. Don't go back to the dark pre-C99 days.
It's not that EEPROM is unreliable it's that you cannot guarantee that your writes will be coherent WRT the data structures you are writing out to the EEPROM. If...
Then I recommend you try using https://godbolt.org/ and watching what if-else vs switch vs function pointers yields for your chosen compiler and optimization flags.And...
I'd say don't worry about optimizing until you need to worry about optimizing. When you are out of code or data space then you need to worry about getting small....
Yes, sorry about that. I agree about just using volatile and being safe. My second case I should have looked like this:static bool s_data_ready;
static void isr(void)...
Matt to your point about the ISR/background volatile. I always declare shared vars between ISR and background code volatile but some colleagues have said that's...
It's probably worth reading https://en.cppreference.com/w/c/language/volatile to understand volatile a bit more. My rule on volatile is if the compiler cannot detect...
Use this form to contact mrfirmware
Before you can contact a member of the *Related Sites:
- You must be logged in (register here)
- You must confirm you email address