From d4db0b2d44c29c97c165b6981d6285ca30d10461 Mon Sep 17 00:00:00 2001 From: Ryan Howard Date: Tue, 19 Mar 2024 13:27:24 -0400 Subject: [PATCH] fix(sensors): improvments to compile time defines for pressure move (#760) * fix(sensors): my assumptions for USE_PRESSRE_MOVE were wrong, this fixes it * decrease the buffer size --- include/sensors/core/tasks/pressure_driver.hpp | 8 +++----- pipettes/core/CMakeLists.txt | 18 +++++++++++++++--- 2 files changed, 18 insertions(+), 8 deletions(-) diff --git a/include/sensors/core/tasks/pressure_driver.hpp b/include/sensors/core/tasks/pressure_driver.hpp index 777d2e52b..c9d18e0d5 100644 --- a/include/sensors/core/tasks/pressure_driver.hpp +++ b/include/sensors/core/tasks/pressure_driver.hpp @@ -14,12 +14,10 @@ #include "sensors/core/sensors.hpp" #include "sensors/core/utils.hpp" -#ifndef USE_PRESSURE_MOVE -constexpr size_t PRESSURE_SENSOR_BUFFER_SIZE = 0; -#elif PIPETTE_TYPE_DEFINE == NINETY_SIX_CHANNEL -constexpr size_t PRESSURE_SENSOR_BUFFER_SIZE = 1800; +#if defined(USE_PRESSURE_MOVE) +constexpr size_t PRESSURE_SENSOR_BUFFER_SIZE = P_BUFF_SIZE; #else -constexpr size_t PRESSURE_SENSOR_BUFFER_SIZE = 3000; +constexpr size_t PRESSURE_SENSOR_BUFFER_SIZE = 0; #endif namespace sensors { diff --git a/pipettes/core/CMakeLists.txt b/pipettes/core/CMakeLists.txt index 4d3ef01cb..0a22909c0 100644 --- a/pipettes/core/CMakeLists.txt +++ b/pipettes/core/CMakeLists.txt @@ -1,4 +1,7 @@ function(target_pipettes_core_common TARGET REVISION) + if(${USE_PRESSURE_MOVE}) + target_compile_definitions(${TARGET} PUBLIC USE_PRESSURE_MOVE) + endif() target_sources(${TARGET} PUBLIC ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/configs.cpp ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/peripheral_tasks.cpp @@ -9,14 +12,14 @@ function(target_pipettes_core_common TARGET REVISION) target_include_directories(${TARGET} PUBLIC ${CMAKE_CURRENT_FUNCTION_LIST_DIR}) target_link_libraries(${TARGET} PUBLIC common-core) target_include_directories(${TARGET} INTERFACE ${CMAKE_SOURCE_DIR}/cpp-utils/include) - if(${USE_PRESSURE_MOVE}) - add_compile_definitions(-DUSE_PRESSURE_MOVE) - endif() endfunction() function(target_pipettes_core_single TARGET REVISION) target_pipettes_core_common(${TARGET} ${REVISION}) target_compile_definitions(${TARGET} PUBLIC PIPETTE_TYPE_DEFINE=SINGLE_CHANNEL) + if(${USE_PRESSURE_MOVE}) + target_compile_definitions(${TARGET} PUBLIC P_BUFF_SIZE=2800) + endif() target_sources(${TARGET} PUBLIC ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/can_task_low_throughput.cpp) endfunction() @@ -24,6 +27,9 @@ endfunction() function(target_pipettes_core_multi TARGET REVISION) target_pipettes_core_common(${TARGET} ${REVISION}) target_compile_definitions(${TARGET} PUBLIC PIPETTE_TYPE_DEFINE=EIGHT_CHANNEL) + if(${USE_PRESSURE_MOVE}) + target_compile_definitions(${TARGET} PUBLIC P_BUFF_SIZE=2800) + endif() target_sources(${TARGET} PUBLIC ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/can_task_low_throughput.cpp) endfunction() @@ -31,6 +37,9 @@ endfunction() function(target_pipettes_core_96 TARGET REVISION) target_pipettes_core_common(${TARGET} ${REVISION}) target_compile_definitions(${TARGET} PUBLIC PIPETTE_TYPE_DEFINE=NINETY_SIX_CHANNEL) + if(${USE_PRESSURE_MOVE}) + target_compile_definitions(${TARGET} PUBLIC P_BUFF_SIZE=1800) + endif() target_sources(${TARGET} PUBLIC ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/can_task_high_throughput.cpp) endfunction() @@ -38,6 +47,9 @@ endfunction() function(target_pipettes_core_384 TARGET REVISION) target_pipettes_core_common(${TARGET} ${REVISION}) target_compile_definitions(${TARGET} PUBLIC PIPETTE_TYPE_DEFINE=THREE_EIGHTY_FOUR_CHANNEL) + if(${USE_PRESSURE_MOVE}) + target_compile_definitions(${TARGET} PUBLIC P_BUFF_SIZE=1800) + endif() target_sources(${TARGET} PUBLIC ${CMAKE_CURRENT_FUNCTION_LIST_DIR}/can_task_high_throughput.cpp) endfunction()