Skip to content

Commit 4f82739

Browse files
mschrenkhammerreyhaney84
authored andcommitted
StorageArea function iniit.
If not called before by EApiStorageCapEmul(), Call find_eeprom() and eeprom_userSpace() also from EApiStorageAreaReadEmul() and EApiStorageAreaWriteEmul().
1 parent e4f5c7a commit 4f82739

1 file changed

Lines changed: 20 additions & 0 deletions

File tree

lib/EApiEmulStorage.c

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,16 @@ EApiStorageAreaReadEmul(
131131
"Unrecognised Storage ID"
132132
);
133133

134+
if (eeprom_bus < 0)
135+
{
136+
find_eeprom();
137+
}
138+
139+
if (eeprom_bus >= 0 && eeprom_userSpaceBuf == NULL)
140+
{
141+
eeprom_userSpaceBuf = eeprom_userSpace();
142+
}
143+
134144
/* find vendor specific block of Eeprom */
135145
if (eeprom_userSpaceBuf == NULL || userspaceBuffer_Cmd == -1)
136146
EAPI_LIB_RETURN_ERROR(
@@ -208,6 +218,16 @@ EApiStorageAreaWriteEmul(
208218
"Unrecognised Storage ID"
209219
);
210220

221+
if (eeprom_bus < 0)
222+
{
223+
find_eeprom();
224+
}
225+
226+
if (eeprom_bus >= 0 && eeprom_userSpaceBuf == NULL)
227+
{
228+
eeprom_userSpaceBuf = eeprom_userSpace();
229+
}
230+
211231
/* find vendor specific block of Eeprom */
212232
if (eeprom_userSpaceBuf == NULL || userspaceBuffer_Cmd == -1)
213233
EAPI_LIB_RETURN_ERROR(

0 commit comments

Comments
 (0)