|
30 | 30 | #define SET_PROGRAM_COMPLETE "ati12" |
31 | 31 | #define START_3_WAY_HANDSHAKE "atc" |
32 | 32 |
|
| 33 | +#define DEBUG_CMD_ISSUE 0 |
33 | 34 | #define DEBUG_LOCAL_COMMANDS 0 |
34 | 35 | #define DEBUG_PC_CMD_ISSUE 0 |
35 | 36 | #define DEBUG_PC_TO_RADIO 0 |
|
64 | 65 | { \ |
65 | 66 | if (COMMAND_PENDING(queue, active)) \ |
66 | 67 | { \ |
| 68 | + if (DEBUG_CMD_ISSUE) \ |
| 69 | + { \ |
| 70 | + if (queue == pcCommandQueue) \ |
| 71 | + printf("PC %s done\n", commandName[active]); \ |
| 72 | + else \ |
| 73 | + { \ |
| 74 | + int vc = (&queue[0] - &virtualCircuitList[0].commandQueue[0]) \ |
| 75 | + * sizeof(QUEUE_T) / sizeof(virtualCircuitList[0]); \ |
| 76 | + printf("VC %d %s done\n", vc, commandName[active]); \ |
| 77 | + } \ |
| 78 | + } \ |
67 | 79 | queue[active / QUEUE_T_BITS] &= ~(1 << (active & QUEUE_T_MASK)); \ |
68 | 80 | active = CMD_LIST_SIZE; \ |
69 | 81 | } \ |
70 | 82 | } |
71 | 83 |
|
72 | | -#define COMMAND_ISSUE(queue, pollCount, cmd) \ |
73 | | -{ \ |
74 | | - /* Place the command in the queue */ \ |
75 | | - queue[cmd / QUEUE_T_BITS] |= 1 << (cmd & QUEUE_T_MASK); \ |
76 | | - \ |
77 | | - /* Timeout the command processor */ \ |
78 | | - if (!commandProcessorRunning) \ |
79 | | - commandProcessorRunning = STALL_CHECK_COUNT; \ |
80 | | - \ |
81 | | - /* Remember when this command was issued */ \ |
82 | | - if (!pollCount) \ |
83 | | - { \ |
84 | | - if (timeoutCount) \ |
85 | | - pollCount = timeoutCount; \ |
86 | | - else \ |
87 | | - pollCount = 1; \ |
88 | | - } \ |
| 84 | +#define COMMAND_ISSUE(queue, pollCount, cmd) \ |
| 85 | +{ \ |
| 86 | + if (DEBUG_CMD_ISSUE) \ |
| 87 | + { \ |
| 88 | + if (!COMMAND_PENDING(queue, cmd)) \ |
| 89 | + { \ |
| 90 | + if (queue == pcCommandQueue) \ |
| 91 | + printf("PC %s issued\n", commandName[cmd]); \ |
| 92 | + else \ |
| 93 | + { \ |
| 94 | + int vc = (&queue[0] - &virtualCircuitList[0].commandQueue[0]) \ |
| 95 | + * sizeof(QUEUE_T) / sizeof(virtualCircuitList[0]); \ |
| 96 | + printf("VC %d %s issued\n", vc, commandName[cmd]); \ |
| 97 | + } \ |
| 98 | + } \ |
| 99 | + } \ |
| 100 | + \ |
| 101 | + /* Place the command in the queue */ \ |
| 102 | + queue[cmd / QUEUE_T_BITS] |= 1 << (cmd & QUEUE_T_MASK); \ |
| 103 | + \ |
| 104 | + /* Timeout the command processor */ \ |
| 105 | + if (!commandProcessorRunning) \ |
| 106 | + commandProcessorRunning = STALL_CHECK_COUNT; \ |
| 107 | + \ |
| 108 | + /* Remember when this command was issued */ \ |
| 109 | + if (!pollCount) \ |
| 110 | + { \ |
| 111 | + if (timeoutCount) \ |
| 112 | + pollCount = timeoutCount; \ |
| 113 | + else \ |
| 114 | + pollCount = 1; \ |
| 115 | + } \ |
89 | 116 | } |
90 | 117 |
|
91 | 118 | #define COMMAND_PENDING(queue,cmd) ((queue[cmd / QUEUE_T_BITS] >> (cmd & QUEUE_T_MASK)) & 1) |
|
0 commit comments