Loop for adding custom logic?

I’m interested in modding the firmware to add my own logic. I want to issue motor commands based on GPIO pin values and serial communications. Can I do this? Is there a loop where I can access these peripherals, add the logic, and issue motor commands? I see that there is a while loop at the bottom of main.c, would this work? Thanks!

Sorry we don’t currently have a “general purpose” loop implemented. The best option is for it to take the form of another scheduled RTOS task so that it could be correctly managed by the scheduler.