PROS int main

So in prior years of programming, my written code usually doesn’t fit into the standard pre_auto, auto and drive control functions. In VCS last year I created a simple detection function of the current state and that called the required functions. This task function was called from int main.

However this year I am programming in PROS and I am running into an issue that we currently don’t have access to the int main. I spent a few hours looking over the GitHub code for the kernel and found the main.c file
main.c file location
Unfortunately, I was unable to find this file somewhere in all the files PROS installed onto my computer.

Is there any way to overload int main or change the current int main. I found this prior post Pros int main() and it was stated that this wasn’t possible and I was wondering if that has changed. I am willing to change the python scripts and anything else to do this.
Thanks for any help in advance!
1069B - Argonauts

Why do you need to do this?
The entrypoint of the code (int main) is embedded in the PROS kernel, and it starts the freeRTOS scheduler. That then starts initialize and opcontrol and all the other tasks.
If you need a single entrypoint, just regard initialize as main and do everything from there.
If you were to override int main, you would need to recompile the PROS kernel (you need VEX proprietary files to do so), and Tasks (and anything that uses them) would not work.

1 Like

The main question boils down to if it would be possible to recompile the PRO kernel, modifying the int main and pros_init would allow for greater control and a greater understanding of how PROS works. If this was possible I was going to find where the unplug alerts were originating from and turn them off. Also to use a non-round-robin task scheduler and the ability to no use any of the predefined functions. It was a hypothetical question to see if it was possible and to see if this could be another tool for advanced PROS programmers.

You can always add your own scheduler. Just never make a task using the built in RTOS and you don’t have to know that code even exists.

In answer to your big question.

Hey! Why can’t I build the PROS 3 kernel?

The PROS 3 kernel depends on VEX’s proprietary Software Development Kit (SDK), which is not publicly available.


The scheduler we use is actually a priority-based preemptive one. Tasks are scheduled round-robin only if they have the same priority.