Skip to content

Commit

Permalink
updates to match pressure work
Browse files Browse the repository at this point in the history
  • Loading branch information
pmoegenburg committed May 1, 2024
1 parent 628c9c1 commit 6ac10b7
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
1 change: 1 addition & 0 deletions gripper/core/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ function(target_gripper_core TARGET)
if(${USE_SENSOR_MOVE})
target_compile_definitions(${TARGET} PUBLIC USE_SENSOR_MOVE)
target_compile_definitions(${TARGET} PUBLIC P_BUFF_SIZE=2800)
target_compile_definitions(${TARGET} PUBLIC USE_TWO_BUFFERS=true)
endif()
target_sources(${TARGET} PUBLIC
${CMAKE_CURRENT_FUNCTION_LIST_DIR}/can_tasks.cpp
Expand Down
10 changes: 9 additions & 1 deletion gripper/core/tasks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,9 @@
static auto tasks = gripper_tasks::AllTask{};
static auto queues = gripper_tasks::QueueClient{can::ids::NodeId::gripper};
static std::array<float, SENSOR_BUFFER_SIZE> p_buff;
#ifdef USE_TWO_BUFFERS
static std::array<float, SENSOR_BUFFER_SIZE> p_buff_front;
#endif

static auto eeprom_task_builder =
freertos_task::TaskStarter<512, eeprom::task::EEPromTask>{};
Expand Down Expand Up @@ -97,7 +100,12 @@ auto gripper_tasks::start_tasks(
auto& capacitive_sensor_task_front =
capacitive_sensor_task_builder_front.start(
5, "cap sensor S1", i2c2_task_client, i2c2_poll_client,
sensor_hardware, queues, p_buff);
sensor_hardware, queues,
#ifdef USE_TWO_BUFFERS
p_buff_front);
#else
p_buff);
#endif
auto& capacitive_sensor_task_rear =
capacitive_sensor_task_builder_rear.start(
5, "cap sensor S0", i2c3_task_client, i2c3_poll_client,
Expand Down
7 changes: 6 additions & 1 deletion pipettes/core/sensor_tasks.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,12 @@ void sensor_tasks::start_tasks(
auto& capacitive_sensor_task_front =
capacitive_sensor_task_builder_front.start(
5, "capacitive sensor s1", i2c2_task_client, i2c2_poller_client,
sensor_hardware_primary, queues, p_buff);
sensor_hardware_secondary, queues,
#ifdef USE_TWO_BUFFERS
p_buff_front);
#else
p_buff);
#endif
tasks.capacitive_sensor_task_front = &capacitive_sensor_task_front;
queues.capacitive_sensor_queue_front =
&capacitive_sensor_task_front.get_queue();
Expand Down

0 comments on commit 6ac10b7

Please sign in to comment.