diff options
author | Paul Selkirk <paul@psgd.org> | 2017-04-17 16:12:16 -0400 |
---|---|---|
committer | Paul Selkirk <paul@psgd.org> | 2017-04-17 16:12:16 -0400 |
commit | dc0ec1a3e0afe5d3d46c9eafd15a87e7de016acb (patch) | |
tree | f687c4f1d2dca40a2dc88ac089ebbb495e0d73d3 | |
parent | 6c51d4438d84f34cce1a96834a5c91a2c71761ae (diff) |
Add a short delay to osMailAlloc, since we're no longer calling it in an ISR.
-rw-r--r-- | projects/hsm/hsm.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/projects/hsm/hsm.c b/projects/hsm/hsm.c index c5af86d..f71e2c2 100644 --- a/projects/hsm/hsm.c +++ b/projects/hsm/hsm.c @@ -151,13 +151,13 @@ void uart_rx_thread(void const *args) */ for ( ; ; osDelay(1)) { if (ibuf == NULL) { - if ((ibuf = (rpc_buffer_t *)osMailAlloc(ibuf_queue, 0)) == NULL) + if ((ibuf = (rpc_buffer_t *)osMailAlloc(ibuf_queue, 1)) == NULL) /* This could happen if all dispatch threads are busy, and * there are NUM_RPC_TASK requests already queued. We could * send a "server busy" error, or we could just try again on * the next tick. */ - continue; + Error_Handler(); ibuf->len = 0; } |