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

Preprocessor directive #error in CARM

Hi!

How make preprocessor error? #error - not work in keil 4.12 (ARM)

#ifdef IO16_A
CPU_CLOCK = 50;
#elif IO16_B
CPU_CLOCK = 25;
#elif IO16_C
CPU_CLOCK = 8;
#else

#error "No select device type!"

#endif

Parents
  • I find out: generate syntax error

    #ifdef IO16_A
    if(strncmp(&FileName[0], "main_IO16_A", 11) == 0 && strncmp(&FileName[NameLen - 6], "_C.bin", 6) == 0)

    #elif REL6HC_A
    if(strncmp(&FileName[0], "main_REL6HC_A", 13) == 0 && strncmp(&FileName[NameLen - 6], "_C.bin", 6) == 0)

    #elif COM2_C
    if(strncmp(&FileName[0], "main_COM2_C", 11) == 0 && strncmp(&FileName[NameLen - 6], "_C.bin", 6) == 0)

    #elif REL12LC_A
    if(strncmp(&FileName[0], "main_REL12LC_A", 14) == 0 && strncmp(&FileName[NameLen - 6], "_C.bin", 6) == 0)

    #elif IR4_B
    if(strncmp(&FileName[0], "main_IR4_B", 10) == 0 && strncmp(&FileName[NameLen - 6], "_C.bin", 6) == 0)

    #else
    "Error message: No type Device HTTP_CGI" //compiler generate syntax error

    #endif
    { ErrorChannel = 0; return;
    }

Reply
  • I find out: generate syntax error

    #ifdef IO16_A
    if(strncmp(&FileName[0], "main_IO16_A", 11) == 0 && strncmp(&FileName[NameLen - 6], "_C.bin", 6) == 0)

    #elif REL6HC_A
    if(strncmp(&FileName[0], "main_REL6HC_A", 13) == 0 && strncmp(&FileName[NameLen - 6], "_C.bin", 6) == 0)

    #elif COM2_C
    if(strncmp(&FileName[0], "main_COM2_C", 11) == 0 && strncmp(&FileName[NameLen - 6], "_C.bin", 6) == 0)

    #elif REL12LC_A
    if(strncmp(&FileName[0], "main_REL12LC_A", 14) == 0 && strncmp(&FileName[NameLen - 6], "_C.bin", 6) == 0)

    #elif IR4_B
    if(strncmp(&FileName[0], "main_IR4_B", 10) == 0 && strncmp(&FileName[NameLen - 6], "_C.bin", 6) == 0)

    #else
    "Error message: No type Device HTTP_CGI" //compiler generate syntax error

    #endif
    { ErrorChannel = 0; return;
    }

Children