On GDx devices deferred the loading of calibration data from 'platform_init' to the first call of 'platform_getCalibrationData' to avoid having the screen blank for a while when booting

replace/debe509049be90e2f9eaaa179e4249b99bd25f55
Silvano Seva 2021-03-14 17:08:12 +01:00
rodzic 952f5afc3c
commit 5b44cb9a9f
2 zmienionych plików z 20 dodań i 4 usunięć

Wyświetl plik

@ -79,10 +79,12 @@ void platform_init()
i2c0_init();
/*
* Initialise non volatile memory manager and load calibration data.
* Initialise non volatile memory manager and zero calibration data.
* Actual loading of calibration data is deferred to the first call of
* platform_getCalibrationData().
*/
nvm_init();
nvm_readCalibData(&calibration);
memset(&calibration, 0x00, sizeof(gdxCalibration_t));
/* Initialise hardware information structure */
hwInfo.uhf_maxFreq = FREQ_LIMIT_UHF_HI/1000000;
@ -202,6 +204,12 @@ void platform_setBacklightLevel(uint8_t level)
const void *platform_getCalibrationData()
{
/* The first time this function is called, load calibration data from flash */
if(calibration.vhfCalPoints[0] == 0)
{
nvm_readCalibData(&calibration);
}
return ((const void *) &calibration);
}

Wyświetl plik

@ -78,10 +78,12 @@ void platform_init()
i2c0_init();
/*
* Initialise non volatile memory manager and load calibration data.
* Initialise non volatile memory manager and zero calibration data.
* Actual loading of calibration data is deferred to the first call of
* platform_getCalibrationData().
*/
nvm_init();
nvm_readCalibData(&calibration);
memset(&calibration, 0x00, sizeof(gdxCalibration_t));
/* Initialise hardware information structure */
hwInfo.uhf_maxFreq = FREQ_LIMIT_UHF_HI/1000000;
@ -201,6 +203,12 @@ void platform_setBacklightLevel(uint8_t level)
const void *platform_getCalibrationData()
{
/* The first time this function is called, load calibration data from flash */
if(calibration.vhfCalPoints[0] == 0)
{
nvm_readCalibData(&calibration);
}
return ((const void *) &calibration);
}