Skip to content

Commit

Permalink
fix(sensors): improvments to compile time defines for pressure move (#…
Browse files Browse the repository at this point in the history
…760)

* fix(sensors): my assumptions for USE_PRESSRE_MOVE were wrong, this fixes it

* decrease the buffer size
  • Loading branch information
ryanthecoder authored Mar 19, 2024
1 parent 1413581 commit d4db0b2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 8 deletions.
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()

0 comments on commit d4db0b2

Please sign in to comment.