[C]unrecognized token "@address" on VScode

189 views Asked by At

I'm using cosmic compiler for stm8 microcontroller.
It supports "@" pointers or modifiers.
such like

@<address>
@far
@near
@tiny
@interrupt
@inline
//etc..

Cosmic compiler user guide

VScode cannot recognize those modifiers and shows red underline and also intellisense does not work.

My code

Does VScode have any setting to enable "@" pointers or modifiers? Or can it ignore "@" symbols? I just wanna use intellisense.

1

There are 1 answers

0
EN20 On

I used defines for these and defined those as nothing when the VS_CODE define is defined whitch i did in the c_cpp_properties.json. than vs code sees nothing and cosmic is happy to see the @ where they are needed

#ifdef VS_CODE
    #define TINY
    #define NEAR
    #define FAR
    #define EEPROM
    #define AT_ADR(n)
    #define INLINE
    #define _INLINE
    #define INTERRUPT
#else
    #define FAR  @far
    #define NEAR @near
    #define TINY @tiny
    #define __CONST  const
    #define EEPROM @eeprom
    #define AT_ADR(n) @(n)
    #define INLINE @inline
    #define INTERRUPT @interrupt
#endif