New answers tagged c
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 ...
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 ...
0
votes
Drivers in C++ produces bigger assembly
It really depends on the quality of the optimizer (auto inlining especially) and the fact that in the first case you can easily fit x in a register in the calling sequence while in a class you need a ...
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 ...
3
votes
Confusion with variable update in microcontroller programming
As pointed out by @EugeneSh, your sprintf line will overflow the msg_int buffer whenever ...
Top 50 recent answers are included
Related Tags
c × 1530microcontroller × 577
pic × 322
stm32 × 320
embedded × 220
avr × 198
uart × 110
interrupts × 101
atmega × 86
i2c × 77
programming × 76
arm × 73
microchip × 70
arduino × 69
timer × 60
spi × 55
c++ × 49
adc × 44
msp430 × 42
assembly × 34
pwm × 33
serial × 33
8051 × 31
flash × 29
firmware × 28