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 }
static void sco_sock_clear_timer(struct sock *sk) { BT_DBG("sock %p state %d", sk, sk->state); cyg_alarm_disable(sk->timeout_alarm_handle); cyg_alarm_delete(sk->timeout_alarm_handle); // if (timer_pending(&sk->timer) && del_timer(&sk->timer)) __sock_put(sk); }
/* destroy alarm objects and pthread_cond objects */ void close_scheduler(void) { int i; for (i=0; i<NUM_ALARMS; i++) cyg_alarm_delete (alarm_hdl[i]); pthread_cond_destroy (&trigger_daq); pthread_cond_destroy (&trigger_actuators); pthread_cond_destroy (&trigger_thread1); }
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(); }
/*---------------------------------------------------------------------------*/ void ctimer_stop(struct ctimer *c) { /* if(initialized) { etimer_stop(&c->etimer); } else { c->etimer.next = NULL; c->etimer.p = PROCESS_NONE; } list_remove(ctimer_list, c); */ if (c->MyeCosAlramObj.initialized){ cyg_alarm_delete((c->MyeCosAlramObj).alarm_handle); c->MyeCosAlramObj.initialized =0; } }
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; }