Merge pull request #1829 from cesanta/cr

CR incorrectly set in STM32 driver
This commit is contained in:
Sergey Lyubka authored and GitHub committed 2022-11-02 23:18:20 +00:00
commit 10c09a361b
2 files changed
+2 -2

No files matched your search

+1 -1
View File
@@ -126,7 +126,7 @@ static bool mip_driver_stm32_init(uint8_t *mac, void *userdata) {
// Set MDC clock divider. If user told us the value, use it. Otherwise, guess // Set MDC clock divider. If user told us the value, use it. Otherwise, guess
int cr = (d == NULL || d->mdc_cr < 0) ? guess_mdc_cr() : d->mdc_cr; int cr = (d == NULL || d->mdc_cr < 0) ? guess_mdc_cr() : d->mdc_cr;
ETH->MACMIIAR = ((uint32_t)cr & 3) << 2; ETH->MACMIIAR = ((uint32_t)cr & 7) << 2;
// NOTE(cpq): we do not use extended descriptor bit 7, and do not use // NOTE(cpq): we do not use extended descriptor bit 7, and do not use
// hardware checksum. Therefore, descriptor size is 4, not 8 // hardware checksum. Therefore, descriptor size is 4, not 8
+1 -1
View File
@@ -6133,7 +6133,7 @@ static bool mip_driver_stm32_init(uint8_t *mac, void *userdata) {
// Set MDC clock divider. If user told us the value, use it. Otherwise, guess // Set MDC clock divider. If user told us the value, use it. Otherwise, guess
int cr = (d == NULL || d->mdc_cr < 0) ? guess_mdc_cr() : d->mdc_cr; int cr = (d == NULL || d->mdc_cr < 0) ? guess_mdc_cr() : d->mdc_cr;
ETH->MACMIIAR = ((uint32_t)cr & 3) << 2; ETH->MACMIIAR = ((uint32_t)cr & 7) << 2;
// NOTE(cpq): we do not use extended descriptor bit 7, and do not use // NOTE(cpq): we do not use extended descriptor bit 7, and do not use
// hardware checksum. Therefore, descriptor size is 4, not 8 // hardware checksum. Therefore, descriptor size is 4, not 8