aboutsummaryrefslogtreecommitdiffstats
path: root/src/command.h
Commit message (Collapse)AuthorAgeFilesLines
* buildcommands: Match DECL_X names to the actual C macro namesKevin O'Connor2019-08-221-6/+7
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* command: Allow count parameter of DECL_ENUMERATION_RANGE() to be an expressionKevin O'Connor2019-08-221-2/+2
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* ctr: Add support for multiple integers in DECL_CTR_INTKevin O'Connor2019-08-221-5/+5
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* msgproto: Convert static strings to a more generic enumeration systemKevin O'Connor2019-03-171-0/+7
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* command: Support evaluating C expressions in DECL_CONSTANT()Kevin O'Connor2019-03-171-11/+7
| | | | Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* command: Always pass a string to the DECL_CONSTANT() macroKevin O'Connor2019-03-171-4/+4
| | | | | | | | Make it clear that the name of the constant being defined is a string. When the value being defined is also a string, use a new DECL_CONSTANT_STR() macro. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* command: Wait to send ack until after processing commandsKevin O'Connor2018-05-281-0/+1
| | | | | | | Send the ack after processing commands - this gives the host code more information on serial buffer utilization. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* command: Add command_find_and_dispatch() helperKevin O'Connor2018-05-281-0/+2
| | | | | | | Add a helper function that calls command_find_block() followed by command_dispatch(). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* command: Add a command_encode_and_frame() helperKevin O'Connor2018-05-281-1/+3
| | | | | | | Add a helper function that calls command_encodef() followed by command_add_frame(). Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* command: Prefer uint8_t* for buffers; prefer uint8_fast_t for lengthsKevin O'Connor2018-05-281-7/+8
| | | | | | | | | Prefer using 'uint8_t' buffers as it is too easy to run into C sign extension problems with 'char' buffers. Prefer using 'uint_fast8_t' for buffer lengths as gcc does a better job compiling them on 32bit mcus. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* command: Don't pass max_size to command_encodef()Kevin O'Connor2017-08-141-2/+2
| | | | | | | | | The command_encodef() can read the max_size parameter directly from the 'struct command_encoder' passed into it. Also, there is no need to check that a message will fit in a buffer if the buffer is declared to be MESSAGE_MAX in size. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* pru: Rework command processing so that most of it is done on pru0Kevin O'Connor2017-06-301-0/+15
| | | | | | | | Change the command dispatch and response generation so that most of the work is done on pru0 instead of pru1. This allows more code to fit into the limited space on pru1. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* command: Move low-level sendf transmission into board codeKevin O'Connor2017-06-291-9/+13
| | | | | | | | Export a new console_sendf() function from the board code instead of console_get_output() and console_push_output(). This enables more flexibility in how the board specific code produces output. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* command: Move command_task() to board specific codeKevin O'Connor2017-06-291-0/+2
| | | | | | | | Move the command_task() code from the generic code to the board specific code. This enables more flexibility in how the board specific code processes input. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* command: Store the command parsing information directly in arrayKevin O'Connor2017-05-261-1/+1
| | | | | | | Instead of defining an array of pointers, just define the array directly. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* build: Avoid linker magic in compile_time_request.c unique id generationKevin O'Connor2017-05-261-31/+20
| | | | | | | | | | | | Avoid generating unique ids via memory locations and linker scripts. Instead, generate them using code produced by buildcommands.py. Utilize gcc's ability to perform static string comparisons at compile time to produce a unique id for each unique string. This fixes a build failure on ARM introduced in 142b92b8. It also reduces the complexity of the build. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* command: Use "i" instead of "m" constraint in _DECL_REQUEST_IDKevin O'Connor2017-05-151-1/+1
| | | | | | | On some architectures, gcc will allocate a register for inline assembler with an "m" constraint. Use "i" to avoid that. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* build: Define DECL_CONSTANT mechanism for defining exported constantsKevin O'Connor2016-12-231-0/+9
| | | | | | | | | Add a DECL_CONSTANT macro to allow the firmware to define constants that are to be exported to the host during the "identify" phase. This replaces the existing hardcoded mechanism of scanning the Kconfig header file for certain constants. Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
* Initial commit of source code.Kevin O'Connor2016-05-251-0/+81
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>