anchao commented on code in PR #17530: URL: https://github.com/apache/nuttx/pull/17530#discussion_r2626180039
########## drivers/motor/foc/foc_dummy.c: ########## @@ -238,9 +241,9 @@ static int foc_dummy_start(FAR struct foc_dev_s *dev, bool state) /* Store FOC worker state */ - flags = enter_critical_section(); + flags = spin_lock_irqsave(&g_foc_lock); sim->state = state; - leave_critical_section(flags); + spin_unlock_irqrestore(&g_foc_lock, flags); Review Comment: could we replace state protect from spin lock to atomic? -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
