void linklocal_msg_timer(cyg_handle_t handle, cyg_addrword_t ptr){ int need_post_linklocal = ip_conflict_cnt; if( start_timer_flag == 0 ) { linklocal_start_time = msclock(); start_timer_flag = 1; } linklocal_stop_time = msclock(); if( (linklocal_stop_time - linklocal_start_time) > 10000) { ip_conflict_cnt = 0; // reset counter anyway start_timer_flag = 0; linklocal_stop_time = 0; cyg_alarm_delete(hAlarm); //eCos cyg_clock_delete(hSysClk); //eCos cyg_counter_delete(hCounter); //eCos } if( (LinkLocal_get_current_state() != IDLE) ) { ip_conflict_cnt = 0; // reset counter anyway start_timer_flag = 0; cyg_semaphore_post(&linklocal_conflict); cyg_alarm_delete(hAlarm); //eCos cyg_clock_delete(hSysClk); //eCos cyg_counter_delete(hCounter); //eCos } if ( (need_post_linklocal > 1) && (LinkLocal_get_current_state() == IDLE) ){ // cyg_semaphore_post(&linklocal_conflict);//signal to inform ip conflict ip_conflict_cnt = 0; // reset counter anyway start_timer_flag = 0; if( ReadPrintStatus() != 3 ) { LinkLocal_set_state(RETRY); cyg_semaphore_post(&linklocal_sem); //signal to restart set link local ip } cyg_alarm_delete(hAlarm); //eCos cyg_clock_delete(hSysClk); //eCos cyg_counter_delete(hCounter); //eCos } }
void CloseTcpHole (cyg_handle_t handle, cyg_addrword_t ptr) { TCP_HOLE_FLAG = 0; cyg_alarm_delete(CloseTcpHole_Alarm); //eCos cyg_clock_delete(CloseTcpHole_SysClk); //eCos cyg_counter_delete(CloseTcpHole_Counter); //eCos }
cyg_bool_t flash( void ) { cyg_counter_create( &counter0, &counter0o ); cyg_counter_create( &counter1, &counter1o ); cyg_alarm_create( counter0, call_me, (cyg_addrword_t)12, &alarm0, &alarmo[0]); res.dividend = 1; res.divisor = 2; cyg_clock_create( res, &clock0, &clock0o ); cyg_clock_delete( clock0 ); cyg_alarm_delete( alarm0 ); cyg_counter_delete( counter0 ); cyg_counter_delete( counter1 ); return true; }
void star_usb_init(cyg_handle_t handle, cyg_addrword_t ptr) { //Stop timer cyg_alarm_delete(USB_INIT_Alarm); cyg_clock_delete(USB_INIT_SysClk); cyg_counter_delete(USB_INIT_Counter); //init memory pci_usb_pool_init(); //usb usb_init(); //ohci ohci_hcd_init(0x5C, SYSPA_USB11_OPERATION_BASE_ADDR); //ehci ehci_hcd_init(0x6B, SYSPA_USB20_OPERATION_BASE_ADDR); //Printer Class usblp_init(); }