forked from PAWPAW-Mirror/lib_xua
Implement bug 11331 for iOS + MIDI configuration. Ran out of timers so have to be careful about use of init_iAP and polling timer.
This commit is contained in:
@@ -59,6 +59,9 @@ int uin_count = 0; // UART bytes in
|
|||||||
// state for iAP
|
// state for iAP
|
||||||
extern unsigned authenticating;
|
extern unsigned authenticating;
|
||||||
|
|
||||||
|
// state for auto-selecting dock or USB B
|
||||||
|
extern unsigned polltime;
|
||||||
|
|
||||||
extern port p_i2c_scl;
|
extern port p_i2c_scl;
|
||||||
extern port p_i2c_sda;
|
extern port p_i2c_sda;
|
||||||
#define p_midi_out p_i2c_scl
|
#define p_midi_out p_i2c_scl
|
||||||
@@ -121,8 +124,12 @@ chanend c_iap, chanend ?c_i2c // iOS stuff
|
|||||||
// printstr("mout0");
|
// printstr("mout0");
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
init_iAP(c_i2c);
|
init_iAP(c_i2c); // uses timer for i2c initialisation pause..
|
||||||
|
|
||||||
|
{
|
||||||
|
timer poll; // .. so declare this after or don't have enough timers
|
||||||
|
poll :> polltime;
|
||||||
|
polltime + XS1_TIMER_HZ / 2;
|
||||||
while (1) {
|
while (1) {
|
||||||
int is_ack;
|
int is_ack;
|
||||||
int is_reset;
|
int is_reset;
|
||||||
@@ -292,6 +299,10 @@ chanend c_iap, chanend ?c_i2c // iOS stuff
|
|||||||
p_midi_in :> void; // Change port around to input again after authenticating (unique to midi+iAP case)
|
p_midi_in :> void; // Change port around to input again after authenticating (unique to midi+iAP case)
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
case poll when timerafter(polltime) :> void:
|
||||||
|
handle_poll_dev_det(poll);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user