From: Jean THOMAS Date: Thu, 6 Aug 2020 14:57:47 +0000 (+0200) Subject: examples: Continue self-test even if calibration is unsuccessful X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5b248f92500bcec91b1f84d55fb58ec0b75be047;p=gram.git examples: Continue self-test even if calibration is unsuccessful --- diff --git a/examples/firmware/main.c b/examples/firmware/main.c index a726293..f336bab 100644 --- a/examples/firmware/main.c +++ b/examples/firmware/main.c @@ -78,23 +78,24 @@ int main(void) { .rdly_p0 = 2, .rdly_p1 = 2, }; + struct gramProfile profile2; gram_init(&ctx, &profile, (void*)0x10000000, (void*)0x00009000, (void*)0x00008000); uart_writestr("done\n"); uart_writestr("Auto calibrating... "); - res = gram_generate_calibration(&ctx, &profile); + res = gram_generate_calibration(&ctx, &profile2); if (res != GRAM_ERR_NONE) { uart_writestr("failed\n"); - while (1); + } else { + gram_load_calibration(&ctx, &profile2); } - gram_load_calibration(&ctx, &profile); uart_writestr("done\n"); uart_writestr("Auto calibration profile:"); uart_writestr("p0 rdly:"); - uart_writeuint32(profile.rdly_p0); + uart_writeuint32(profile2.rdly_p0); uart_writestr(" p1 rdly:"); - uart_writeuint32(profile.rdly_p1); + uart_writeuint32(profile2.rdly_p1); uart_writestr("\n"); uart_writestr("DRAM test... \n");