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

Enable filesystem support for native builds #536

Closed
wants to merge 1 commit into from

Conversation

MitchBradley
Copy link
Contributor

No description provided.

@MitchBradley
Copy link
Contributor Author

Will this be propagated to M5GFX at some future time?

@MitchBradley
Copy link
Contributor Author

Some context of what I am trying to accomplish - we have developed a pendant controller for use with the FluidNC CNC firmware. The pendant normally runs on an M5 Dial as shown
IMG_6860
but it will also run on a PC for development and testing. It uses M5Unified for most of the IO
image

@lovyan03
Copy link
Owner

lovyan03 commented Mar 1, 2024

Thank you for the pull request.
Sorry, this is a flaw that I overlooked.
However, FileWrapper will be deprecated and merged with DataWrapperT.
Please wait for a while as we will make a fix to replace this.

@lovyan03
Copy link
Owner

lovyan03 commented Mar 1, 2024

BTW, M5GFX and LovyanGFX are basically scheduled to be updated synchronously, but recently M5GFX has sometimes been updated faster.
Since LovyanGFX has many target devices, it takes time to confirm operation, and updates may not be provided immediately.

@lovyan03
Copy link
Owner

lovyan03 commented Mar 2, 2024

I checked and found that the current development branch's implementation already works with drawJpgFile and loadFont, even without using your pull request.

I used the following program.

#include <stdio.h>

#define LGFX_AUTODETECT
#include <LGFX_AUTODETECT.hpp>
LGFX gfx;
void setup(void) {
  gfx.init();
  gfx.drawJpgFile("r:/lovyan03.jpg", 0, 0);
  gfx.loadFont("r:/font.vlw");
  gfx.drawString("Hello", 100, 100);
}

void loop(void) {}

image

Can you show me the code you used for validation?

@MitchBradley
Copy link
Contributor Author

I don't have a simple validation test; rather I used a fairly extensive app that can be compiled to run either on M5Dial or Windows. It uses M5Unified for Button_Class, Speaker_Class, and Touch_Class so I can emulate M5Dial in Windows. I can make a small test to illustrate the function of the filesystem stuff.

I just now tried using m5stack/M5GFX#develop to see if that works. It cannot display image files unless I apply the patch to lgfx_filesystem_support.hpp .

I also tried substituting LovyanGFX#develop for the graphics, but ran into conflicts with the M5GFX package that M5Unified depends on. Breaking that dependency looks like it could be difficult.

@lovyan03
Copy link
Owner

lovyan03 commented Mar 2, 2024

M5Unified also works fine.

#include <stdio.h>

#include <M5Unified.h>

void setup(void) {
  M5.begin();
  M5.Display.drawJpgFile("r:/lovyan03.jpg", 0, 0);
  M5.Display.loadFont("r:/font.vlw");
  M5.Display.drawString("Hello", 100, 100);
}

void loop(void) { M5.delay(1000); }

image

@lovyan03
Copy link
Owner

lovyan03 commented Mar 2, 2024

What matters is the include order.
It should work if stdio.h is included before M5GFX.

@lovyan03
Copy link
Owner

lovyan03 commented Mar 2, 2024

By the way, although the contents of M5GFX is LovyanGFX, we have no intention of supporting M5Unified or M5GFX in the LovyanGFX repository. If this topic continues any longer, please close this pull request and open an issue in the M5Unified or M5GFX repositories.

If you want to debug with LovyanGFX, you can continue the topic here, but if you want to debug with M5Unified, end the discussion here and move over there.

@MitchBradley
Copy link
Contributor Author

My program works with stdio.h before M5Unified. I completely missed the template specialization of DataWrapper when trying to understand how the code works. Thanks for the help.

@mhaberler
Copy link

... I completely missed the template specialization of DataWrapper when trying to understand how the code works.

me too.. very useful.

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

Successfully merging this pull request may close these issues.

3 participants