[KSZ8081RND] hotfix: reset timer before using values from it
This commit is contained in:
parent
b1e57d125b
commit
a3925be518
|
@ -98,6 +98,7 @@ int ReadRegister(uint32_t reg, uint16_t *value)
|
|||
|
||||
ETH->MACMIIAR = tmpreg1;
|
||||
|
||||
TIM2->CNT = 0;
|
||||
HAL_TIM_Base_Start(&htim2);
|
||||
|
||||
while (ETH->MACMIIAR & 1) {
|
||||
|
@ -122,6 +123,7 @@ int WriteRegister(uint32_t reg, uint16_t value)
|
|||
ETH->MACMIIDR = value;
|
||||
ETH->MACMIIAR = tmpreg1;
|
||||
|
||||
TIM2->CNT = 0;
|
||||
HAL_TIM_Base_Start(&htim2);
|
||||
|
||||
while (ETH->MACMIIAR & 1) {
|
||||
|
|
Loading…
Reference in New Issue