i would like to know if someone can help me on this issue

I have two lines nearly the same, the only difference is "!" before the condition ( if .... is good but not if ! ....)

error: #35: #error directive: "define interrupt type NM_EDGE_INTERRUPT,NM_LEVEL_INTERRUPT"

Thank you

  • 3
    \$\begingroup\$ If you actually read the text of the error, it seems fairly clear that you haven't defined the interrupt type to be either EDGE, or LEVEL. Choose the one that's appropriate for your needs and define it. You probably shouldn't be adding or removing any "!" characters in the code if you don't understand it. \$\endgroup\$ – brhans Jun 11 '18 at 14:02
  • 4
    \$\begingroup\$ You were lucky to get a definitive answer to such a question, really. \$\endgroup\$ – Eugene Sh. Jun 11 '18 at 14:14
  • 2
    \$\begingroup\$ I absolutely loathe these types of questions. People really need to learn how to troubleshoot their code. I understand if you don't know the syntax of a programming language but to ask about an error where you think you've hit a brick wall is rather unacceptable. The chances that someone else on the internet has run into the same problem is nearly 100%. That being said, I highly encourage you to research the problem on the internet. It's there somewhere. You're not discovering gold when you find issues in your code. Please utilize STMicroelectronic's website. \$\endgroup\$ – KingDuken Jun 11 '18 at 14:22
  • 3
    \$\begingroup\$ I'm voting to close this question as off-topic because there is a complete lack of research shown \$\endgroup\$ – MCG Jun 11 '18 at 14:35
  • \$\begingroup\$ @KingDuken, people that do not read the comments are worse. \$\endgroup\$ – jsotola Jun 12 '18 at 6:40

The code has an #error directive, explicitly telling the preprocessor to throw an error if it hits the line.

These are put in by the programmer, reminding you that something is required otherwise it won't compile or work.

In this case: "define interrupt type NM_EDGE_INTERRUPT,NM_LEVEL_INTERRUPT".


Not the answer you're looking for? Browse other questions tagged or ask your own question.