/* Set integral constant, Ki, for the PID controller. */
int32_t cn0415_pid_set_ki(struct cn0415_dev *dev, uint8_t *args)
/* Set integral constant, Ki, for the PID controller. */
int32_t cn0415_pid_set_ki(struct cn0415_dev *dev, uint8_t *args)
{
	float kp, ki, kd;
	ki = atof((char *)args);
	kp = dev->controller->kp;
	kd = dev->controller->kd / dev->controller->f_loop;
	pid_set_constants(dev->controller, kp, ki, kd);
	dev->param_array[PID_KI_INT] = dev->controller->ki;
	dev->param_array[PID_KI_DEC] =
		(uint32_t)(dev->controller->ki * 10000) % 10000;
	return flash_write(dev->param_array, FLASH_PARAM_SIZE);
}