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

Error during building on latest micropython version #161

Open
zaringleb opened this issue Apr 26, 2024 · 1 comment
Open

Error during building on latest micropython version #161

zaringleb opened this issue Apr 26, 2024 · 1 comment

Comments

@zaringleb
Copy link

zaringleb commented Apr 26, 2024

Hi,
st7789/st7789.c is not compatible with the latest micropython version micropython/micropython@3e2706a

below is the diff that makes it work for me

index 1eb78a9..13f2bab 100644
--- a/st7789/st7789.c
+++ b/st7789/st7789.c
@@ -24,11 +24,15 @@
 
 #define __ST7789_VERSION__  "0.1.5"
 
+#ifndef STATIC
+#define STATIC static
+#endif
+
 #include "py/obj.h"
 #include "py/runtime.h"
 #include "py/builtin.h"
 #include "py/mphal.h"
-#include "extmod/machine_spi.h"
+#include "extmod/modmachine.h"
 
 #include "st7789.h"
 
@@ -663,4 +667,4 @@ const mp_obj_module_t mp_module_st7789 = {
     .globals = (mp_obj_dict_t*)&mp_module_st7789_globals,
 };
 
-MP_REGISTER_MODULE(MP_QSTR_st7789, mp_module_st7789, 1);
+MP_REGISTER_MODULE(MP_QSTR_st7789, mp_module_st7789);
@ricksorensen
Copy link

Maybe check to see which version of st7789_mpy you are using. There was a fix around mid-March for switch to static from the local define, and in mid November to switch from machine_spi.h to modmachine.h based on micropython version.

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

2 participants