From e890e429a5ba5587b39b6ce84f30401d87b21838 Mon Sep 17 00:00:00 2001 From: hlyi Date: Wed, 14 Oct 2026 00:22:08 -0500 Subject: [PATCH] Update adding-a-device.md --- doc/adding-a-device.md | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/doc/adding-a-device.md b/doc/adding-a-device.md index 8992b512..aab8f62f 100644 --- a/doc/adding-a-device.md +++ b/doc/adding-a-device.md @@ -1,17 +1,12 @@ # Adding a new device A device is supported by adding one board definition under `machine/`. -the build selects the definition by name, and CI compiles every file it finds. +the build selects the definition by name. ``` make MACHINE= ``` -`MACHINE=` selects `machine/.c` and is passed on to the compiler as -both `-DMACHINE_` (for the `#if defined(MACHINE_...)` blocks in the rest -of the firmware) and `-DMACHINE_NAME=` (which `machine.h` uses to include -`machine/.h`). The two always take the same value, so they cannot drift. - ## What a new device consists of | File | Purpose | @@ -39,8 +34,6 @@ the template: ``` The header is what the UI and the CLI print; `machine.h` includes it by name. -Nothing else belongs here — the machine is selected by the build, not by a -`#define` in the header. > [!NOTE] > `machine_name` is a `char[30]` and `MACHINE_MODEL` is copied into it at @@ -136,8 +129,7 @@ ln -s KP_9000_6XHML_X2.c machine/MY_BOARD_1_0.c The new board still needs `machine/MY_BOARD_1_0.h` with its own `MACHINE_MODEL`, because `MACHINE_MODEL` is what distinguishes the products. Existing examples: `machine/PCB_K0402WS_V3.c`, `machine/KP_9000_9XHML_X_V3_2.c` -and the six `KP_9000_*` revision variants. `git ls-files -s machine` shows these -as mode `120000`. +and the six `KP_9000_*` revision variants. Two files that differ only in whitespace or comments are duplicates and should be collapsed this way.