macro "swap" error

Hey folks, I just got a display and I’m having some troubles.

I’m using a Huzzah32 board, OLED SSD1351, the Adafruit SSD1351 library sample “bmp”, and my laptop runs Linux Mint.

bmp sample code

/*************************************************** 
  This is a example sketch demonstrating bitmap drawing
  capabilities of the SSD1351 library for the 1.5" 
  and 1.27" 16-bit Color OLEDs with SSD1351 driver chip

  Pick one up today in the adafruit shop!
  ------> http://www.adafruit.com/products/1431
  ------> http://www.adafruit.com/products/1673
 
  If you're using a 1.27" OLED, change SSD1351HEIGHT in Adafruit_SSD1351.h
 to 96 instead of 128

  These displays use SPI to communicate, 4 or 5 pins are required to  
  interface
  Adafruit invests time and resources providing this open source code, 
  please support Adafruit and open-source hardware by purchasing 
  products from Adafruit!

  Written by Limor Fried/Ladyada for Adafruit Industries.  
  BSD license, all text above must be included in any redistribution

  The Adafruit GFX Graphics core library is also required
  https://github.com/adafruit/Adafruit-GFX-Library
  Be sure to install it!
 ****************************************************/

#include <Adafruit_GFX.h>
#include <Adafruit_SSD1351.h>
#include <SD.h>
#include <SPI.h>


// If we are using the hardware SPI interface, these are the pins (for future ref)
#define sclk 13
#define mosi 11
#define cs   5
#define rst  6
#define dc   4

// Color definitions
#define BLACK           0x0000
#define BLUE            0x001F
#define RED             0xF800
#define GREEN           0x07E0
#define CYAN            0x07FF
#define MAGENTA         0xF81F
#define YELLOW          0xFFE0  
#define WHITE           0xFFFF

// to draw images from the SD card, we will share the hardware SPI interface
Adafruit_SSD1351 tft = Adafruit_SSD1351(cs, dc, rst);

// For Arduino Uno/Duemilanove, etc
//  connect the SD card with MOSI going to pin 11, MISO going to pin 12 and SCK going to pin 13 (standard)
//  Then pin 10 goes to CS (or whatever you have set up)
#define SD_CS 10    // Set the chip select line to whatever you use (10 doesnt conflict with the library)

// the file itself
File bmpFile;

// information we extract about the bitmap file
int bmpWidth, bmpHeight;
uint8_t bmpDepth, bmpImageoffset;


void setup(void) {
  Serial.begin(9600);
   
  pinMode(cs, OUTPUT);
  digitalWrite(cs, HIGH);
     
  // initialize the OLED
  tft.begin();

  Serial.println("init");
  
  tft.fillScreen(BLUE);
  
  delay(500);
  Serial.print("Initializing SD card...");

  if (!SD.begin(SD_CS)) {
    Serial.println("failed!");
    return;
  }
  Serial.println("SD OK!");

  bmpDraw("lily128.bmp", 0, 0);
}

void loop() {
}

// This function opens a Windows Bitmap (BMP) file and
// displays it at the given coordinates.  It's sped up
// by reading many pixels worth of data at a time
// (rather than pixel by pixel).  Increasing the buffer
// size takes more of the Arduino's precious RAM but
// makes loading a little faster.  20 pixels seems a
// good balance.

#define BUFFPIXEL 20

