[KSZ8081RND] hotfix: reset timer before using values from it

This commit is contained in:
ІО-23 Шмуляр Олег 2025-05-10 13:48:33 +03:00
parent b1e57d125b
commit a3925be518
1 changed files with 2 additions and 0 deletions

View File

@ -98,6 +98,7 @@ int ReadRegister(uint32_t reg, uint16_t *value)
ETH->MACMIIAR = tmpreg1; ETH->MACMIIAR = tmpreg1;
TIM2->CNT = 0;
HAL_TIM_Base_Start(&htim2); HAL_TIM_Base_Start(&htim2);
while (ETH->MACMIIAR & 1) { while (ETH->MACMIIAR & 1) {
@ -122,6 +123,7 @@ int WriteRegister(uint32_t reg, uint16_t value)
ETH->MACMIIDR = value; ETH->MACMIIDR = value;
ETH->MACMIIAR = tmpreg1; ETH->MACMIIAR = tmpreg1;
TIM2->CNT = 0;
HAL_TIM_Base_Start(&htim2); HAL_TIM_Base_Start(&htim2);
while (ETH->MACMIIAR & 1) { while (ETH->MACMIIAR & 1) {