xiaoxiang781216 commented on code in PR #11176: URL: https://github.com/apache/nuttx/pull/11176#discussion_r1391404410
########## boards/arm/stm32f7/steval-eth001v1/src/stm32_foc.c: ########## @@ -256,10 +259,8 @@ static struct stm32_foc_board_ops_s g_stm32_foc_board_ops = static struct stm32_foc_board_data_s g_stm32_foc_board_data = { - .adc_cfg = &g_adc_cfg, - .duty_max = (MAX_DUTY_B16), - .pwm_dt = (PWM_DEADTIME), - .pwm_dt_ns = (PWM_DEADTIME_NS) + .adc_cfg = &g_adc_cfg, + .pwm_dt = (PWM_DEADTIME), Review Comment: remove () ########## include/nuttx/motor/foc/foc.h: ########## @@ -110,7 +110,7 @@ struct foc_hw_config_s struct foc_info_s { - struct foc_hw_config_s hw_cfg; /* Hardware specific configuration */ + struct foc_info_hw_s hw_cfg; /* Hardware specific informations */ Review Comment: remove extra spaces ########## boards/arm/stm32/common/src/stm32_ihm08m1.c: ########## @@ -150,10 +153,8 @@ static struct stm32_foc_board_ops_s g_stm32_foc_board_ops = static struct stm32_foc_board_data_s g_stm32_foc_board_data = { - .adc_cfg = NULL, /* board-specific */ - .duty_max = (MAX_DUTY_B16), - .pwm_dt = (PWM_DEADTIME), - .pwm_dt_ns = (PWM_DEADTIME_NS) + .adc_cfg = NULL, /* board-specific */ + .pwm_dt = (PWM_DEADTIME) Review Comment: ditto ########## boards/arm/stm32/common/src/stm32_ihm16m1.c: ########## @@ -140,10 +143,8 @@ static struct stm32_foc_board_ops_s g_stm32_foc_board_ops = static struct stm32_foc_board_data_s g_stm32_foc_board_data = { - .adc_cfg = NULL, /* board-specific */ - .duty_max = (MAX_DUTY_B16), - .pwm_dt = (PWM_DEADTIME), - .pwm_dt_ns = (PWM_DEADTIME_NS) + .adc_cfg = NULL, /* board-specific */ + .pwm_dt = (PWM_DEADTIME) Review Comment: remove () ########## boards/arm/stm32/common/src/stm32_ihm07m1.c: ########## @@ -142,10 +145,8 @@ static struct stm32_foc_board_ops_s g_stm32_foc_board_ops = static struct stm32_foc_board_data_s g_stm32_foc_board_data = { - .adc_cfg = NULL, /* board-specific */ - .duty_max = (MAX_DUTY_B16), - .pwm_dt = (PWM_DEADTIME), - .pwm_dt_ns = (PWM_DEADTIME_NS) + .adc_cfg = NULL, /* board-specific */ + .pwm_dt = (PWM_DEADTIME) Review Comment: ditto ########## boards/arm/stm32/b-g431b-esc1/src/stm32_foc.c: ########## @@ -599,6 +599,17 @@ static int board_foc_info_get(struct foc_dev_s *dev, struct foc_info_s *info) info->hw_cfg.pwm_dt_ns = PWM_DEADTIME_NS; info->hw_cfg.pwm_max = MAX_DUTY_B16; + /* ADC BEMF */ + +#ifdef CONFIG_MOTOR_FOC_BEMF_SENSE + info->hw_cfg.bemf_scale = 0; /* TODO */ +#endif + + /* ADC Current - dynamic current scale not supported */ + + info->hw_cfg.iphase_max = 40000; + info->hw_cfg.iphase_scale = -2939; Review Comment: remove extra space ########## boards/arm/stm32/b-g431b-esc1/src/stm32_foc.c: ########## @@ -599,6 +599,17 @@ static int board_foc_info_get(struct foc_dev_s *dev, struct foc_info_s *info) info->hw_cfg.pwm_dt_ns = PWM_DEADTIME_NS; info->hw_cfg.pwm_max = MAX_DUTY_B16; + /* ADC BEMF */ + +#ifdef CONFIG_MOTOR_FOC_BEMF_SENSE + info->hw_cfg.bemf_scale = 0; /* TODO */ Review Comment: remove extra spaces ########## boards/arm/stm32/b-g431b-esc1/src/stm32_foc.c: ########## @@ -383,13 +386,11 @@ static struct stm32_foc_board_ops_s g_stm32_foc_board_ops = static struct stm32_foc_board_data_s g_stm32_foc_board_data = { - .adc_cfg = &g_adc_cfg, + .adc_cfg = &g_adc_cfg, #ifdef CONFIG_MOTOR_FOC_BEMF_SENSE - .vadc_cfg = &g_vadc_cfg, + .vadc_cfg = &g_vadc_cfg, #endif - .duty_max = (MAX_DUTY_B16), - .pwm_dt = (PWM_DEADTIME), - .pwm_dt_ns = (PWM_DEADTIME_NS) + .pwm_dt = (PWM_DEADTIME), Review Comment: ditto ########## boards/arm/stm32/common/src/stm32_ihm07m1.c: ########## @@ -307,6 +307,17 @@ static int board_foc_info_get(struct foc_dev_s *dev, info->hw_cfg.pwm_dt_ns = PWM_DEADTIME_NS; info->hw_cfg.pwm_max = MAX_DUTY_B16; + /* ADC BEMF */ + +#ifdef CONFIG_MOTOR_FOC_BEMF_SENSE + info->hw_cfg.bemf_scale = 0; /* TODO */ Review Comment: apply the change to the remain code ########## drivers/motor/foc/foc_dummy.c: ########## @@ -108,6 +108,7 @@ 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_pwm_off(struct foc_dev_s *dev, bool off); Review Comment: add FAR to foc_pwm_off/foc_info_get here and implementation -- 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-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org