TFT_eSPI(Bodmer) calibration data size

Hi All,
to store the TFT calibration data the code declares an array:

uint16_t calData[5];

by reading stored data the code is reading 14 bytes into it:

      File f = SPIFFS.open(CALIBRATION_FILE, "r");
      if (f) {
        if (f.readBytes((char *)calData, 14) == 14)
          calDataOK = 1;
        f.close();
      }

and by saving the code is storing 14 bytes:

    File f = SPIFFS.open(CALIBRATION_FILE, "w");
    if (f) {
      f.write((const unsigned char *)calData, 14);
      f.close();
    }

How the hell can you manage calData like that? It's five unsigned shorts, which means ten bytes and nothing more. But it works... I don't know why... Be so kind as to explain it to me.

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.