Remove unnecessary sleeps from parallel_transaction

This commit is contained in:
Jeremy Soller 2020-03-14 20:38:52 -06:00
parent 8f3588ef6b
commit abcc8c00e0
No known key found for this signature in database
GPG Key ID: E988B49EE78A7FB1

View File

@ -267,7 +267,6 @@ int parallel_transaction(struct Parallel * port, uint8_t * data, int length, boo
if (!read) {
byte = data[i];
parallel_write_data(port, byte);
_delay_us(1);
}
if (addr) {
@ -277,9 +276,8 @@ int parallel_transaction(struct Parallel * port, uint8_t * data, int length, boo
// Set data strobe low
gpio_set(port->data_n, false);
}
_delay_us(1);
// Wait for peripheral to indicate it's ready
// Wait for peripheral to indicate it's processing
while (!gpio_get(port->wait_n)) {}
if (read) {
@ -293,8 +291,9 @@ int parallel_transaction(struct Parallel * port, uint8_t * data, int length, boo
// Set data strobe high
gpio_set(port->data_n, true);
}
// XXX: Arduino peripheral not fast enough to get the data?
_delay_us(5);
// Wait for peripheral to indicate it's ready for next cycle
while (gpio_get(port->wait_n)) {}
if (!read) {
// Reset data lines to high