Attach interrupt getting ISR not defined

Having a problem with the interrupt. There are 3 parameters. pin number, name of service routine, and whether working on rising, falling pulse etc. Getting answer ISR not defined. The name is 'phase'. The queer thing is another program of mine uses the same interrupt routine and I am not getting this message.
In both cases the interrupt routine is in 'set up'. Should I put the interrupt routine before set up. Then perhaps 'phase' will be defined as a global variables.
I thought I had this problem fixed when I removed gaps in the programming lines. It was ok for a while but now has come back.
Any ideas how to fix?

Any possibility we could see the mystery code you refer to?

Do an autoformat (in the IDE, ctrl-t or Tools, Auto Format) on your code before posting.

attachInterrupt(digitalPinToInterrupt(pin3), phase, RISING);
phase is the name of a 'interrupt service routine'. It is simply a name. How can it be defined? It is not a data type.
The service routine is void phase() { service routine code in here.
And it does not get an error when using in another program. However this other program does not use 'read_sensors();' which is another sub-routine. The main program needs to read a sensor quite often so I created this additional sub-routine.

Hello petercl14
Post your sketch, well formated, with comments and in so called code tags "</>" and schematic to see how we can help.
Have a nice day and enjoy coding in C++.

Run the IDE autoformat tool (ctrl-t or Tools, Auto format). Are you missing any curly brackets.

Read the forum guidelines to see how to properly post code and some information on how to get the most from this forum.
Use the IDE autoformat tool (ctrl-t or Tools, Auto format) before posting code in code tags.

Please include the entire error message. It is easy to do. There is a button (lower right of the IDE window) called "copy error message". Copy the error and paste into a post in code tags. Paraphrasing the error message leaves out important information.

The presumption is that for some reason the actual phase function is not being defined. This is likely caused by an error somewhere else in the code, prior to the phase function. Something as simple as a forgotten closing bracket can cause this.

Did you understand this post?

POST. THE. CODE. All of it.

OP has solved the problem, but started a new thread instead of continuing this discussion.

https://forum.arduino.cc/t/interrupt-problem-solved/958578

Hi all, Have solved the interrupt service routine problem. Was getting the name of the sub-routine not defined error message. This had nothing to do with it. I found a curly bracket that did not have a corresponding curly bracket. Should have been getting a message related to this.

Thanks, you could mark the original thread SOLVED
The original question

Why did you make a separate thread for this? I just wasted my time answering your original thread.

Understanding the results of tools -> auto format will help a lot :smiley:

Maybe you did actually got a message like that? Else write your own compiler :rofl:

What a clown. Why 2 posts? and never post the code? I'll be sure to avoid your posts in future.

You probably did, among all of the errors and warnings in the text box under your sketch. You probably just didn't look at anything but the highlighted (first) error. This is an opportunity to learn.

I have merged your cross-posts @petercl14.

Cross-posting is against the rules of the forum. The reason is that duplicate posts can waste the time of the people trying to help. Someone might spend 15 minutes (or more) writing a detailed answer on this topic, without knowing that someone else already did the same in the other topic.

Repeated cross-posting can result in a suspension from the forum.

In the future, please take some time to pick the forum category that best suits the subject of your question and then only post once to that forum board. This is basic forum etiquette, as explained in the "How to get the best out of this forum" guide you will find at the top of every forum category. It contains a lot of other useful information. Please read it.

Thanks in advance for your cooperation.