Here is the main C file. This is all it will ever be. Just calls to each module's polling routine.
main.c:
#include <xc.h>
#include "config_pic18f57k42.h"
#include "system_timer.h"
#include "init.h"
#include "power.h"
#include "ledbarbi.h"
#include "charlcd.h"
void main(void)
{
coldboot(); //cold boot initialization (init.c)
while (1)
{
system_timer_poll();
power_poll();
led_poll();
LCD_poll();
}
}