docs: Update Code_Overview.md with PRU and command_dispatch() changes

Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
Kevin O'Connor 2017-08-11 11:55:30 -04:00
parent f0f4ab7abe
commit f3da473285
2 changed files with 15 additions and 12 deletions

View File

@ -8,13 +8,14 @@ The **src/** directory contains the C source for the micro-controller
code. The **src/avr/** directory contains specific code for Atmel code. The **src/avr/** directory contains specific code for Atmel
ATmega micro-controllers. The **src/sam3x8e/** directory contains code ATmega micro-controllers. The **src/sam3x8e/** directory contains code
specific to the Arduino Due style ARM micro-controllers. The specific to the Arduino Due style ARM micro-controllers. The
**src/simulator/** contains code stubs that allow the micro-controller **src/pru/** directory contains code specific to the Beaglebone's
to be test compiled on other architectures. The **src/generic/** on-board PRU micro-controller. The **src/simulator/** contains code
directory contains helper code that may be useful across different stubs that allow the micro-controller to be test compiled on other
host architectures. The build arranges for includes of architectures. The **src/generic/** directory contains helper code
"board/somefile.h" to first look in the current architecture directory that may be useful across different host architectures. The build
(eg, src/avr/somefile.h) and then in the generic directory (eg, arranges for includes of "board/somefile.h" to first look in the
src/generic/somefile.h). current architecture directory (eg, src/avr/somefile.h) and then in
the generic directory (eg, src/generic/somefile.h).
The **klippy/** directory contains the C and Python source for the The **klippy/** directory contains the C and Python source for the
host part of the software. host part of the software.
@ -43,10 +44,12 @@ all functions that have been tagged with the DECL_INIT() macro. It
then goes on to repeatedly run all functions tagged with the then goes on to repeatedly run all functions tagged with the
DECL_TASK() macro. DECL_TASK() macro.
One of the main task functions is command_task() located in One of the main task functions is command_dispatch() located in
**src/command.c**. This function processes incoming serial commands **src/command.c**. This function is called from the board specific
and runs the associated command function for them. Command functions input/output code (eg, **src/avr/serial.c**) and it runs the command
are declared using the DECL_COMMAND() macro. functions associated with the commands found in the input
stream. Command functions are declared using the DECL_COMMAND() macro
(see the [protocol](Protocol.md) document for more information).
Task, init, and command functions always run with interrupts enabled Task, init, and command functions always run with interrupts enabled
(however, they can temporarily disable interrupts if needed). These (however, they can temporarily disable interrupts if needed). These

View File

@ -217,7 +217,7 @@ const struct command_encoder encode_acknak PROGMEM = {
enum { CF_NEED_SYNC=1<<0, CF_NEED_VALID=1<<1 }; enum { CF_NEED_SYNC=1<<0, CF_NEED_VALID=1<<1 };
// Find the next complete message. // Find the next complete message block
int8_t int8_t
command_find_block(char *buf, uint8_t buf_len, uint8_t *pop_count) command_find_block(char *buf, uint8_t buf_len, uint8_t *pop_count)
{ {