From 720babd39da28f2fac1b1172c76c2efc331209d5 Mon Sep 17 00:00:00 2001 From: Hayodea Hekol Date: Fri, 31 Oct 2025 11:31:04 -0400 Subject: [PATCH] CMake,config.h: Add -DSTIMBUFF_FRAME_PERIOD_MS This determines the maximum rate at which stimbuffs will be refreshed with data from their device. A device may refresh less frequently than this, but not more frequently. The goal here is to give us control over the max rate at which a device produces data. --- CMakeLists.txt | 10 ++++++++++ include/config.h.in | 2 ++ 2 files changed, 12 insertions(+) diff --git a/CMakeLists.txt b/CMakeLists.txt index f135fbe..0fd527b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -32,6 +32,14 @@ if(NOT MRNTT_DEVMGR_REATTACHER_PERIOD_MS GREATER 0) "MRNTT_DEVMGR_REATTACHER_PERIOD_MS must be a positive integer > 0") endif() +# Stimulus buffer frame period configuration +set(STIMBUFF_FRAME_PERIOD_MS 33 + CACHE STRING "Stimulus buffer frame period (ms)") +if(NOT STIMBUFF_FRAME_PERIOD_MS GREATER 0) + message(FATAL_ERROR + "STIMBUFF_FRAME_PERIOD_MS must be a positive integer > 0") +endif() + # World thread configuration option(WORLD_USE_BODY_THREAD "Use body thread for world component instead of separate world thread" OFF) @@ -51,6 +59,8 @@ endif() # Set the timeout variable for config.h set(CONFIG_DEBUG_QUTEX_DEADLOCK_TIMEOUT_MS ${DEBUG_QUTEX_DEADLOCK_TIMEOUT_MS}) +# Set the stimulus buffer frame period variable for config.h +set(CONFIG_STIMBUFF_FRAME_PERIOD_MS ${STIMBUFF_FRAME_PERIOD_MS}) # Configure config.h configure_file( diff --git a/include/config.h.in b/include/config.h.in index 43df18b..f5d0899 100644 --- a/include/config.h.in +++ b/include/config.h.in @@ -11,6 +11,8 @@ /* Device manager reattacher configuration */ #define CONFIG_MRNTT_DEVMGR_REATTACHER_PERIOD_MS @MRNTT_DEVMGR_REATTACHER_PERIOD_MS@ +/* Stimulus buffer frame period configuration */ +#define CONFIG_STIMBUFF_FRAME_PERIOD_MS @CONFIG_STIMBUFF_FRAME_PERIOD_MS@ /* World thread configuration */ #cmakedefine CONFIG_WORLD_USE_BODY_THREAD