forked from PAWPAW-Mirror/lib_xua
Get iAP reset from decouple. Currently just done a initialisation.
This commit is contained in:
@@ -671,6 +671,7 @@ void decouple(chanend c_mix_out,
|
||||
xc_ptr zero_buffer = array_to_xc_ptr(g_zero_buffer);
|
||||
|
||||
int is_ack_iap;
|
||||
int is_reset;
|
||||
unsigned int datum_iap;
|
||||
int iap_data_remaining_to_device = 0;
|
||||
int iap_data_collected_from_device = 0;
|
||||
@@ -763,6 +764,7 @@ void decouple(chanend c_mix_out,
|
||||
|
||||
// send the current host -> device buffer out of the fifo
|
||||
XUD_SetReady(iap_from_host_usb_ep, 1);
|
||||
iap_send_reset(c_iap);
|
||||
#endif
|
||||
#endif
|
||||
|
||||
@@ -1233,7 +1235,7 @@ void decouple(chanend c_mix_out,
|
||||
select
|
||||
{
|
||||
/* Received word from iap thread - Check for ACK or Data */
|
||||
case iap_get_ack_or_data(c_iap, is_ack_iap, datum_iap):
|
||||
case iap_get_ack_or_reset_or_data(c_iap, is_ack_iap, is_reset, datum_iap):
|
||||
if (is_ack_iap)
|
||||
{
|
||||
/* An ack from the iap/uart thread means it has accepted some data we sent it
|
||||
|
||||
@@ -155,21 +155,11 @@ chanend c_iap, chanend ?c_i2c // iOS stuff
|
||||
// Initialise buffers
|
||||
init_queue(to_host_fifo, to_host_arr, 256);
|
||||
init_queue(from_host_fifo, from_host_arr, 256);
|
||||
// Start buffer with StartIDPS message in
|
||||
iap_bufferlen = StartIDPS(iap_buffer);
|
||||
port32A_set(P32A_I2C_NOTMIDI);
|
||||
for (int i = 0; i != iap_bufferlen; i++) {
|
||||
enqueue(to_host_fifo, iap_buffer[i]);
|
||||
}
|
||||
//dump(to_host_fifo);
|
||||
// Start the ball rolling (so I will be expecting an ack)
|
||||
outuint(c_iap, dequeue(to_host_fifo));
|
||||
ith_count++;
|
||||
|
||||
|
||||
|
||||
while (1) {
|
||||
int is_ack;
|
||||
int is_reset;
|
||||
unsigned int datum;
|
||||
select {
|
||||
// Input to read the start bit
|
||||
@@ -329,7 +319,21 @@ chanend c_iap, chanend ?c_i2c // iOS stuff
|
||||
#endif
|
||||
}
|
||||
break;
|
||||
case !(isTX || isRX) => iap_get_ack_or_data(c_iap, is_ack, datum):
|
||||
case !(isTX || isRX) => iap_get_ack_or_reset_or_data(c_iap, is_ack, is_reset, datum):
|
||||
if (is_reset) {
|
||||
authenticating = 1;
|
||||
// Start buffer with StartIDPS message in
|
||||
iap_bufferlen = StartIDPS(iap_buffer);
|
||||
port32A_set(P32A_I2C_NOTMIDI);
|
||||
for (int i = 0; i != iap_bufferlen; i++) {
|
||||
enqueue(to_host_fifo, iap_buffer[i]);
|
||||
}
|
||||
//dump(to_host_fifo);
|
||||
// Start the ball rolling (so I will be expecting an ack)
|
||||
outuint(c_iap, dequeue(to_host_fifo));
|
||||
ith_count++;
|
||||
|
||||
} else {
|
||||
//printstrln("iap_get_ack_or_data");
|
||||
if (is_ack) {
|
||||
// have we got more data to send
|
||||
@@ -378,6 +382,7 @@ chanend c_iap, chanend ?c_i2c // iOS stuff
|
||||
// printstrln("Completed authentication");
|
||||
p_midi_in :> void; // Change port around to input again after authenticating
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user