Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Core #define statements mismatched #562

Open
MadBerry58 opened this issue Oct 10, 2024 · 2 comments
Open

Core #define statements mismatched #562

MadBerry58 opened this issue Oct 10, 2024 · 2 comments

Comments

@MadBerry58
Copy link

printf("Starting %s on core 1:\n", rtos_name);

@lurch
Copy link
Contributor

lurch commented Oct 10, 2024

Huh? Could you provide some more detail please? Thank you.

@MadBerry58
Copy link
Author

MadBerry58 commented Oct 11, 2024

#if (configNUMBER_OF_CORES > 1)
    printf("Starting %s on both cores:\n", rtos_name);
    vLaunch();
#elif (RUN_FREE_RTOS_ON_CORE == 1 && configNUMBER_OF_CORES==1)
    printf("Starting %s on core 1:\n", rtos_name);
    multicore_launch_core1(vLaunch);
    while (true);
#else
    printf("Starting %s on core 0:\n", rtos_name);
    vLaunch();
#endif

    return 0;

Please correct me if I'm wrong, but in the above statements, the precompile directive #if (configNUMBER_OF_CORES > 1) will only generate the code

    printf("Starting %s on both cores:\n", rtos_name);
    vLaunch();
    return 0;

thus not actually starting vLaunch on both cores.

The 2nd statement #elif (RUN_FREE_RTOS_ON_CORE == 1 && configNUMBER_OF_CORES==1) seems inconsistent, as configNUMBER_OF_CORES==1 should not allow the core1(which should be in theory dependent on a value of configNUMBER_OF_CORES==2) to be started, thus the generated code

    printf("Starting %s on core 1:\n", rtos_name);
    multicore_launch_core1(vLaunch);
    while (true);
    return 0;

should also be logically inconsistent.

Feel free to correct any mistakes in my understanding, thank you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants