Files
overwatch/9_Firmware/9_1_Microcontroller/tests/shims/diag_log.h
T
Jason 28a66889ad Add MCU firmware test harness with 8 bug-confirming tests
Complete test infrastructure for the observe-before-fix methodology:

- stm32_hal_mock: HAL stub types + spy/recording ring buffer (512 entries)
- ad_driver_mock: ADF4382/AD9523 mock drivers with configurable returns
- 9 shim headers redirecting real #includes to mock types
- Makefile with individual (test_bug1..8) and aggregate (test) targets

All 8 tests pass, confirming:
  #1 Timed sync init ordering (SetupTimedSync before initialized=true)
  #2 AD9523 double setup (first call before reset release)
  #3 TriggerTimedSync no-op (prints messages, no HW action)
  #4 Phase shift before init error check
  #5 SetFinePhaseShift GPIO-only placeholder (no PWM)
  #6 Timer variable collision (last_check vs last_check1)
  #7 GPIO pin mapping conflict (manager.h vs CubeMX main.h)
  #8 uart_print/uart_println commented out
2026-03-19 09:28:19 +02:00

19 lines
599 B
C

/* shim: diag_log.h -- disable DIAG macros for test builds */
#ifndef DIAG_LOG_H_SHIM
#define DIAG_LOG_H_SHIM
/* Silence all DIAG output during unit tests */
#define DIAG_DISABLE
#define DIAG(tag, fmt, ...) ((void)0)
#define DIAG_WARN(tag, fmt, ...) ((void)0)
#define DIAG_ERR(tag, fmt, ...) ((void)0)
#define DIAG_REG(tag, name, val) ((void)0)
#define DIAG_REG32(tag, name, val) ((void)0)
#define DIAG_GPIO(tag, name, port, pin) ((void)0)
#define DIAG_BOOL(tag, name, val) ((void)0)
#define DIAG_SECTION(name) ((void)0)
#define DIAG_ELAPSED(tag, name, t) ((void)0)
#endif