Category : avr-gcc

I need to find out the exact binary representation for floats and doubles in a C++ project built with Platformio for an Atmega328 using the Ardurino framework. I don’t have access to the actual hardware so I can’t check it myself. The micro does not have an FPU and is 8 bit so it’s pretty ..

Read more

I am just learning C++, my background is C. Using c-programming in Platform IDE Eclipse, Atmega328P microcontroller. The Pin Change Interrupts are grouped. I usually store function pointers in array such: *** void (*PCIINT[23])(void); //store address of each callback function *** *** void attachInterrupts( void (*Fnc) (void), uint8_t i) { PCIINT[i]= Fnc; } *** where ..

Read more

I’m trying try get my Arduino code to compile with -std=c++14 instead of the default -std=gnu++11. To this end, I added to my platformio.ini: build_flags = -std=c++14 build_unflags = -std=gnu++11 However, when I then try to compile, I get the following linker errors: <artificial>:(.text+0x20a4): undefined reference to `operator delete(void*, unsigned int)’ (multiple times) I seems ..

Read more

Intro: While i was coding and testing a library, I’ve noticed a very strange behavior from the compiler, not really optimizing unnecessary variables […] and i was socked to observe that for example: "unnecessary definitions of functions" where optimized/"removed" in the compilation process, while "unnecessary variable definitions" not exactly as someone would imagine them to ..

Read more

Intro: While i was coding and testing a library, I’ve noticed a very strange behavior from the compiler, not really optimizing unnecessary variables […] and i was socked to observe that for example: "unnecessary definitions of functions" where optimized/"removed" in the compilation process, while "unnecessary variable definitions" not exactly as someone would imagine them to ..

Read more

My question is more like: Why the compiler "thinks" that a "PROGMEM variable" is the same as a "plain Variable"? is it because PROGMEM-keyword is "just" a macro and nothing more? or is it for some other reason? ISSUE demonstration: Lets consider the below example: class object { public: object(int variable); object(int variable PROGMEM); }; ..

Read more

My question is more like: Why the compiler "thinks" that a "PROGMEM variable" is the same as a "plain Variable"? is it because PROGMEM-keyword is "just" a macro and nothing more? or is it for some other reason? and is there any workaround..? ISSUE demonstration: Lets consider the below example: class object { public: object(int* ..

Read more