take start pos into account for set_volume

This commit is contained in:
leo 2023-09-23 17:52:56 +02:00
parent c3516f5285
commit 1f9f56c2fd
Signed by: leo
GPG Key ID: 0DD993BFB2B307DB

View File

@ -40,7 +40,7 @@ static void back_button_handler(lv_event_t * e){
if(c_pse_unit->pL_per_step == 0) return; // TODO: alert popup if(c_pse_unit->pL_per_step == 0) return; // TODO: alert popup
if(c_pse_unit->flow == 0) return; if(c_pse_unit->flow == 0) return;
c_pse_unit->stepper_status->stop_at_limit = 1; c_pse_unit->stepper_status->stop_at_limit = 1;
c_pse_unit->stepper_status->stop_steps = (uint64_t)1000000 * c_pse_unit->set_volume / c_pse_unit->pL_per_step; c_pse_unit->stepper_status->stop_steps = c_pse_unit->start_pos + (uint64_t)1000000 * c_pse_unit->set_volume / c_pse_unit->pL_per_step;
} }
else else
c_pse_unit->stepper_status->stop_at_limit = 0; c_pse_unit->stepper_status->stop_at_limit = 0;