using attachInterrupt in sloeber?

Hello,

i've been working on a little project to run 2 motors in both directions started and stopped by a pin interrupt. I ran into a problem with attachInterrupt. Eclipse states Invalid arguments 'Candidates are: void attachInterrupt(unsigned char, void(*)(),int)

here is the part of my code

void setup() {

  Serial.begin(9600);
  
  //set Pin modes
  pinMode(enA, OUTPUT);
  pinMode(enB, OUTPUT);
  pinMode(in1, OUTPUT);
  pinMode(in2, OUTPUT);
  pinMode(in3, OUTPUT);
  pinMode(in4, OUTPUT);
  pinMode(2, INPUT);
  //Attach interupt function
   attachInterrupt(0, rcPuls, RISING);
   
}

//ISR
void rcPuls()
{
  updatedState = true;
}

could anyone point me to what i'm doing wrong?

cheers gueee

put a function forward declaration for the ISR before setup(). You would get this error in Arduino IDE too. I wonder that you have it in Sloeber.

Thanks Juraj,

I did like you told me and it solved the problem, but after that I removed the declaration again and the problem didn't come up again?!

some sort of a strange behavior ...

thanks anyway cheers

Sloeber maintains sloeber.ino.cpp for the C++ indexer of Eclipse. The Indexer is an Eclipse tool and sometimes it reports errors until it rebuilds the index of the source code.

Thanks agan Juraj,

with the newly acquired knowledge brought in by you, I was able to reproduce the error report.

I've to say, your experience is priceless!

cheers gueee