void bmpDraw(char *filename, uint8_t x, uint8_t y) {

  File     bmpFile;
  int      bmpWidth, bmpHeight;   // W+H in pixels
  uint8_t  bmpDepth;              // Bit depth (currently must be 24)
  uint32_t bmpImageoffset;        // Start of image data in file
  uint32_t rowSize;               // Not always = bmpWidth; may have padding
  uint8_t  sdbuffer[3*BUFFPIXEL]; // pixel buffer (R+G+B per pixel)
  uint8_t  buffidx = sizeof(sdbuffer); // Current position in sdbuffer
  boolean  goodBmp = false;       // Set to true on valid header parse
  boolean  flip    = true;        // BMP is stored bottom-to-top
  int      w, h, row, col;
  uint8_t  r, g, b;
  uint32_t pos = 0, startTime = millis();

  if((x >= tft.width()) || (y >= tft.height())) return;

  Serial.println();
  Serial.print("Loading image '");
  Serial.print(filename);
  Serial.println('\'');

  // Open requested file on SD card
  if ((bmpFile = SD.open(filename)) == NULL) {
    Serial.print("File not found");
    return;
  }

  // Parse BMP header
  if(read16(bmpFile) == 0x4D42) { // BMP signature
    Serial.print("File size: "); Serial.println(read32(bmpFile));
    (void)read32(bmpFile); // Read & ignore creator bytes
    bmpImageoffset = read32(bmpFile); // Start of image data
    Serial.print("Image Offset: "); Serial.println(bmpImageoffset, DEC);
    // Read DIB header
    Serial.print("Header size: "); Serial.println(read32(bmpFile));
    bmpWidth  = read32(bmpFile);
    bmpHeight = read32(bmpFile);
    if(read16(bmpFile) == 1) { // # planes -- must be '1'
      bmpDepth = read16(bmpFile); // bits per pixel
      Serial.print("Bit Depth: "); Serial.println(bmpDepth);
      if((bmpDepth == 24) && (read32(bmpFile) == 0)) { // 0 = uncompressed

        goodBmp = true; // Supported BMP format -- proceed!
        Serial.print("Image size: ");
        Serial.print(bmpWidth);
        Serial.print('x');
        Serial.println(bmpHeight);

        // BMP rows are padded (if needed) to 4-byte boundary
        rowSize = (bmpWidth * 3 + 3) & ~3;

        // If bmpHeight is negative, image is in top-down order.
        // This is not canon but has been observed in the wild.
        if(bmpHeight < 0) {
          bmpHeight = -bmpHeight;
          flip      = false;
        }

        // Crop area to be loaded
        w = bmpWidth;
        h = bmpHeight;
        if((x+w-1) >= tft.width())  w = tft.width()  - x;
        if((y+h-1) >= tft.height()) h = tft.height() - y;

        for (row=0; row<h; row++) { // For each scanline...
          tft.goTo(x, y+row);

          // Seek to start of scan line.  It might seem labor-
          // intensive to be doing this on every line, but this
          // method covers a lot of gritty details like cropping
          // and scanline padding.  Also, the seek only takes
          // place if the file position actually needs to change
          // (avoids a lot of cluster math in SD library).
          if(flip) // Bitmap is stored bottom-to-top order (normal BMP)
            pos = bmpImageoffset + (bmpHeight - 1 - row) * rowSize;
          else     // Bitmap is stored top-to-bottom
            pos = bmpImageoffset + row * rowSize;
          if(bmpFile.position() != pos) { // Need seek?
            bmpFile.seek(pos);
            buffidx = sizeof(sdbuffer); // Force buffer reload
          }

          // optimize by setting pins now
          for (col=0; col<w; col++) { // For each pixel...
            // Time to read more pixel data?
            if (buffidx >= sizeof(sdbuffer)) { // Indeed
              bmpFile.read(sdbuffer, sizeof(sdbuffer));
              buffidx = 0; // Set index to beginning
            }

            // Convert pixel from BMP to TFT format, push to display
            b = sdbuffer[buffidx++];
            g = sdbuffer[buffidx++];
            r = sdbuffer[buffidx++];

            tft.drawPixel(x+col, y+row, tft.Color565(r,g,b));
            // optimized!
            //tft.pushColor(tft.Color565(r,g,b));
          } // end pixel
        } // end scanline
        Serial.print("Loaded in ");
        Serial.print(millis() - startTime);
        Serial.println(" ms");
      } // end goodBmp
    }
  }

  bmpFile.close();
  if(!goodBmp) Serial.println("BMP format not recognized.");
}

// These read 16- and 32-bit types from the SD card file.
// BMP data is stored little-endian, Arduino is little-endian too.
// May need to reverse subscript order if porting elsewhere.

uint16_t read16(File f) {
  uint16_t result;
  ((uint8_t *)&result)[0] = f.read(); // LSB
  ((uint8_t *)&result)[1] = f.read(); // MSB
  return result;
}

uint32_t read32(File f) {
  uint32_t result;
  ((uint8_t *)&result)[0] = f.read(); // LSB
  ((uint8_t *)&result)[1] = f.read();
  ((uint8_t *)&result)[2] = f.read();
  ((uint8_t *)&result)[3] = f.read(); // MSB
  return result;
}

Evidently the debug is too long for one post. Please hold for follow-on post.

Debug

Arduino: 1.8.5 (Linux), Board: "Adafruit ESP32 Feather, 80MHz, 921600, None"

In file included from /Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/bits/stl_algobase.h:64:0,
                 from /Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/memory:62,
                 from /Arduino/hardware/espressif/esp32/libraries/FS/src/FS.h:24,
                 from /Arduino/hardware/espressif/esp32/libraries/SD/src/SD.h:17,
                 from /home/oem/Arduino/libraries/Adafruit_SSD1351_library/examples/bmp/bmp.ino:29:
/Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/bits/stl_pair.h:194:21: error: macro "swap" requires 2 arguments, but only 1 given
       swap(pair& __p)
                     ^
/Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/bits/stl_pair.h:254:50: error: macro "swap" passed 4 arguments, but takes just 2
     swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y)
                                                  ^
/Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/bits/stl_pair.h:255:35: error: macro "swap" requires 2 arguments, but only 1 given
     noexcept(noexcept(__x.swap(__y)))
                                   ^
/Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/bits/stl_pair.h:256:19: error: macro "swap" requires 2 arguments, but only 1 given
     { __x.swap(__y); }
                   ^
In file included from /Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/exception:162:0,
                 from /Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/new:40,
                 from /Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/ext/new_allocator.h:33,
                 from /Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/xtensa-esp32-elf/bits/c++allocator.h:33,
                 from /Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/bits/allocator.h:46,
                 from /Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/memory:63,
                 from /Arduino/hardware/espressif/esp32/libraries/FS/src/FS.h:24,
                 from /Arduino/hardware/espressif/esp32/libraries/SD/src/SD.h:17,
                 from /home/oem/Arduino/libraries/Adafruit_SSD1351_library/examples/bmp/bmp.ino:29:
/Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/bits/exception_ptr.h:118:68: error: macro "swap" requires 2 arguments, but only 1 given
         exception_ptr(static_cast<exception_ptr&&>(__o)).swap(*this);
                                                                    ^
/Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/bits/exception_ptr.h:126:26: error: macro "swap" requires 2 arguments, but only 1 given
       swap(exception_ptr&) _GLIBCXX_USE_NOEXCEPT;
                          ^
/Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/bits/exception_ptr.h:161:23: error: macro "swap" requires 2 arguments, but only 1 given
     { __lhs.swap(__rhs); }
                       ^
In file included from /Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/memory:63:0,
                 from /Arduino/hardware/espressif/esp32/libraries/FS/src/FS.h:24,
                 from /Arduino/hardware/espressif/esp32/libraries/SD/src/SD.h:17,
                 from /home/oem/Arduino/libraries/Adafruit_SSD1351_library/examples/bmp/bmp.ino:29:
/Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/bits/allocator.h:213:32: error: macro "swap" requires 2 arguments, but only 1 given
   __c.get_allocator()).swap(__c);
                                ^
In file included from /Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/string:52:0,
                 from /Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/stdexcept:39,
                 from /Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/array:38,
                 from /Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/tuple:39,
                 from /Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/functional:55,
                 from /Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/memory:79,
                 from /Arduino/hardware/espressif/esp32/libraries/FS/src/FS.h:24,
                 from /Arduino/hardware/espressif/esp32/libraries/SD/src/SD.h:17,
                 from /home/oem/Arduino/libraries/Adafruit_SSD1351_library/examples/bmp/bmp.ino:29:
/Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/bits/basic_string.h:590:18: error: macro "swap" requires 2 arguments, but only 1 given
  this->swap(__str);
                  ^
/Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/bits/basic_string.h:1876:29: error: macro "swap" requires 2 arguments, but only 1 given
       swap(basic_string& __s) _GLIBCXX_NOEXCEPT;
                             ^
/Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/bits/basic_string.h:5134:47: error: macro "swap" passed 6 arguments, but takes just 2
   basic_string<_CharT, _Traits, _Alloc>& __rhs)
                                               ^
/Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/bits/basic_string.h:5135:23: error: macro "swap" requires 2 arguments, but only 1 given
     { __lhs.swap(__rhs); }
                       ^
In file included from /Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/string:53:0,
                 from /Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/stdexcept:39,
                 from /Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/array:38,
                 from /Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/tuple:39,
                 from /Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/functional:55,
                 from /Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/memory:79,
                 from /Arduino/hardware/espressif/esp32/libraries/FS/src/FS.h:24,
                 from /Arduino/hardware/espressif/esp32/libraries/SD/src/SD.h:17,
                 from /home/oem/Arduino/libraries/Adafruit_SSD1351_library/examples/bmp/bmp.ino:29:
/Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/bits/basic_string.tcc:59:27: error: macro "swap" requires 2 arguments, but only 1 given
     swap(basic_string& __s) _GLIBCXX_NOEXCEPT
                           ^
In file included from /Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/tuple:39:0,
                 from /Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/functional:55,
                 from /Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/memory:79,
                 from /Arduino/hardware/espressif/esp32/libraries/FS/src/FS.h:24,
                 from /Arduino/hardware/espressif/esp32/libraries/SD/src/SD.h:17,
                 from /home/oem/Arduino/libraries/Adafruit_SSD1351_library/examples/bmp/bmp.ino:29:
/Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/array:115:26: error: macro "swap" requires 2 arguments, but only 1 given
       swap(array& __other)
                          ^
/Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/array:274:56: error: macro "swap" passed 4 arguments, but takes just 2
     swap(array<_Tp, _Nm>& __one, array<_Tp, _Nm>& __two)
                                                        ^

This five minutes between posts is total bull crap, btw. Evidently the debug was still too long for one post…

/Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/tuple:1133:35: error: macro "swap" requires 2 arguments, but only 1 given
     noexcept(noexcept(__x.swap(__y)))
                                   ^
/Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/tuple:1134:19: error: macro "swap" requires 2 arguments, but only 1 given
     { __x.swap(__y); }
                   ^
In file included from /Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/memory:79:0,
                 from /Arduino/hardware/espressif/esp32/libraries/FS/src/FS.h:24,
                 from /Arduino/hardware/espressif/esp32/libraries/SD/src/SD.h:17,
                 from /home/oem/Arduino/libraries/Adafruit_SSD1351_library/examples/bmp/bmp.ino:29:
/Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/functional:2035:16: error: macro "swap" requires 2 arguments, but only 1 given
  __x.swap(*this);
                ^
/Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/functional:2075:26: error: macro "swap" requires 2 arguments, but only 1 given
  function(__x).swap(*this);
                          ^
/Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/functional:2093:37: error: macro "swap" requires 2 arguments, but only 1 given
  function(std::move(__x)).swap(*this);
                                     ^
/Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/functional:2136:52: error: macro "swap" requires 2 arguments, but only 1 given
    function(std::forward<_Functor>(__f)).swap(*this);
                                                    ^
/Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/functional:2145:28: error: macro "swap" requires 2 arguments, but only 1 given
    function(__f).swap(*this);
/Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/functional:2158:30: error: macro "swap" requires 2 arguments, but only 1 given
       void swap(function& __x)
                              ^
/Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/functional:2374:19: error: macro "swap" requires 2 arguments, but only 1 given
     { __x.swap(__y); }
                   ^
In file included from /Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/memory:81:0,
                 from /Arduino/hardware/espressif/esp32/libraries/FS/src/FS.h:24,
                 from /Arduino/hardware/espressif/esp32/libraries/SD/src/SD.h:17,
                 from /home/oem/Arduino/libraries/Adafruit_SSD1351_library/examples/bmp/bmp.ino:29:
/Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/bits/unique_ptr.h:349:27: error: macro "swap" requires 2 arguments, but only 1 given
       swap(unique_ptr& __u) noexcept
                           ^
/Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/bits/unique_ptr.h:591:27: error: macro "swap" requires 2 arguments, but only 1 given
       swap(unique_ptr& __u) noexcept
                           ^
/Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/bits/unique_ptr.h:618:28: error: macro "swap" passed 4 arguments, but takes just 2
   unique_ptr<_Tp, _Dp>& __y) noexcept
                            ^
/Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/bits/unique_ptr.h:619:19: error: macro "swap" requires 2 arguments, but only 1 given
     { __x.swap(__y); }
                   ^
In file included from /Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/bits/shared_ptr.h:52:0,
                 from /Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/memory:82,
                 from /Arduino/hardware/espressif/esp32/libraries/FS/src/FS.h:24,
                 from /Arduino/hardware/espressif/esp32/libraries/SD/src/SD.h:17,
                 from /home/oem/Arduino/libraries/Adafruit_SSD1351_library/examples/bmp/bmp.ino:29:
Multiple libraries were found for "SD.h"
/Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/bits/shared_ptr_base.h:992:43: error: macro "swap" requires 2 arguments, but only 1 given
 Used: /Arduino/hardware/espressif/esp32/libraries/SD
    __shared_ptr(std::move(__r)).swap(*this);
 Not used: /home/oem/Arduino/libraries/SD
                                           ^
 Not used: /Arduino/libraries/SD
/Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/bits/shared_ptr_base.h:1000:41: error: macro "swap" requires 2 arguments, but only 1 given
  __shared_ptr(std::move(__r)).swap(*this);
                                         ^
/Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/bits/shared_ptr_base.h:1008:43: error: macro "swap" requires 2 arguments, but only 1 given
    __shared_ptr(std::move(__r)).swap(*this);
                                           ^
/Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/bits/shared_ptr_base.h:1016:43: error: macro "swap" requires 2 arguments, but only 1 given
    __shared_ptr(std::move(__r)).swap(*this);
                                           ^
/Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/bits/shared_ptr_base.h:1022:34: error: macro "swap" requires 2 arguments, but only 1 given
       { __shared_ptr().swap(*this); }
                                  ^
/Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/bits/shared_ptr_base.h:1030:32: error: macro "swap" requires 2 arguments, but only 1 given
    __shared_ptr(__p).swap(*this);
                                ^
/Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/bits/shared_ptr_base.h:1036:37: error: macro "swap" requires 2 arguments, but only 1 given
  { __shared_ptr(__p, __d).swap(*this); }
                                     ^
/Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/bits/shared_ptr_base.h:1041:60: error: macro "swap" requires 2 arguments, but only 1 given
         { __shared_ptr(__p, __d, std::move(__a)).swap(*this); }
                                                            ^
/Arduino/hardware/espressif/esp32/tools/xtensa-esp32-elf/xtensa-esp32-elf/include/c++/5.2.0/bits/shared_ptr_base.h:1299:66: error: macro "swap" passed 4 arguments, but takes just 2
     swap(__shared_ptr<_Tp, _Lp>& __a, __shared_ptr<_Tp, _Lp>& __b) noexcept
                                                                  ^
