aboutsummaryrefslogtreecommitdiffstats
path: root/docs/Code_Overview.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/Code_Overview.md')
-rw-r--r--docs/Code_Overview.md20
1 files changed, 11 insertions, 9 deletions
diff --git a/docs/Code_Overview.md b/docs/Code_Overview.md
index 2b35688f..fff6d7c9 100644
--- a/docs/Code_Overview.md
+++ b/docs/Code_Overview.md
@@ -1,8 +1,10 @@
+# Code overview
+
This document describes the overall code layout and major code flow of
Klipper.
Directory Layout
-================
+----------------
The **src/** directory contains the C source for the micro-controller
code. The **src/atsam/**, **src/atsamd/**, **src/avr/**,
@@ -39,7 +41,7 @@ object that is built is **out/klipper.elf.hex** on AVR and
**out/klipper.bin** on ARM.
Micro-controller code flow
-==========================
+--------------------------
Execution of the micro-controller code starts in architecture specific
code (eg, **src/avr/main.c**) which ultimately calls sched_main()
@@ -90,7 +92,7 @@ gpio functions are inlined into their callers, and there is no
run-time cost to using them.
Klippy code overview
-====================
+--------------------
The host code (Klippy) is intended to run on a low-cost computer (such
as a Raspberry Pi) paired with the micro-controller. The code is
@@ -116,7 +118,7 @@ the log (see **klippy/queuelogger.py**) so that the other threads
never block on log writes.
Code flow of a move command
-===========================
+---------------------------
A typical printer movement starts when a "G1" command is sent to the
Klippy host and it completes when the corresponding step pulses are
@@ -228,7 +230,7 @@ movements and their timings. The remaining parts of the processing is
mostly just communication and plumbing.
Adding a host module
-====================
+--------------------
The Klippy host code has a dynamic module loading capability. If a
config section named "[my_module]" is found in the printer config file
@@ -308,7 +310,7 @@ The following may also be useful:
existing modules for the preferred format.
Adding new kinematics
-=====================
+---------------------
This section provides some tips on adding support to Klipper for
additional types of printer kinematics. This type of activity requires
@@ -348,7 +350,7 @@ Useful steps:
cases and to check for regressions.
Porting to a new micro-controller
-=================================
+---------------------------------
This section provides some tips on porting Klipper's micro-controller
code to a new architecture. This type of activity requires good
@@ -401,7 +403,7 @@ Useful steps:
9. Consider adding build test cases in the test/ directory.
Coordinate Systems
-==================
+------------------
Internally, Klipper primarily tracks the position of the toolhead in
cartesian coordinates that are relative to the coordinate system
@@ -487,7 +489,7 @@ the config file) after a `G28` home command. The `SET_GCODE_OFFSET`
command can alter this value.
Time
-====
+----
Fundamental to the operation of Klipper is the handling of clocks,
times, and timestamps. Klipper executes actions on the printer by