Hot answers tagged

5 votes
Accepted

Drivers in C++ produces bigger assembly

First the question is, why does the class produces bigger assembly? You just introduced a class! That means you get longer method names (keyword: name mangling), if you're building with such embedded ...
user avatar
4 votes
Accepted

Custom Memory Allocator - How to find the required alignment for a platform?

malloc is required to return a pointer properly aligned to hold an object of any type. Which means it must be aligned at least as the largest scalar type. Luckily C ...
user avatar
  • 9,667
4 votes

Would writing to same flash address reduce lifespan of MCU

Let's address the x-y problem. Why do you need to write to the vector table? For me that's huge red flag, foreseeing getting bricked devices with RMA labels on them. Because the power brown-out during ...
user avatar
  • 20.8k
3 votes

Confusion with variable update in microcontroller programming

As pointed out by @EugeneSh, your sprintf line will overflow the msg_int buffer whenever ...
user avatar
  • 13.3k
2 votes

Noise reduction algorithm for an AC mains voltage measurement

I am sampling the 50 Hz sine wave at 20 points Depending whereabouts the first sample lies and the 20th sample lies on the sampled waveform, can produce errors of this magnitude. A much higher ...
user avatar
  • 385k

Only top scored, non community-wiki answers of a minimum length are eligible