Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Loopback Device #43

Closed
wants to merge 31 commits into from
Closed

Conversation

paddatrapper
Copy link

Uses 2 FX2 dev boards as a loopback device

audio/out/app.c Outdated
/* Write to Endpoint 8 FIFO */
FIFOADD0 = 1;
FIFOADD1 = 1;
SYNCDELAY3;
Copy link
Member

@mithro mithro Aug 28, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

while (true) {
	// Do stuff
	....

	// Send the data from EP8 out to FD
	if (!(EP8CS & bmEPEMPTY)) {
		// Read the length of the incoming buffer
		uint16_t buflen = MAKEWORD(EP8BCH, EP8BCL);
		for (uint16_t i = 0; i < buflen; i++) {
			// Toggle clock low
			CLK = 0;
			// Write data
			FD = EP8FIFOBUF[i];
			// Sleep for a bit
			SYNCDELAY;
			SYNCDELAY;
			SYNCDELAY;
			SYNCDELAY;
			// Toggle clock high
			CLK = 1;
			// Sleep for a bit
			SYNCDELAY;
			SYNCDELAY;
			SYNCDELAY;
			SYNCDELAY;
		}
		// SKIP the buffer as we don't want it forward to the output FIFO.
		SKIP = 1;
	}

	// Do more stuff
	....
}

audio/out/app.c Outdated
usart_send_byte_hex(FD);
}
}
/* Discard byte from the FIFO */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discard buffer?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skip and don't commit to the FIFO

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants