Waitmissing for missing memory

This commit is contained in:
jomjol
2020-12-23 11:09:27 +01:00
parent 9971c82e99
commit 7e4f83c2f5
14 changed files with 39 additions and 96 deletions

View File

@@ -283,7 +283,7 @@ void CImageBasis::LoadFromMemory(stbi_uc *_buffer, int len)
}
CImageBasis::CImageBasis(CImageBasis *_copyfrom)
CImageBasis::CImageBasis(CImageBasis *_copyfrom, int _anzrepeat)
{
externalImage = false;
channels = _copyfrom->channels;
@@ -293,6 +293,18 @@ CImageBasis::CImageBasis(CImageBasis *_copyfrom)
int memsize = width * height * channels;
rgb_image = (unsigned char*)GET_MEMORY(memsize);
int anz = 1;
TickType_t xDelay;
while (!rgb_image && (anz < _anzrepeat))
{
printf("Create Image from Copy - Speicher ist voll - Versuche es erneut: %d.\n", anz);
xDelay = 1000 / portTICK_PERIOD_MS;
rgb_image = (unsigned char*) malloc(memsize);
anz++;
}
if (!rgb_image)
{
printf(getESPHeapInfo().c_str());