summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2008-07-11 06:45:36 +0000
committerMarcel Holtmann <marcel@holtmann.org>2008-07-11 06:45:36 +0000
commitd048c324b31c685b6123098b415222b4ee6699bc (patch)
tree32f9c0e1f65a8f0c1f2f83ed28aaeca9c5f90d09 /tools
parent04b57ca4d5f35f8ed04db2494728c73b02b412d4 (diff)
Fix BCSP sent/receive handling
Diffstat (limited to 'tools')
-rw-r--r--tools/csr_bcsp.c26
1 files changed, 13 insertions, 13 deletions
diff --git a/tools/csr_bcsp.c b/tools/csr_bcsp.c
index 0dc334cb..bcf56a35 100644
--- a/tools/csr_bcsp.c
+++ b/tools/csr_bcsp.c
@@ -188,19 +188,6 @@ static int do_command(uint16_t command, uint16_t seqnum, uint16_t varid, uint8_t
while (1) {
delay = ubcsp_poll(&activity);
- if (activity & UBCSP_PACKET_RECEIVED) {
- if (sent && receive_packet.channel == 5 &&
- receive_packet.payload[0] == 0xff) {
- memcpy(rp, receive_packet.payload,
- receive_packet.length);
- break;
- }
-
- receive_packet.length = 512;
- ubcsp_receive_packet(&receive_packet);
- timeout = 0;
- }
-
if (activity & UBCSP_PACKET_SENT) {
switch (varid) {
case CSR_VARID_COLD_RESET:
@@ -214,6 +201,19 @@ static int do_command(uint16_t command, uint16_t seqnum, uint16_t varid, uint8_t
timeout = 0;
}
+ if (activity & UBCSP_PACKET_RECEIVED) {
+ if (sent && receive_packet.channel == 5 &&
+ receive_packet.payload[0] == 0xff) {
+ memcpy(rp, receive_packet.payload,
+ receive_packet.length);
+ break;
+ }
+
+ receive_packet.length = 512;
+ ubcsp_receive_packet(&receive_packet);
+ timeout = 0;
+ }
+
if (delay) {
usleep(delay * 100);