int main(void) { static console_command_t commands[2]; commands[0].callback = command_callback; commands[1].callback = branch_hub_command_callback; commands[1].help_callback = branch_hub_help_callback; ADCON1 = 0x0F; CMCON = 0x07; TRISA = 0x00; PORTA = 0x00; interrupt_initialize(); timer_initialize(); timer_register(timer_callback, 1000, &timer_id); timer_enable(timer_id); console_initialize(); console_register_command(commands[0], "main"); console_register_command(commands[1], "hub"); hub_init(HUB_ADDRESS); while(1) { console_process_tasks(); } }
/* * Register network extensions */ DWORD __declspec(dllexport) InitClientExtension() { DWORD index; for (index = 0; customCommands[index].name; index++) console_register_command(&customCommands[index]); return ERROR_SUCCESS; }