During testing an ESP32 device I have noticed that after reset the following line randomly stops the execution:
self.disp_drv.set_flush_cb(esp.ili9xxx_flush if hybrid and hasattr(esp, 'ili9xxx_flush') else self.flush)
The problem occurs only every time in that line. When the if-else statement is moved out from the function, and stored in a variable, then the problem disappears.
Other change:
moved out esp.MALLOC_CAP.DMA flag from functions into a global variable (_MALLOC_DMA), and added esp.MALLOC_CAP.INTERNAL flag too (just to make sure DMA-able memory is always allocated in internal memory)
Fix random crash of ESP32 ili9XXX display driver.
During testing an ESP32 device I have noticed that after reset the following line randomly stops the execution:
self.disp_drv.set_flush_cb(esp.ili9xxx_flush if hybrid and hasattr(esp, 'ili9xxx_flush') else self.flush)
The problem occurs only every time in that line. When the if-else statement is moved out from the function, and stored in a variable, then the problem disappears.
Other change: moved out
esp.MALLOC_CAP.DMA
flag from functions into a global variable(_MALLOC_DMA
), and addedesp.MALLOC_CAP.INTERNAL
flag too (just to make sure DMA-able memory is always allocated in internal memory)