mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-01 20:29:00 +00:00
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:
parent
35f3690a4c
commit
8aa48c4fb6
2 changed files with 4 additions and 0 deletions
|
|
@ -26,6 +26,8 @@
|
|||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <nuttx/spinlock.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <dspb16.h>
|
||||
#include <fcntl.h>
|
||||
|
|
|
|||
|
|
@ -26,6 +26,8 @@
|
|||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
#include <nuttx/spinlock.h>
|
||||
|
||||
#include <assert.h>
|
||||
#include <dsp.h>
|
||||
#include <fcntl.h>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue