## sei() Unrecognized symbol [but it works]?

13 posts / 0 new
Author
Message

Hi,

In my project, all of my sei() and cli() calls are underlined red with the message:

"Unrecognized symbol. Alt+G to jump to a guess, see a list of several, or let IntelliSense try."

But nothing shows up in my Error List, and my interrupts function properly.

Does anyone know what might be going on?

That'll just be the "intellisense" in the editor - it's a separate thing from the actual build tools

Top Tips:

1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...

Have you installed the Naggy extension by any chance?

:: Morten

(yes, I work for Microchip, yes, I do this in my spare time, now stop sending PMs)

The postings on this site are my own and do not represent Microchip’s positions, strategies, or opinions.

Nope, I haven't installed Naggy.

Is there a way to suppress this "intellisense" behavior?

It's what powers all the code browsing facilities, refactoring, etc.

I think the benefits make it worth putting up with the odd quirk like this - as you say, the code does build & work properly.

And you generally don't need to look at the definition of sei().

Top Tips:

1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...

Definitely worth putting up with if the only way is to give up refactoring. I wonder what may be causing this quirk if it doesn't happen to everyone.

jionbha wrote:
it doesn't happen to everyone.

Maybe it does - and they just suffer in silence ... ?

It does come up on the forums from time to time.

I guess there must be an equivalent of "Include Paths" somewhere in the settings  which would allow it to find all these things.

I did try a few things once, but got nowhere and it didn't seem to be worth more effort, TBH.

Top Tips:

1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...

VScode has a newer Intelasense, I like it a lot, but it takes some time to fill it the indexing database. I notice this when I did a clean install a little while ago, after cloning my repo and installing VScode. When I opened the file for the first time all sorts of stuff had red underlines for a while (a few minutes, it is an old and slow computer). After about 30 seconds I started getting uneasy and looking for clues, and there was one in the corner that said the indexing service had not finished. The version of Intelasense in VS7 is from a few years back, but it may start working if it can find the files and index them.

update: I wish for a better spelling/grammar aid, I have been waiting forever...

Last Edited: Tue. Jul 14, 2020 - 08:31 PM

ron_sutherland wrote:
When I opened the file for the first time all sorts of stuff had red underlines for a while (a few minutes, it is an old and slow computer).

I've had the same with Eclipse - it even adds them to its equivalent of the Studio "errors list"

Top Tips:

1. How to properly post source code - see: https://www.avrfreaks.net/comment... - also how to properly include images/pictures
2. "Garbage" characters on a serial terminal are (almost?) invariably due to wrong baud rate - see: https://learn.sparkfun.com/tutorials/serial-communication
3. Wrong baud rate is usually due to not running at the speed you thought; check by blinking a LED to see if you get the speed you expected
4. Difference between a crystal, and a crystal oscillatorhttps://www.avrfreaks.net/comment...
5. When your question is resolved, mark the solution: https://www.avrfreaks.net/comment...
6. Beginner's "Getting Started" tips: https://www.avrfreaks.net/comment...

Odd, my AS7 has no problems recognising sei():

It shows these two options when I right click and "Goto implementation". There are two because one is for the "#ifdef DOXYGEN" case and one is the real definition. That is interrupt.h contains:

#if defined(__DOXYGEN__)
/** \def sei()
\ingroup avr_interrupts

Enables interrupts by setting the global interrupt mask. This function
actually compiles into a single line of assembly, so there is no function
call overhead.  However, the macro also implies a <i>memory barrier</i>
which can cause additional loss of optimization.

consider using the macros from <util/atomic.h>, rather than
implementing them manually with cli() and sei().
*/
#define sei()
#else  /* !DOXYGEN */
# define sei()  __asm__ __volatile__ ("sei" ::: "memory")
#endif /* DOXYGEN */


Wonder why you are not seeing this - you did have the #include of <avr/interrupt.h> at the top of file where it was used?

I have a similar problem. My project runs fine but it doesn't recognize some datatype which are defined in a header file. It recognizes other datatypes in other header files. Can I add the path to some directory or something? Is there a intellisense directory? I didn't find anything like that

max2134 wrote:
I have a similar problem. My project runs fine but it doesn't recognize some datatype which are defined in a header file. It
How does it express the fact that it "doesn't recognize" exactly?