diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2017-08-11 11:55:30 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2017-08-11 12:06:19 -0400 |
commit | f3da473285557b0424d9b649bc67faa686d74393 (patch) | |
tree | 0d6220db79b9a641051c0cc4c3f707cf4b963e36 | |
parent | f0f4ab7abec8abd79c06c6d69677f979a7059a80 (diff) | |
download | kutter-f3da473285557b0424d9b649bc67faa686d74393.tar.gz kutter-f3da473285557b0424d9b649bc67faa686d74393.tar.xz kutter-f3da473285557b0424d9b649bc67faa686d74393.zip |
docs: Update Code_Overview.md with PRU and command_dispatch() changes
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
-rw-r--r-- | docs/Code_Overview.md | 25 | ||||
-rw-r--r-- | src/command.c | 2 |
2 files changed, 15 insertions, 12 deletions
diff --git a/docs/Code_Overview.md b/docs/Code_Overview.md index bfff4021..9ba04625 100644 --- a/docs/Code_Overview.md +++ b/docs/Code_Overview.md @@ -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 ATmega micro-controllers. The **src/sam3x8e/** directory contains code specific to the Arduino Due style ARM micro-controllers. The -**src/simulator/** contains code stubs that allow the micro-controller -to be test compiled on other architectures. The **src/generic/** -directory contains helper code that may be useful across different -host architectures. The build arranges for includes of -"board/somefile.h" to first look in the current architecture directory -(eg, src/avr/somefile.h) and then in the generic directory (eg, -src/generic/somefile.h). +**src/pru/** directory contains code specific to the Beaglebone's +on-board PRU micro-controller. The **src/simulator/** contains code +stubs that allow the micro-controller to be test compiled on other +architectures. The **src/generic/** directory contains helper code +that may be useful across different host architectures. The build +arranges for includes of "board/somefile.h" to first look in the +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 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 DECL_TASK() macro. -One of the main task functions is command_task() located in -**src/command.c**. This function processes incoming serial commands -and runs the associated command function for them. Command functions -are declared using the DECL_COMMAND() macro. +One of the main task functions is command_dispatch() located in +**src/command.c**. This function is called from the board specific +input/output code (eg, **src/avr/serial.c**) and it runs the command +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 (however, they can temporarily disable interrupts if needed). These diff --git a/src/command.c b/src/command.c index 87284ee8..3e5ef4c9 100644 --- a/src/command.c +++ b/src/command.c @@ -217,7 +217,7 @@ const struct command_encoder encode_acknak PROGMEM = { enum { CF_NEED_SYNC=1<<0, CF_NEED_VALID=1<<1 }; -// Find the next complete message. +// Find the next complete message block int8_t command_find_block(char *buf, uint8_t buf_len, uint8_t *pop_count) { |