diff --git a/industry/foc/fixed16/foc_align.c b/industry/foc/fixed16/foc_align.c index 063ab75ec..e60be98ef 100644 --- a/industry/foc/fixed16/foc_align.c +++ b/industry/foc/fixed16/foc_align.c @@ -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; } diff --git a/industry/foc/float/foc_align.c b/industry/foc/float/foc_align.c index d398e6352..16c212934 100644 --- a/industry/foc/float/foc_align.c +++ b/industry/foc/float/foc_align.c @@ -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; }