diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2016-12-22 23:47:46 -0500 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2016-12-23 17:06:10 -0500 |
commit | fe95ea221b2b88e9cb52a6378ff2018ee752094b (patch) | |
tree | 2223d604cc7d5bdf2c771b05e15834dd418b3823 /docs/Protocol.md | |
parent | 4e8674d5df46841e68b72b83911b28ec71079bf1 (diff) | |
download | kutter-fe95ea221b2b88e9cb52a6378ff2018ee752094b.tar.gz kutter-fe95ea221b2b88e9cb52a6378ff2018ee752094b.tar.xz kutter-fe95ea221b2b88e9cb52a6378ff2018ee752094b.zip |
build: Define DECL_CONSTANT mechanism for defining exported constants
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>
Diffstat (limited to 'docs/Protocol.md')
-rw-r--r-- | docs/Protocol.md | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/docs/Protocol.md b/docs/Protocol.md index 12d5e1ce..bd11400f 100644 --- a/docs/Protocol.md +++ b/docs/Protocol.md @@ -109,6 +109,19 @@ to generate and format arbitrary messages for human consumption. It is a wrapper around sendf() and as with sendf() it should not be called from interrupts or timers. +Declaring constants +------------------- + +The firmware can also define constants to be exported. For example, +the following: + +``` +DECL_CONSTANT(SERIAL_BAUD, 250000); +``` + +would export a constant named "SERIAL_BAUD" with a value of 250000 +from the firmware to the host. + Low-level message encoding ========================== @@ -262,8 +275,8 @@ dictionary. Once all chunks are obtained the host will assemble the chunks, uncompress the data, and parse the contents. In addition to information on the communication protocol, the data -dictionary also contains firmware version, configuration, and other -useful information. +dictionary also contains firmware version, constants (as defined by +DECL_CONSTANT), and static strings. Static Strings -------------- |