Sublime Forum

Sublime clang and conditinal includes

#1

Hi,

I’m trying to use Sublime for avr development with SublimeClang plugin.
However I got following errors (for many identifiers):
Error - use of undeclared identifier ‘DDRB’

Of course DDRB is defined in one of include files (path added to sublimeclang_options).
However inside avr/io.h (only file included in main.c) there are conditional includes which are evaluated by compiler like this:

#if defined (AVR_AT94K)

include <avr/ioat94k.h>

#elif defined (AVR_AT43USB320)

include <avr/io43u32x.h>


If I make manual include required file then things break down when I want build firmware for other MCU.
Those AVR_AT94K are define in makefile (cpu selection) and used by compiler for evaluation when build took place.

How to solve this ? adding ** make lots of trouble since for example DDRB is defined in almost every ioa*.h file.

Thanks in advance.

0 Likes

#2

I have made a plug-in to take care of these SublimeClang settings. sublime.wbond.net/packages/AVR

0 Likes