You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2024/10/18 02:43:56 UTC
(nuttx-apps) 05/07: examples/foc: print aling results only when verbose output enabled
This is an automated email from the ASF dual-hosted git repository.
xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git
commit 1aacc99491e91c61ddae358f10ee30c35a370f3c
Author: raiden00pl <ra...@railab.me>
AuthorDate: Sat Oct 12 17:36:35 2024 +0200
examples/foc: print aling results only when verbose output enabled
it is a costly operation that takes a lot of time and is not of much value
---
examples/foc/foc_motor_b16.c | 6 +++---
examples/foc/foc_motor_f32.c | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/examples/foc/foc_motor_b16.c b/examples/foc/foc_motor_b16.c
index 5cb25f610..543f44933 100644
--- a/examples/foc/foc_motor_b16.c
+++ b/examples/foc/foc_motor_b16.c
@@ -121,11 +121,11 @@ static int foc_motor_align(FAR struct foc_motor_b16_s *motor, FAR bool *done)
goto errout;
}
- PRINTF("Aling results:\n");
+ PRINTFV("Aling results:\n");
#ifdef CONFIG_INDUSTRY_FOC_ALIGN_DIR
- PRINTF(" dir = %.2f\n", b16tof(final.dir));
+ PRINTFV(" dir = %.2f\n", b16tof(final.dir));
#endif
- PRINTF(" offset = %.2f\n", b16tof(final.offset));
+ PRINTFV(" offset = %.2f\n", b16tof(final.offset));
*done = true;
}
diff --git a/examples/foc/foc_motor_f32.c b/examples/foc/foc_motor_f32.c
index 5ede5cb14..f39949536 100644
--- a/examples/foc/foc_motor_f32.c
+++ b/examples/foc/foc_motor_f32.c
@@ -121,11 +121,11 @@ static int foc_motor_align(FAR struct foc_motor_f32_s *motor, FAR bool *done)
goto errout;
}
- PRINTF("Aling results:\n");
+ PRINTFV("Aling results:\n");
#ifdef CONFIG_INDUSTRY_FOC_ALIGN_DIR
- PRINTF(" dir = %.2f\n", final.dir);
+ PRINTFV(" dir = %.2f\n", final.dir);
#endif
- PRINTF(" offset = %.2f\n", final.offset);
+ PRINTFV(" offset = %.2f\n", final.offset);
*done = true;
}