Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(sensors): improvments to compile time defines for pressure move #760

Merged
merged 2 commits into from
Mar 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 3 additions & 5 deletions include/sensors/core/tasks/pressure_driver.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
18 changes: 15 additions & 3 deletions pipettes/core/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -9,35 +12,44 @@ 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()

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()

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()

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()
Loading