abderrahimjamaoui@gmail.com,
In general, if you only change the motor (i.e. Linix motor with another type of PMSM surface mount motor), you do not have to change the algorithm but you need to update the parameters of the motor and/or sensors.
Also, you need to retune the PI controllers for the new motor.
These are considered to be parameters for the FOC hence we can say that C-code does not change but the Data needs to be updated to have the motor running correctly.
Best regards,
Daniel