industry/foc: reset align data when align is finished

this allows the align procedure to be run multiple times
This commit is contained in:
raiden00pl 2023-10-16 14:15:44 +02:00 committed by Alan Carvalho de Assis
parent 8ee684e586
commit 5a65f3d48f
2 changed files with 14 additions and 0 deletions

View File

@ -1005,5 +1005,12 @@ int foc_routine_align_final_b16(FAR foc_routine_b16_t *r, FAR void *data)
memcpy(data, &a->final, sizeof(struct foc_routine_aling_final_b16_s));
/* Reset data but leave configuration */
memset(&a->final,
0,
(sizeof(struct foc_align_b16_s) -
sizeof(struct foc_routine_align_cfg_b16_s)));
return OK;
}

View File

@ -1005,5 +1005,12 @@ int foc_routine_align_final_f32(FAR foc_routine_f32_t *r, FAR void *data)
memcpy(data, &a->final, sizeof(struct foc_routine_aling_final_f32_s));
/* Reset data but leave configuration */
memset(&a->final,
0,
(sizeof(struct foc_align_f32_s) -
sizeof(struct foc_routine_align_cfg_f32_s)));
return OK;
}