Skip to content

Commit 68dc77d

Browse files
authored
Enhance foc_loop with interrupt control
Added interrupt control to foc_loop function for better timing.
1 parent 5a1c27c commit 68dc77d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

docs/simplefoc_library/practical/real_time_loop.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -102,9 +102,11 @@ Esp32 microcontrollers have a similar approach to the STM32 family, but the impl
102102
hw_timer_t *timer = NULL;
103103

104104
void IRAM_ATTR foc_loop() {
105+
noInterrupts(); // disable interrupts here
105106
// call the loopFOC and move functions
106107
motor.loopFOC();
107108
motor.move();
109+
interrupts(); // enable interrupts after
108110
}
109111

110112
void setup() {

0 commit comments

Comments
 (0)