st7789_mpy icon indicating copy to clipboard operation
st7789_mpy copied to clipboard

Error during building on latest micropython version

Open zaringleb opened this issue 9 months ago • 1 comments

Hi, st7789/st7789.c is not compatible with the latest micropython version https://github.com/micropython/micropython/commit/3e2706a18dd4071d2d3040549786e659fc3b46b7

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);

zaringleb avatar Apr 26 '24 21:04 zaringleb

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.

ricksorensen avatar May 04 '24 20:05 ricksorensen