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

Compile error for missing extmod/machine_spi.h when micropython 1.22 will be released #143

Closed
ricksorensen opened this issue Oct 26, 2023 · 3 comments

Comments

@ricksorensen
Copy link

In st7789.c, the file <micropython>/extmod/machine_spi.h is included. In recent (20231025) commits to micropython for cleaning up the code, this file was removed and modmachine.h now includes those definitions. This change impacts:

  • st7789.c
  • png/pngle.c

I have now compiled successfully (using SEEED WIO Terminal) - but still need to test with actual display. Not sure about side effects either.

@russhughes
Copy link
Owner

Thanks for the information, I hope to update my build system this weekend.

@vintxo
Copy link

vintxo commented Nov 3, 2023

same problem here, hope you will fix this soon! thank you

@ricksorensen
Copy link
Author

ricksorensen commented Nov 3, 2023

Not a simple fix for a a system that wishes to support multiple instances of micropython!
I see in /py/mpconfig.h there are the following defines fro branch (version)1.21:

// Current version of MicroPython
#define MICROPY_VERSION_MAJOR 1
#define MICROPY_VERSION_MINOR 21
#define MICROPY_VERSION_MICRO 0

and for the current (20231103) master branch:

// Current version of MicroPython. This is used by sys.implementation.version
// as well as a fallback to generate MICROPY_GIT_TAG if the git repo or tags
// are unavailable.
#define MICROPY_VERSION_MAJOR 1
#define MICROPY_VERSION_MINOR 22
#define MICROPY_VERSION_MICRO 0
#define MICROPY_VERSION_PRERELEASE 1

I suppose a conditional compile could be used to determine which file to include, for example:

....
// need this to get definitions I believe
#include "py/mpconfig.h" 
...   
#if MICROPY_VERSION_MAJOR >= 1 && MICROPY_VERSION_MINOR > 21 
#include "extmod/modmachine.h"
#else
#include "extmod/machine_spi.h"
#endif

(edits to directory for mpconfig.h and major version check as >=)

Checked out on current version (pre-release of 1.22), haven't gone back in time yet.

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

3 participants