From 2e61b3e31053f1d78e2f43899fd81f084983b17d Mon Sep 17 00:00:00 2001 From: raiden00pl Date: Fri, 29 Oct 2021 11:59:10 +0200 Subject: [PATCH] industry/foc/*/foc_velocity.c: run method should return int --- include/industry/foc/fixed16/foc_velocity.h | 12 ++++++------ include/industry/foc/float/foc_velocity.h | 12 ++++++------ industry/foc/fixed16/foc_velocity.c | 4 ++-- industry/foc/float/foc_velocity.c | 4 ++-- 4 files changed, 16 insertions(+), 16 deletions(-) diff --git a/include/industry/foc/fixed16/foc_velocity.h b/include/industry/foc/fixed16/foc_velocity.h index 311cc23aa..cde861d43 100644 --- a/include/industry/foc/fixed16/foc_velocity.h +++ b/include/industry/foc/fixed16/foc_velocity.h @@ -74,9 +74,9 @@ struct foc_velocity_ops_b16_s /* Run */ - CODE void (*run)(FAR foc_velocity_b16_t *h, - FAR struct foc_velocity_in_b16_s *in, - FAR struct foc_velocity_out_b16_s *out); + CODE int (*run)(FAR foc_velocity_b16_t *h, + FAR struct foc_velocity_in_b16_s *in, + FAR struct foc_velocity_out_b16_s *out); }; /* Velocity handler - sensor or sensorless */ @@ -114,8 +114,8 @@ int foc_velocity_cfg_b16(FAR foc_velocity_b16_t *h, FAR void *cfg); * Name: foc_velocity_run_b16 ****************************************************************************/ -void foc_velocity_run_b16(FAR foc_velocity_b16_t *h, - FAR struct foc_velocity_in_b16_s *in, - FAR struct foc_velocity_out_b16_s *out); +int foc_velocity_run_b16(FAR foc_velocity_b16_t *h, + FAR struct foc_velocity_in_b16_s *in, + FAR struct foc_velocity_out_b16_s *out); #endif /* __INDUSTRY_FOC_FIXED16_FOC_VELOCITY_H */ diff --git a/include/industry/foc/float/foc_velocity.h b/include/industry/foc/float/foc_velocity.h index 2ccaaacb1..67e20b958 100644 --- a/include/industry/foc/float/foc_velocity.h +++ b/include/industry/foc/float/foc_velocity.h @@ -74,9 +74,9 @@ struct foc_velocity_ops_f32_s /* Run velocity handler */ - CODE void (*run)(FAR foc_velocity_f32_t *h, - FAR struct foc_velocity_in_f32_s *in, - FAR struct foc_velocity_out_f32_s *out); + CODE int (*run)(FAR foc_velocity_f32_t *h, + FAR struct foc_velocity_in_f32_s *in, + FAR struct foc_velocity_out_f32_s *out); }; /* Velocity handler - sensor or sensorless */ @@ -114,8 +114,8 @@ int foc_velocity_cfg_f32(FAR foc_velocity_f32_t *h, FAR void *cfg); * Name: foc_velocity_run_f32 ****************************************************************************/ -void foc_velocity_run_f32(FAR foc_velocity_f32_t *h, - FAR struct foc_velocity_in_f32_s *in, - FAR struct foc_velocity_out_f32_s *out); +int foc_velocity_run_f32(FAR foc_velocity_f32_t *h, + FAR struct foc_velocity_in_f32_s *in, + FAR struct foc_velocity_out_f32_s *out); #endif /* __INDUSTRY_FOC_FLOAT_FOC_VELOCITY_H */ diff --git a/industry/foc/fixed16/foc_velocity.c b/industry/foc/fixed16/foc_velocity.c index 005f9249d..a567a3e49 100644 --- a/industry/foc/fixed16/foc_velocity.c +++ b/industry/foc/fixed16/foc_velocity.c @@ -143,7 +143,7 @@ int foc_velocity_cfg_b16(FAR foc_velocity_b16_t *h, FAR void *cfg) * ****************************************************************************/ -void foc_velocity_run_b16(FAR foc_velocity_b16_t *h, +int foc_velocity_run_b16(FAR foc_velocity_b16_t *h, FAR struct foc_velocity_in_b16_s *in, FAR struct foc_velocity_out_b16_s *out) { @@ -153,5 +153,5 @@ void foc_velocity_run_b16(FAR foc_velocity_b16_t *h, /* Run velocity handler */ - h->ops->run(h, in, out); + return h->ops->run(h, in, out); } diff --git a/industry/foc/float/foc_velocity.c b/industry/foc/float/foc_velocity.c index 2765682c8..615d925e6 100644 --- a/industry/foc/float/foc_velocity.c +++ b/industry/foc/float/foc_velocity.c @@ -143,7 +143,7 @@ int foc_velocity_cfg_f32(FAR foc_velocity_f32_t *h, FAR void *cfg) * ****************************************************************************/ -void foc_velocity_run_f32(FAR foc_velocity_f32_t *h, +int foc_velocity_run_f32(FAR foc_velocity_f32_t *h, FAR struct foc_velocity_in_f32_s *in, FAR struct foc_velocity_out_f32_s *out) { @@ -153,5 +153,5 @@ void foc_velocity_run_f32(FAR foc_velocity_f32_t *h, /* Run velocity handler */ - h->ops->run(h, in, out); + return h->ops->run(h, in, out); }