You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/01/07 11:46:16 UTC

[GitHub] [incubator-nuttx] raiden00pl commented on a change in pull request #5182: Move simulated drivers from sim to common place

raiden00pl commented on a change in pull request #5182:
URL: https://github.com/apache/incubator-nuttx/pull/5182#discussion_r780214828



##########
File path: drivers/motor/foc/foc_dummy.c
##########
@@ -93,64 +94,64 @@ struct sim_foc_data_s
 
 /* Lower-half FOC operations */
 
-static int sim_foc_configure(FAR struct foc_dev_s *dev,
-                             FAR struct foc_cfg_s *cfg);
-static int sim_foc_setup(FAR struct foc_dev_s *dev);
-static int sim_foc_shutdown(FAR struct foc_dev_s *dev);
-static int sim_foc_start(FAR struct foc_dev_s *dev, bool state);
-static int sim_foc_pwm_duty_set(FAR struct foc_dev_s *dev,
-                                FAR foc_duty_t *duty);
-static int sim_foc_ioctl(FAR struct foc_dev_s *dev, int cmd,
-                         unsigned long arg);
-static int sim_foc_bind(FAR struct foc_dev_s *dev,
-                        FAR struct foc_callbacks_s *cb);
-static int sim_foc_fault_clear(FAR struct foc_dev_s *dev);
+static int foc_dummy_configure(FAR struct foc_dev_s *dev,
+                               FAR struct foc_cfg_s *cfg);
+static int foc_dummy_setup(FAR struct foc_dev_s *dev);
+static int foc_dummy_shutdown(FAR struct foc_dev_s *dev);
+static int foc_dummy_start(FAR struct foc_dev_s *dev, bool state);
+static int foc_dummy_pwm_duty_set(FAR struct foc_dev_s *dev,
+                                  FAR foc_duty_t *duty);
+static int foc_dummy_ioctl(FAR struct foc_dev_s *dev, int cmd,
+                           unsigned long arg);
+static int foc_dummy_bind(FAR struct foc_dev_s *dev,
+                          FAR struct foc_callbacks_s *cb);
+static int foc_dummy_fault_clear(FAR struct foc_dev_s *dev);
 #ifdef CONFIG_MOTOR_FOC_TRACE
-static void sim_foc_trace(FAR struct foc_dev_s *dev, int type, bool state);
+static void foc_dummy_trace(FAR struct foc_dev_s *dev, int type, bool state);
 #endif
 
 /* Handlers */
 
-static int sim_foc_notifier_handler(FAR struct foc_dev_s *dev);
+static void foc_dummy_notifier_handler(FAR struct foc_dev_s *dev);
 
 /* Helpers */
 
-static void sim_foc_hw_config_get(FAR struct foc_dev_s *dev);
-static int sim_foc_notifier_cfg(FAR struct foc_dev_s *dev, uint32_t freq);
-static int sim_foc_pwm_setup(FAR struct foc_dev_s *dev, uint32_t freq);
-static int sim_foc_pwm_start(FAR struct foc_dev_s *dev, bool state);
-static int sim_foc_adc_setup(FAR struct foc_dev_s *dev);
-static int sim_foc_adc_start(FAR struct foc_dev_s *dev, bool state);
+static void foc_dummy_hw_config_get(FAR struct foc_dev_s *dev);
+static int foc_dummy_notifier_cfg(FAR struct foc_dev_s *dev, uint32_t freq);
+static int foc_dummy_pwm_setup(FAR struct foc_dev_s *dev, uint32_t freq);
+static int foc_dummy_pwm_start(FAR struct foc_dev_s *dev, bool state);
+static int foc_dummy_adc_setup(FAR struct foc_dev_s *dev);
+static int foc_dummy_adc_start(FAR struct foc_dev_s *dev, bool state);
 
 /****************************************************************************
  * Private Data
  ****************************************************************************/
 
 /* SIM FOC specific data */
 
-static struct sim_foc_data_s  g_sim_foc_data[CONFIG_MOTOR_FOC_INST];
-static struct sim_foc_board_s g_sim_foc_board[CONFIG_MOTOR_FOC_INST];
+static struct foc_dummy_data_s  g_foc_dummy_data[CONFIG_MOTOR_FOC_INST];
+static struct foc_dummy_board_s g_foc_dummy_board[CONFIG_MOTOR_FOC_INST];
 
 /* SIM specific FOC ops */
 
-static struct foc_lower_ops_s g_sim_foc_ops =
+static struct foc_lower_ops_s g_foc_dummy_ops =
 {
-  .configure      = sim_foc_configure,
-  .setup          = sim_foc_setup,
-  .shutdown       = sim_foc_shutdown,
-  .start          = sim_foc_start,
-  .pwm_duty_set   = sim_foc_pwm_duty_set,
-  .ioctl          = sim_foc_ioctl,
-  .bind           = sim_foc_bind,
-  .fault_clear    = sim_foc_fault_clear,
+  foc_dummy_configure,
+  foc_dummy_setup,
+  foc_dummy_shutdown,
+  foc_dummy_start,
+  foc_dummy_pwm_duty_set,
+  foc_dummy_ioctl,

Review comment:
       ```suggestion
     foc_dummy_pwm_duty_set,
     foc_dummy_start,
     foc_dummy_ioctl,
   ```




-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org