Files
STM32F4-Base/test/host/net_socket/stub/dbg_log.h
T
wandering1 e4981aa2f6 refactor(docs): point entry-file references at their new homes
AGENTS.md stopped being the store of record for build steps, Python env,
hardware pins, doc conventions, log cost and task ownership. Those facts
already live in docs, skills and role files; the entry file now only
points at them. This commit moves every reference that used to name the
entry file to the authoritative landing point, so a reader who follows a
link arrives at the fact instead of at a sentence that no longer exists.

What changed is links and prose, not behaviour. Code, scripts and tests
only have comment and docstring lines touched; the only non-comment edit
in the whole changeset is one note string inside the generated pin table
JSON, and its generator was changed in the same step so the two stay
byte-identical.

New landing points created before the references were retargeted:
- The console single-writer log design doc, section 7.1, is now the single
  authority for log cost: about 90 B flash and 216 B stack per DBG_ line,
  and the rule that deep call chains must predefine DBG_LINE_BUF_MAX.
  It also carries the full list of the twelve translation units that have
  tightened it, plus the grep command that decides the truth if the list
  and the code ever disagree.
- The document writing standard, section 2, now holds the BOM list.
- keil-build skill gains an exit code table: 0 success, 1 build failure,
  2 BuildEnvError, 3 usage, 4 build lock held. This corrects a belief
  that was never actually written down anywhere: exit 2 does not simply
  mean environment error, argparse also exits 2 and the wrapper script
  was remapped so the two no longer collide.

Regenerated and checked byte for byte:
- The end-to-end architecture SVG in docs/images from its generator.
- tools/netlist_semantics/pinout_kb.json from gen_kb.py.
Both are idempotent; running the generators again produces no diff.

Deliberately not touched, because machines read them:
- scripts/check_bom_drift.py joins every line containing BOM and asserts
  four paths are present, so the entry file BOM line must stay one line.
- scripts/gen_task_table.py reads the TASK_TABLE anchors directly.
- scripts/rename_maps and scripts/archive keep their historical wording;
  they describe what happened, not what is true now.

Verified: doc links report the same six pre-existing findings as the base
commit and no new ones, generated-fresh passes, bom drift is clean across
101 files, and AGENTS.md itself is unchanged in this commit.
2026-11-16 19:38:27 +08:00

25 lines
1.2 KiB
C
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/*
* 模块名称:主机侧单测桩 - dbg_log.h(net_socket 模块专用)
* 模块功能:DBG_* 换成计数,风格与本目录既有 NET 域桩一致(net_listener / net_events
* 同名文件)。net_socket.c 有 11 条 DBG_ERROR + 6 条 DBG_INFO,其中
* 「短写必留痕」「版本门控拒置 bit3 必 [ERR]」「open 失败必 [ERR]」
* 「close 复位没成也放行仍要留痕」这四条本身就是可断言的契约。
* 本模块在 include 本头之前把 DBG_LINE_BUF_MAX 设为 128U(深调用链纪律 →
* docs/子系统设计/控制台单写者日志设计.md §7.1),
* 桩不关心缓冲大小,只数条数。
* ⚠ 仅供主机侧单测使用,不参与 MCU 构建。
* 创建日期:2026-10-24
*/
#ifndef DBG_LOG_H
#define DBG_LOG_H
extern int g_ns_info_count;
extern int g_ns_error_count;
extern int g_ns_debug_count;
#define DBG_INFO(fmt, ...) do { (void)(fmt); g_ns_info_count++; } while (0)
#define DBG_DEBUG(fmt, ...) do { (void)(fmt); g_ns_debug_count++; } while (0)
#define DBG_ERROR(fmt, ...) do { (void)(fmt); g_ns_error_count++; } while (0)
#endif /* DBG_LOG_H */