Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DShot timing improvements #149

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Mcu/l431/Src/IO.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ void sendDshotDma()
IC_TIMER_REGISTER->CCMR1 = 0x60;
IC_TIMER_REGISTER->CCER = 0x3;
IC_TIMER_REGISTER->PSC = output_timer_prescaler;
IC_TIMER_REGISTER->ARR = 115;
IC_TIMER_REGISTER->ARR = 110;

IC_TIMER_REGISTER->EGR |= TIM_EGR_UG;
#ifdef USE_TIMER_3_CHANNEL_1
Expand Down
10 changes: 4 additions & 6 deletions Mcu/l431/Src/peripherals.c
Original file line number Diff line number Diff line change
Expand Up @@ -71,17 +71,15 @@ void SystemClock_Config(void)
#endif

#else
LL_RCC_MSI_Enable();
LL_RCC_HSI_Enable();

/* Wait till MSI is ready */
while(LL_RCC_MSI_IsReady() != 1)
while(LL_RCC_HSI_IsReady() != 1)
{

}
LL_RCC_MSI_EnableRangeSelection();
LL_RCC_MSI_SetRange(LL_RCC_MSIRANGE_6);
LL_RCC_MSI_SetCalibTrimming(0);
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_MSI, LL_RCC_PLLM_DIV_1, 40, LL_RCC_PLLR_DIV_2);
LL_RCC_HSI_SetCalibTrimming(16);
LL_RCC_PLL_ConfigDomain_SYS(LL_RCC_PLLSOURCE_HSI, LL_RCC_PLLM_DIV_1, 10, LL_RCC_PLLR_DIV_2);
#endif

LL_RCC_PLL_EnableDomain_SYS();
Expand Down
Loading