C++ on the AVR port

ChibiOS public support forum for topics related to the Atmel AVR family of micro-controllers.

Moderators: utzig, tfAteba

mikenick42
Posts: 28
Joined: Tue Mar 10, 2015 4:49 pm
Been thanked: 1 time

C++ on the AVR port

Postby mikenick42 » Thu Feb 25, 2021 12:29 am

Has anyone had any luck with C++ on the AVR port of ChibiOS? I know the STM port can do it but when I try renaming main.c and moving it in the Makefile I get:

Code: Select all

/usr/lib/avr/include/avr/io.h:623:6: warning: #warning "device type not defined" [-Wcpp]
 #    warning "device type not defined"


It looks like __AVR_ATmega328P__ isn't being defined for some reason.

Is it even worth using C++? I'm mainly interested in it because it makes encapsulation more convenient. What I want should be possible if I'm careful about how and where I declare things in C, but is a little cleaner in C++.

Return to “AVR Support”

Who is online

Users browsing this forum: No registered users and 1 guest