XUD_PowerSig.xc:
Code: Select all
case flag0_port when pinseq(0) :> void: // inverted port
// TODO debounce?
unsafe chanend c;
asm("getr %0, 2" : "=r"(c)); // XS1_RES_TYPE_CHANEND=2 (no inline assembly immediate operands in xC)
if (g_curSpeed == XUD_SPEED_HS)
{
// start high-speed switch so it's completed as quickly as possible after end of resume is seen
unsafe {
write_periph_word_two_part_start((chanend)c, USB_TILE_REF, XS1_SU_PER_UIFM_CHANEND_NUM, XS1_SU_PER_UIFM_FUNC_CONTROL_NUM, 0);
}
}
Code: Select all
void write_periph_word_two_part_end(chanend tmpchan, unsigned data)
{
/* Send last byte of data to bring the write to effect */
outuchar(tmpchan, data);
outct(tmpchan, XS1_CT_END);
}