exit status 1
Error compiling for board Adafruit ESP32 Feather.

Had to delete some of it because I’m not patient enough to wait 30 freakin minutes to post it all. This 9k character limit without a character counter and the five minute minimum wait time is pissing me off with this.

Can someone help me understand this and point me in the right direction?

I believe the problem is that the author of the Adafruit_SSD1351 library had the genius idea of defining a macro named swap:

but there is a function of the same name in the ESP32 toolchain so this means the library is not compatible with the ESP32 toolchain.

You would need to go through the Adafruit_SSD1351 library and change all instances of the macro name to something sensible like ADAFRUIT_SSD1351_SWAP.

Ok, thank you Pert. I appreciate the speedy reply.

LtShinySides:
This five minutes between posts is total bull crap, btw. Evidently the debug was still too long for one post..

LtShinySides:
Had to delete some of it because I'm not patient enough to wait 30 freakin minutes to post it all. This 9k character limit without a character counter and the five minute minimum wait time is pissing me off with this.

You could have been clever :wink: A lot of the messages are repeats referring to the same error on different lines of the code/library so you could have cut a lot out. Or you could have pasted it to a file, saved it and attach the file. I often prepare longer posts in an editor, easier to read and check.

I also found the 5 minute limitation annoying but got used to it. And eventually it disappeared. If you're actively involved in the forum (try to help others), I don't know if you are, the limit will disappear quite quickly.

sterretje:
You could have been clever :wink: A lot of the messages are repeats referring to the same error on different lines of the code/library so you could have cut a lot out. Or you could have pasted it to a file, saved it and attach the file. I often prepare longer posts in an editor, easier to read and check.

I didn't think to try an editor first, but I did notice most of it was the same thing over and over. I just try to get it all in there when I can, just in case theres something else causing issues. As it stands, a whole new slew of errors popped up after this one was resolved and right now I'm just not going to dig into it. I have other tasks I can work on and wait til I have a clearer mind and more willing to tackle it.

Well good news is I found a different library yesterday that actually works with the Adafruit ESP32 board and the display module. Took me a while to get the pins connected properly, but i got it figured out.

Can you provide a link? It might help other people that in future encounter the sane problem.

Certainly! I'll post up the Github links along with my pinout this afternoon/evening after work.

It took me forever, it felt like, and I knew it was my pinout and not the sample program because it was reading in the serial monitor just fine. Eventually i sat there and just stared at the wires and stared at the code and started moving the wires to the right positions. Part of the problem is that the display board i bought is not labeled the same so I had to figure out what some of it meant.

Ok so the main library is at this page.

Make sure that you also go to this page and download this library as well, as it is required by the first. Follow the instructions on where to put them/how to install them and then restart Arduino if thats what you're using.

I used this display and it works pretty well now that I have it connected properly. It is very similar to the Adafruit board, except that it does not come with a built in SD card reader and the pinout is a little different and labeled differently. Other than that, it looks to be the same.

I attempted to use all three sample programs, however I couldn't get my board to connect to my phones hotspot access. Not really sure why that was, but it did upload just fine to the Huzzah32 so I am confident that it does work like normal. the one I used was graphictest.ino, which is a program that cycles thru various images being drawn on the screen. Very nice detail, shows how colorful the screen can be and what it could be capable of.

Pinout

SSD1351 Huzzah32
GND GND
VCC 3V
SCL SCK, pin 5
SDA MOSI, pin 18
RES
DC RX, pin 16
CS TX, pin 17

Reset can be any pin, I think, but having it plugged in causes it to cut off. I'm guessing thats where you would put in a switch for on/off. The DC and CS pins were just the recommendation of the program, not required to be on the RX/TX pins.

Quick edit: Once I put the libraries in my Arduino/library folder, it has not shown up in Arduino IDE. Not sure what the deal is with that, but it may not be the libraries fault. I placed another library in there and its not showing up either..

Thank you; karma added :wink: