|
|
|
|
|
|
|
|
completestatus &= endpointN_notify_mask; |
|
|
completestatus &= endpointN_notify_mask; |
|
|
#if 1 |
|
|
#if 1 |
|
|
if (completestatus) { |
|
|
if (completestatus) { |
|
|
int s; |
|
|
|
|
|
|
|
|
|
|
|
// transmit: |
|
|
// transmit: |
|
|
s = 0; |
|
|
|
|
|
uint32_t tx = completestatus >> 16; |
|
|
uint32_t tx = completestatus >> 16; |
|
|
while(tx) { |
|
|
|
|
|
|
|
|
while (tx) { |
|
|
int p=__builtin_ctz(tx); |
|
|
int p=__builtin_ctz(tx); |
|
|
if (p==0) { |
|
|
|
|
|
run_callbacks(endpoint_queue_head + s * 2 + 1); |
|
|
|
|
|
p = 1; |
|
|
|
|
|
} |
|
|
|
|
|
tx >>= p; |
|
|
|
|
|
s += p; |
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
run_callbacks(endpoint_queue_head + p * 2 + 1); |
|
|
|
|
|
tx &= ~(1<<p); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
// receive: |
|
|
// receive: |
|
|
s = 0; |
|
|
|
|
|
uint32_t rx = completestatus & 0xffff; |
|
|
uint32_t rx = completestatus & 0xffff; |
|
|
while(rx) { |
|
|
while(rx) { |
|
|
int p=__builtin_ctz(rx); |
|
|
int p=__builtin_ctz(rx); |
|
|
if (p==0) { |
|
|
|
|
|
run_callbacks(endpoint_queue_head + s * 2); |
|
|
|
|
|
p = 1; |
|
|
|
|
|
} |
|
|
|
|
|
rx >>= p; |
|
|
|
|
|
s += p; |
|
|
|
|
|
|
|
|
run_callbacks(endpoint_queue_head + p * 2); |
|
|
|
|
|
rx &= ~(1<<p); |
|
|
}; |
|
|
}; |
|
|
} |
|
|
} |
|
|
#else |
|
|
#else |