2dom / PxMatrix

Adafruit GFX compatible graphics driver for LED matrix panels
BSD 3-Clause "New" or "Revised" License
830 stars 170 forks source link

I think Espressif changed ESP32 library, so we dosn't access GPIO port pins directly. #341

Open GokhanAyberk opened 3 months ago

GokhanAyberk commented 3 months ago

Rules

  1. Post your code
  2. Post a picture of the problem and describe what you expect to see
  3. Run the pattern test and post the result as gif/video (need to have a bit more than one full RED/YELLOW/WHITE cycle)
  4. State what version of PxMatrix you are running and what MicroController you use

Hi Dominic I think my issue general I am using latest version and ESP32 wroom-DA. My sketch was working very good. But I had this error after esp32 board lib update now, "" /home/gokhan/Arduino/libraries/PxMatrix_LED_MATRIX_library/PxMatrix.h:83:29: error: 'GPIO' was not declared in this scope 83 | #define GPIO_REG_SET(val) GPIO.out_w1ts = val | ^~~~ /home/gokhan/Arduino/libraries/PxMatrix_LED_MATRIX_library/PxMatrix.h:408:5: note: in expansion of macro 'GPIO_REG_SET' 408 | GPIO_REG_SET(1 << _LATCH_PIN); | ^~~~ ""

I think Espressif changed ESP32 library, so we dosn't access GPIO port pins directly.

I tried to fix like;

include "hal/gpio_ll.h" ;

include

but it doesn't work. Any suggestion? Thank you.

GokhanAyberk commented 3 months ago

I solved my issue, The other change was in the timer object use 1) I added (#include "hal/gpio_ll.h" ;) line for direct access to GPIO pins 2) I chagged my timer usage. void display_update_enable(bool is_enable) { timer = timerBegin(1000000); timerAttachInterrupt(timer, &display_updater); timerAlarm(timer, 4000, true,0); timerStart(timer); }