Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

face-and-color example compile error solved #70

Open
PaulskPt opened this issue Mar 26, 2022 · 0 comments
Open

face-and-color example compile error solved #70

PaulskPt opened this issue Mar 26, 2022 · 0 comments

Comments

@PaulskPt
Copy link

PaulskPt commented Mar 26, 2022

Using a M5Stack Core2 device.

To solve a reference to 'JPEG_DIV_NONE' is ambiguous and
reference to 'jpeg_div_t' is ambiguous. errors, I changed the following file:

In file: libraries/M5Core2/src/M5Display.h,
from line 13:

  typedef enum {
    JPEG_DIV_NN,  // name changed. Original JPEG_DIV_NONE 
    JPEG_DIV_2,
    JPEG_DIV_4,
    JPEG_DIV_8,
    JPEG_DIV_MAX
  } jpeg_div_disp_t; // name changed. Original jpeg_div_t 

I had to change both name definitions 'JPEG_DIV_NONE' and 'jpeg_div_t'.

Then, in file: libraries/M5Core2/src/M5Display.cpp,

a) Line 233:

  jpeg_div_disp_t scale;  // name changed by @PaulskPt. original jpeg_div_t resulted in an error: reference to 'jpeg_div_t' is ambiguous. I had to change both the names 

b) Lines 370-372:

void M5Display::drawJpg(const uint8_t *jpg_data, size_t jpg_len, uint16_t x,
                        uint16_t y, uint16_t maxWidth, uint16_t maxHeight,
                        uint16_t offX, uint16_t offY, jpeg_div_disp_t scale) 

c) Lines 402-404:

void M5Display::drawJpgFile(fs::FS &fs, const char *path, uint16_t x, uint16_t y,
                            uint16_t maxWidth, uint16_t maxHeight, uint16_t offX,
                            uint16_t offY, jpeg_div_disp_t scale) {

After these changes these errors did not repeat, but a class Button redefined error.
To solve performed the following change:

// Following if...else...endif block added because of error redefinition of 'class Button' (
a) in class M5Stack Button.h;
b) in Core2 M5Button.h)

# if defined(ARDUINO_M5STACK_Core2) || defined(M5AVATAR_CORE2) || defined(_M5Core2_H_)
  #include <M5Core2.h>
# else
  #include <M5Stack.h>
# endif

Finally I did the following change:

then I changed:
#include <Avatar.h>
#include <faces/DogFace.h>

into:
#include "Avatar.h"
#include "faces/DogFace.h"

After these changes this example built OK

@PaulskPt PaulskPt changed the title face-and-color example compile error face-and-color example compile error solved Mar 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant