This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

hide undefined #ifdef sections in µV4 editor

Is is posible to hide undefined sections?
in case of several possible controllers i use something like that:

#define CONTR2
#ifdef CONTR1
...
#else
#ifndef CONTR3
...
#endif
...

#endif
#if (defined(CONTR2) || defined(CONTR1))
...
#endif

How can I hide all undefined sections in µV4 editor?

Parents
  • How about just writing:

    #if defined(CONTROLLER_1)
      #include "defines_controller_1.h"
    #elif defined(CONTROLLER_2)
      #include "defines_controller_2.h"
    #else
      #error "No controller defined, or controller unsupported"
    #endif
    

    I normally also have a:

    #if defined(HW_XX_R0)
      #define HAVE_INVERTED_IGNOTE 1
      #define NUM_RELAYS 4
      #define CONTROLLER_1
      ...
    

Reply
  • How about just writing:

    #if defined(CONTROLLER_1)
      #include "defines_controller_1.h"
    #elif defined(CONTROLLER_2)
      #include "defines_controller_2.h"
    #else
      #error "No controller defined, or controller unsupported"
    #endif
    

    I normally also have a:

    #if defined(HW_XX_R0)
      #define HAVE_INVERTED_IGNOTE 1
      #define NUM_RELAYS 4
      #define CONTROLLER_1
      ...
    

Children