From 5eb5a1d895695f7821868b34732d0d6eca2fdb23 Mon Sep 17 00:00:00 2001 From: Bernhard Tittelbach Date: Tue, 15 Oct 2013 00:53:11 +0000 Subject: various bugfixes and improvements + documentation git-svn-id: https://svn.spreadspace.org/avr/trunk@245 aa12f405-d877-488e-9caf-2d797e2a1cc7 --- pcr-controller/cmd_queue.h | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'pcr-controller/cmd_queue.h') diff --git a/pcr-controller/cmd_queue.h b/pcr-controller/cmd_queue.h index 84b8a01..d632f43 100644 --- a/pcr-controller/cmd_queue.h +++ b/pcr-controller/cmd_queue.h @@ -23,6 +23,13 @@ #include +/* The only actual reason for this queue is to enable non-blocking reads. +* I.e. we want to avoid blocking the main loop while waiting on a user-input terminating '\n', '\r' or ',' . +* As we could (and DO if the queue is full) execute a command right away once all arguments have been read, +* the queue really does not need to be 4 long and the whole handling could me much much simpler. +* I.e. only ever remember ONE command and execute it as soon as all args are present! +*/ + uint8_t cmdq_addCharToArgumentBuffer(uint8_t c); void cmdq_queueCmdWithNumArgs(void* fptr, uint8_t num_args); void cmdq_doWork(void); -- cgit v1.2.3