Skip to content

Simon devel#4

Open
zrzz-hq wants to merge 20 commits into
mainfrom
simon-devel
Open

Simon devel#4
zrzz-hq wants to merge 20 commits into
mainfrom
simon-devel

Conversation

@zrzz-hq
Copy link
Copy Markdown
Contributor

@zrzz-hq zrzz-hq commented May 26, 2026

No description provided.

Comment thread Core/Src/reg.c Outdated
Comment thread Core/Inc/app_config.h Outdated
Comment thread Core/Inc/app_config.h Outdated
Comment thread Core/Inc/app_config.h Outdated
Comment thread Core/Src/user.c Outdated
@zrzz-hq zrzz-hq assigned zrzz-hq and Simonwangxxx and unassigned zrzz-hq May 27, 2026
Move motor default register initialization from reg.c to motor_control.c
Move PWM conversion helpers from app_config.h to motor_control.c
Move Hall capture-to-RPM conversion from app_config.h to hall_sensor.c
Remove control_update_flag and call user_loop directly from the control timer callback
Comment thread Core/Src/hall_sensor.c
@@ -2,6 +2,44 @@
#include "lp_filter.h"
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can remove this header file

Comment thread Core/Src/user.c

motor_control_init();

HAL_TIM_PWM_Start(&MOTOR_PWM_TIMER_HANDLE, MOTOR_PWM_CHANNEL);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we can move this into the motor_control_init function

Comment thread Core/Src/user.c
motor_control_set_pwm_us(PWM_US_NEUTRAL);

HAL_TIMEx_HallSensor_Start_IT(&HALL_TIMER_HANDLE);
HAL_TIM_Base_Start_IT(&HALL_TIMER_HANDLE);
Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think we create a hall_sensor_init function and move these two function calls to it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants