From 09147fa8e09bb36e3dc6ccd22fa15a24671ec1bf Mon Sep 17 00:00:00 2001 From: wanlei Date: Thu, 14 Dec 2023 12:18:10 +0800 Subject: [PATCH] fix(spi_master): fixed lcd example block border pixel issue --- .../spi_master/lcd/main/spi_master_example_main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/peripherals/spi_master/lcd/main/spi_master_example_main.c b/examples/peripherals/spi_master/lcd/main/spi_master_example_main.c index 57ce392103..25a74520ed 100644 --- a/examples/peripherals/spi_master/lcd/main/spi_master_example_main.c +++ b/examples/peripherals/spi_master/lcd/main/spi_master_example_main.c @@ -333,13 +333,13 @@ static void send_lines(spi_device_handle_t spi, int ypos, uint16_t *linedata) trans[0].tx_data[0] = 0x2A; //Column Address Set trans[1].tx_data[0] = 0; //Start Col High trans[1].tx_data[1] = 0; //Start Col Low - trans[1].tx_data[2] = (320) >> 8; //End Col High - trans[1].tx_data[3] = (320) & 0xff; //End Col Low + trans[1].tx_data[2] = (320 - 1) >> 8; //End Col High + trans[1].tx_data[3] = (320 - 1) & 0xff; //End Col Low trans[2].tx_data[0] = 0x2B; //Page address set trans[3].tx_data[0] = ypos >> 8; //Start page high trans[3].tx_data[1] = ypos & 0xff; //start page low - trans[3].tx_data[2] = (ypos + PARALLEL_LINES) >> 8; //end page high - trans[3].tx_data[3] = (ypos + PARALLEL_LINES) & 0xff; //end page low + trans[3].tx_data[2] = (ypos + PARALLEL_LINES - 1) >> 8; //end page high + trans[3].tx_data[3] = (ypos + PARALLEL_LINES - 1) & 0xff; //end page low trans[4].tx_data[0] = 0x2C; //memory write trans[5].tx_buffer = linedata; //finally send the line data trans[5].length = 320 * 2 * 8 * PARALLEL_LINES; //Data length, in bits