software/liblitedram/sdram/sdram_write_leveling_find_cmd_delay: Only update best_count when error < best_error.

This commit is contained in:
Florent Kermarrec 2021-04-28 11:23:34 +02:00
parent c50989be8e
commit 19d16fa27f
1 changed files with 2 additions and 2 deletions

View File

@ -552,10 +552,10 @@ static void sdram_write_leveling_find_cmd_delay(unsigned int *best_error, unsign
error *= -1;
if (delay_count >= *best_count) {
*best_count = delay_count;
if (error < *best_error) {
*best_cdly = cdly;
*best_error = error;
*best_count = delay_count;
}
}
#ifdef SDRAM_WRITE_LEVELING_CMD_DELAY_DEBUG