From dbb4f1749d384d71529469ccceb394b6855b6dbe Mon Sep 17 00:00:00 2001 From: Charles Allen Date: Tue, 3 May 2016 07:57:50 -0700 Subject: [PATCH] [ST7735] Free pointers from spi.write Docs for MRAA say ` The pointer return has to be free'd by the caller` Signed-off-by: Noel Eck --- src/st7735/st7735.cxx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/st7735/st7735.cxx b/src/st7735/st7735.cxx index 70af29df..a666ceac 100644 --- a/src/st7735/st7735.cxx +++ b/src/st7735/st7735.cxx @@ -128,7 +128,7 @@ ST7735::setAddrWindow(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1) { m_spiBuffer[1] = x0 + colstart; // XSTART m_spiBuffer[2] = 0x00; m_spiBuffer[3] = x1 + colstart; // XEND - m_spi.write(m_spiBuffer, 4); + free(m_spi.write(m_spiBuffer, 4)); write (ST7735_RASET); // Row addr set @@ -137,7 +137,7 @@ ST7735::setAddrWindow(uint8_t x0, uint8_t y0, uint8_t x1, uint8_t y1) { m_spiBuffer[1] = y0 + rowstart; // YSTART m_spiBuffer[2] = 0x00; m_spiBuffer[3] = y1 + rowstart; // YEND - m_spi.write(m_spiBuffer, 4); + free(m_spi.write(m_spiBuffer, 4)); write (ST7735_RAMWR); // write to RAM } @@ -157,7 +157,7 @@ ST7735::refresh () { int fragmentSize = m_height * m_width * 2 / 20; for (int fragment = 0; fragment < 20; fragment++) { - m_spi.write(&m_map[fragment * fragmentSize], fragmentSize); + free(m_spi.write(&m_map[fragment * fragmentSize], fragmentSize)); } }