diff --git a/pipettes/firmware/main.cpp b/pipettes/firmware/main.cpp index 55741bba9..7baaeb2e4 100644 --- a/pipettes/firmware/main.cpp +++ b/pipettes/firmware/main.cpp @@ -130,9 +130,6 @@ static auto pins_for_sensor = static auto sensor_hardware_container = utility_configs::get_sensor_hardware_container(pins_for_sensor); -static auto ok_for_secondary = - pins_for_sensor.secondary.has_value() && - pins_for_sensor.secondary.value().tip_sense.has_value(); static auto tip_sense_gpio_primary = pins_for_sensor.primary.tip_sense.value(); static auto& sensor_queue_client = sensor_tasks::get_queues(); @@ -147,14 +144,6 @@ extern "C" void HAL_GPIO_EXTI_Callback(uint16_t GPIO_Pin) { sensor_queue_client.tip_notification_queue_rear->try_write_isr( sensors::tip_presence::TipStatusChangeDetected{})); } - } else if (ok_for_secondary && - GPIO_Pin == - pins_for_sensor.secondary.value().tip_sense.value().pin) { - if (sensor_queue_client.tip_notification_queue_front != nullptr) { - static_cast( - sensor_queue_client.tip_notification_queue_front->try_write_isr( - sensors::tip_presence::TipStatusChangeDetected{})); - } } } diff --git a/pipettes/firmware/utility_configurations.cpp b/pipettes/firmware/utility_configurations.cpp index 1cbb11d67..8edb42cda 100644 --- a/pipettes/firmware/utility_configurations.cpp +++ b/pipettes/firmware/utility_configurations.cpp @@ -122,7 +122,7 @@ auto utility_configs::sensor_configurations() // NOLINTNEXTLINE(cppcoreguidelines-pro-type-cstyle-cast) .port = GPIOC, .pin = GPIO_PIN_7, - .active_setting = GPIO_PIN_RESET}}, + .active_setting = GPIO_PIN_SET}}, .secondary = sensors::hardware::SensorHardwareConfiguration{ .sync_out = {// NOLINTNEXTLINE(cppcoreguidelines-pro-type-cstyle-cast) @@ -139,7 +139,7 @@ auto utility_configs::sensor_configurations() // NOLINTNEXTLINE(cppcoreguidelines-pro-type-cstyle-cast) .port = GPIOC, .pin = GPIO_PIN_12, - .active_setting = GPIO_PIN_RESET}}}; + .active_setting = GPIO_PIN_SET}}}; return pins; } @@ -166,7 +166,7 @@ auto utility_configs::sensor_configurations< // NOLINTNEXTLINE(cppcoreguidelines-pro-type-cstyle-cast) .port = GPIOC, .pin = GPIO_PIN_12, - .active_setting = GPIO_PIN_RESET}}, + .active_setting = GPIO_PIN_SET}}, .secondary = sensors::hardware::SensorHardwareConfiguration{ .sync_out = {// NOLINTNEXTLINE(cppcoreguidelines-pro-type-cstyle-cast) @@ -183,6 +183,6 @@ auto utility_configs::sensor_configurations< // NOLINTNEXTLINE(cppcoreguidelines-pro-type-cstyle-cast) .port = GPIOC, .pin = GPIO_PIN_7, - .active_setting = GPIO_PIN_RESET}}}; + .active_setting = GPIO_PIN_SET}}}; return pins; } diff --git a/pipettes/firmware/utility_gpio.c b/pipettes/firmware/utility_gpio.c index 2d10c5ec5..e5c76a8d6 100644 --- a/pipettes/firmware/utility_gpio.c +++ b/pipettes/firmware/utility_gpio.c @@ -26,7 +26,6 @@ static void tip_sense_gpio_init() { PipetteType pipette_type = get_pipette_type(); GPIO_InitTypeDef GPIO_InitStruct = {0}; - GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING; GPIO_InitStruct.Pull = GPIO_NOPULL; enable_gpio_port(GPIOC); if (pipette_type == NINETY_SIX_CHANNEL) { @@ -34,10 +33,12 @@ static void tip_sense_gpio_init() { * PC12, front tip sense * PC7, rear tip sense * */ + GPIO_InitStruct.Mode = GPIO_MODE_INPUT; GPIO_InitStruct.Pin = GPIO_PIN_12 | GPIO_PIN_7; HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); } else { /*Configure GPIO pin : C2 */ + GPIO_InitStruct.Mode = GPIO_MODE_IT_RISING_FALLING; GPIO_InitStruct.Pin = GPIO_PIN_2; HAL_GPIO_Init(GPIOC, &GPIO_InitStruct); } @@ -53,24 +54,12 @@ static void tip_sense_gpio_init() { static void nvic_priority_enable_init() { PipetteType pipette_type = get_pipette_type(); - if (pipette_type == NINETY_SIX_CHANNEL) { - IRQn_Type block_9_5 = get_interrupt_line(gpio_block_9_5); - IRQn_Type block_15_10 = get_interrupt_line(gpio_block_15_10); - /* EXTI interrupt init tip sense rear*/ - HAL_NVIC_SetPriority(block_9_5, 10, 0); - HAL_NVIC_EnableIRQ(block_9_5); - - /* EXTI interrupt init tip sense front*/ - HAL_NVIC_SetPriority(block_15_10, 10, 0); - HAL_NVIC_EnableIRQ(block_15_10); - } else { + if (pipette_type != NINETY_SIX_CHANNEL) { IRQn_Type block_2 = get_interrupt_line(gpio_block_2); /* EXTI interrupt init block tip sense*/ HAL_NVIC_SetPriority(block_2, 10, 0); HAL_NVIC_EnableIRQ(block_2); - } - } /**