examples: foc: Add critical section protection to FOC control loop

Introduce CONFIG_EXAMPLES_FOC_CONTROL_CRITSEC configuration option to enable
critical section protection in the FOC (Field-Oriented Control) motor control
examples. This adds irq-safe critical sections around the main control loop
processing to prevent race conditions and ensure atomic updates of motor
control state and parameters during interrupt handling.

Signed-off-by: hujun5 <hujun5@xiaomi.com>
This commit is contained in:
hujun5 2026-01-27 14:14:26 +08:00 committed by Xiang Xiao
parent 35f3690a4c
commit 8aa48c4fb6
2 changed files with 4 additions and 0 deletions

View file

@ -26,6 +26,8 @@
#include <nuttx/config.h>
#include <nuttx/spinlock.h>
#include <assert.h>
#include <dspb16.h>
#include <fcntl.h>

View file

@ -26,6 +26,8 @@
#include <nuttx/config.h>
#include <nuttx/spinlock.h>
#include <assert.h>
#include <dsp.h>
#include <fcntl.h>