forked from PAWPAW-Mirror/lib_xua
BUG 11301: Prevent Multiple StartIDPS
This commit is contained in:
@@ -74,6 +74,7 @@ extern int data_to_send;
|
|||||||
//// state for GetDevAuthenticationSignature
|
//// state for GetDevAuthenticationSignature
|
||||||
//int startup = 1;
|
//int startup = 1;
|
||||||
extern unsigned authenticating;
|
extern unsigned authenticating;
|
||||||
|
extern unsigned identificationstarted;
|
||||||
|
|
||||||
extern port p_i2c_scl;
|
extern port p_i2c_scl;
|
||||||
extern port p_i2c_sda;
|
extern port p_i2c_sda;
|
||||||
@@ -321,18 +322,22 @@ chanend c_iap, chanend ?c_i2c // iOS stuff
|
|||||||
break;
|
break;
|
||||||
case !(isTX || isRX) => iap_get_ack_or_reset_or_data(c_iap, is_ack, is_reset, datum):
|
case !(isTX || isRX) => iap_get_ack_or_reset_or_data(c_iap, is_ack, is_reset, datum):
|
||||||
if (is_reset) {
|
if (is_reset) {
|
||||||
authenticating = 1;
|
// Do regardless
|
||||||
// Start buffer with StartIDPS message in
|
authenticating = 1;
|
||||||
iap_bufferlen = StartIDPS(iap_buffer);
|
port32A_set(P32A_I2C_NOTMIDI);
|
||||||
port32A_set(P32A_I2C_NOTMIDI);
|
// Prevent multiple issuing of StartIDPS (may need to handle it getting lost)
|
||||||
for (int i = 0; i != iap_bufferlen; i++) {
|
if (!identificationstarted) {
|
||||||
enqueue(to_host_fifo, iap_buffer[i]);
|
// Start buffer with StartIDPS message in
|
||||||
}
|
iap_bufferlen = StartIDPS(iap_buffer);
|
||||||
//dump(to_host_fifo);
|
for (int i = 0; i != iap_bufferlen; i++) {
|
||||||
// Start the ball rolling (so I will be expecting an ack)
|
enqueue(to_host_fifo, iap_buffer[i]);
|
||||||
outuint(c_iap, dequeue(to_host_fifo));
|
}
|
||||||
ith_count++;
|
//dump(to_host_fifo);
|
||||||
|
// Start the ball rolling (so I will be expecting an ack)
|
||||||
|
outuint(c_iap, dequeue(to_host_fifo));
|
||||||
|
ith_count++;
|
||||||
|
identificationstarted = 1;
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
//printstrln("iap_get_ack_or_data");
|
//printstrln("iap_get_ack_or_data");
|
||||||
if (is_ack) {
|
if (is_ack) {
|
||||||
|
|||||||
Reference in New Issue
Block a user