Maybe fix the automatic function declaration problem in IDE

Arduino IDE automatically collects all function declarations from all its tabs that have .ino extension (or not extension). It then includes all the declarations in the front of the main .ino file. This is convenient but also creates the following problems:

  1. It is unable to handle a function argument is a pointer to a function. You will have to place a declaration in the main .ino file yourself.
  2. If you use #ifdef and #endif in a tab with .ino extension, then the code inside these directives are also searched and declarations are extracted and placed in the front of the main .ino file. This occurs before the pre-compiler processing. If the declaration has a data type that is not included in the main .ino file, then there will be compilation error. You will need to include the .h file that has definitions of the data type the declaration has in its parameters in the main .ino file. You may also compile manually but I don’t know how.