/** * Main function, initialization and main message loop * */ int main (void) { irq_initialize_vectors(); /* Initialize the board.ss * The board-specific conf_board.h file contains the configuration of * the board initialization. */ sysclk_init(); board_init(); sw_timer_init(); if (nwk_init()!= NWK_SUCCESS) { app_alert(); } zid_indication_callback_init(); /* * The stack is initialized above, hence the global interrupts are enabled * here. */ cpu_irq_enable(); /* Initializing udc stack as HID composite device*/ udc_start(); sw_timer_get_id(&APP_TIMER); /* Endless while loop */ //udi_hid_gpd_up(16); while (1) { app_task(); /* Application task */ nwk_task(); /* RF4CE network layer task */ } }
/** * Main function, initialization and main message loop * * @return error code */ int main (void) { irq_initialize_vectors(); /* Initialize the board. * The board-specific conf_board.h file contains the configuration of * the board initialization. */ board_init(); sysclk_init(); sw_timer_init(); if (nwk_init() != NWK_SUCCESS) { app_alert(); } zid_indication_callback_init(); cpu_irq_enable(); /* * The global interrupt has to be enabled here as TAL uses the timer * delay which in turn requires interrupt to be enabled */ serial_interface_init(); /* Loop forever, the interrupts are doing the rest */ while (1) { nwk_task(); serial_data_handler(); } /* No return statement here, because this code is unreachable */ }