From dc0ec1a3e0afe5d3d46c9eafd15a87e7de016acb Mon Sep 17 00:00:00 2001 From: Paul Selkirk Date: Mon, 17 Apr 2017 16:12:16 -0400 Subject: Add a short delay to osMailAlloc, since we're no longer calling it in an ISR. --- projects/hsm/hsm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'projects') 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; } -- cgit v1.2.3