Beispiel #1
0
bool udd_ep_clear_halt(udd_ep_id_t ep)
{
	udd_ep_job_t *ptr_job;

	ep &= USB_EP_ADDR_MASK;
	if (USB_DEVICE_MAX_EP < ep) {
		return false;
	}
	ptr_job = &udd_ep_job[ep - 1];

	if (Is_udd_endpoint_stall_requested(ep)) {
		// Remove stall request
		udd_disable_stall_handshake(ep);
		if (Is_udd_stall(ep)) {
			udd_ack_stall(ep);
			// A packet has been stalled, then reset data toggle
			udd_reset_data_toggle(ep);
		}

		// If a job is register on clear halt action
		// then execute callback
		if (ptr_job->busy == true) {
			ptr_job->busy = false;
			ptr_job->call_nohalt();
		}
	}
	return true;
}
bool udd_ep_clear_halt(udd_ep_id_t ep)
{
	udd_ep_job_t *ptr_job;

	ep &= USB_EP_ADDR_MASK;
	if (USB_DEVICE_MAX_EP < ep)
		return false;
	ptr_job = &udd_ep_job[ep - 1];

	ptr_job->b_stall_requested = false;
	if (Is_udd_endpoint_stall_requested(ep)) {
		// Remove stall
		udd_disable_stall_handshake(ep);
		// Reset FIFO and data toggle (after stall cleared)
		udd_reset_endpoint(ep);
		// Clear stall status
		udd_ack_stall(ep);
		// If a job is register on clear halt action
		// then execute callback
		if (ptr_job->busy == true) {
			ptr_job->busy = false;
			ptr_job->call_nohalt();
		}
	}
	return true;
}
bool udd_ep_clear_halt(udd_ep_id_t ep)
{
	udd_ep_job_t *ptr_job;

	ep &= USB_EP_ADDR_MASK;
	if (USB_DEVICE_MAX_EP < ep)
		return false;
	ptr_job = &udd_ep_job[ep - 1];

	if (Is_udd_endpoint_stall_requested(ep)) {	// Endpoint stalled
		// Remove stall
		udd_disable_stall_handshake(ep);
		// If a job is register on clear halt action
		// then execute callback
		if (ptr_job->busy == true) {
			ptr_job->busy = false;
			ptr_job->call_nohalt();
		}
	}
	return true;
}
Beispiel #4
0
bool udd_ep_clear_halt(udd_ep_id_t ep)
{
	bool b_stall_cleared = false;
	udd_ep_job_t *ptr_job;

	ep &= USB_EP_ADDR_MASK;
	if (USB_DEVICE_MAX_EP < ep)
		return false;
	ptr_job = &udd_ep_job[ep - 1];

	if (ptr_job->stall_requested) {
		// Endpoint stall has been requested but not done
		// Remove stall request
		ptr_job->stall_requested = false;
		udd_disable_bank_interrupt(ep);
		udd_disable_endpoint_interrupt(ep);
		b_stall_cleared = true;
	}
	if (Is_udd_endpoint_stall_requested(ep)) { 
		if (Is_udd_stall(ep)) {
			udd_ack_stall(ep);
			// A packet has been stalled
			// then reset datatoggle
			udd_reset_data_toggle(ep);
		}
		// Disable stall
		udd_disable_stall_handshake(ep);
		udd_enable_endpoint_bank_autoswitch(ep);
		b_stall_cleared = true;
	}
	if (b_stall_cleared) {
		// If a job is register on clear halt action
		// then execute callback
		if (ptr_job->busy == true) {
			ptr_job->busy = false;
			ptr_job->call_nohalt();
		}
	}
	return true;
}