raiden00pl a7024aea89 examples/foc: protect control loop with critical section
If the controller frequency is high, system timer interrupts will
eventually interrupt the controller function, thereby increasing the
execution time. This may lead to skipping the control cycle, which
negatively affects the control algorithm.

With this option enabled, interrupts are disabled for the duration
of the controller function execution.

Here example results from CONFIG_EXAMPLES_FOC_PERF output
for b-g431b-esc1 board with CONFIG_EXAMPLES_FOC_NOTIFIER_FREQ=10000:

1. CONFIG_EXAMPLES_FOC_CONTROL_CRITSEC=n

  exec ticks=5258
    nsec=30929
  per ticks=21268
    nsec=125105

2. CONFIG_EXAMPLES_FOC_CONTROL_CRITSEC=y

  exec ticks=3428
    nsec=20164
  per ticks=19203
    nsec=112958

The difference is ~12us!
2024-10-18 10:43:46 +08:00
..
2024-05-11 01:20:08 +08:00
2024-04-30 00:02:31 +08:00
2024-02-26 17:38:51 -03:00
2024-09-12 01:11:30 +08:00
2024-10-04 08:17:51 +08:00
2024-09-28 10:51:34 +08:00
2024-09-15 02:27:41 +08:00
2023-08-17 22:51:51 +03:00
2024-05-11 01:20:08 +08:00
2024-08-26 10:22:16 +08:00
2024-08-23 09:04:31 +08:00
2024-08-20 02:49:34 +08:00
2023-07-08 13:52:02 +08:00
2024-09-26 16:13:29 +08:00
2024-10-05 09:06:43 +08:00
2024-04-18 09:56:48 +08:00
2024-10-04 08:17:51 +08:00
2024-09-15 02:27:41 +08:00
2024-04-18 09:56:48 +08:00
2024-04-18 09:56:48 +08:00
2024-04-18 09:56:48 +08:00
2024-09-26 16:13:29 +08:00
2023-11-06 09:02:42 +08:00
2023-10-06 17:24:44 +08:00
2024-09-15 02:27:41 +08:00
2024-09-26 16:13:29 +08:00
2024-04-18 09:56:48 +08:00
2024-09-26 16:13:29 +08:00
2024-09-28 15:47:40 +08:00
2024-04-18 09:56:48 +08:00
2023-07-08 13:52:02 +08:00
2024-04-30 00:02:31 +08:00
2024-09-26 16:13:29 +08:00
2023-07-08 13:52:02 +08:00