ERIS CORE

◆ requestSubSurfaceBufferP()

uint16_t* Surface::requestSubSurfaceBufferP ( uint32_t  size)
inline

Definition at line 143 of file ILI9341_t3_ERIS.h.

143  {
144  /* provides an interface to enable childern subsurfaces
145  to request a portion of the parents surface buffer
146 
147  function input is size of the surface array of N elements
148  each element of the array being two bytes (uint16_t).
149  so the allocation head will be moved size * 2
150  */
151  uint16_t* pSSB;
152  if ((head + size) > alloc_size){
153  //not enough space
154  Serial.println(F("M ERROR: Surface out of MEM"));
155  return NULL;
156  }
157  if (!pSB){
158  Serial.println(F("M ERROR: Surface has no buffer"));
159  return NULL;
160  }
161  pSSB = pSB + (head);
162  head += size;
163  Serial.println(F("M SubSurface allocated"));
164  Serial.print(F("M Surface buffer remaining:"));
165  Serial.println(alloc_size - head);
166  return pSSB;
167  }
uint32_t head
uint32_t alloc_size
uint16_t * pSB

References alloc_size, head, and pSB.

Referenced by Surface().

+ Here is the caller graph for this function: