Commit 38c0b236 authored by Clément Foucher's avatar Clément Foucher
Browse files

Compute slope on first task start instead of init so that driver is initialized.

parent 2ee8c7e9
......@@ -167,8 +167,6 @@ void opalib_pid_current_init(double setpoint, double p_i, double i_i, double d_i
p = p_i;
i = i_i;
d = d_i;
_opalib_pid_current_compute_slope();
}
void opalib_pid_current_update_setpoint(double setpoint)
......@@ -180,6 +178,13 @@ void opalib_pid_current_update_setpoint(double setpoint)
void opalib_pid_current_periodic_task()
{
static uint8_t first_run = 1;
if (first_run == 1)
{
_opalib_pid_current_compute_slope();
first_run = 0;
}
_opalib_pid_current_acquire_dac_values();
_opalib_pid_current_compute_reset_value();
_opalib_pid_current_update_reset_value();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment