From 8f1abb8b4baddc6f861baf98bd83b1a21d6cc806 Mon Sep 17 00:00:00 2001 From: YunHorn Technology Date: Fri, 11 Aug 2023 10:53:53 +0800 Subject: [PATCH] revised LCD_BL_ON OFF --- mlx90640/mlx90640_lcd_display.c | 50 +++++++++++++++++---------------- mlx90640/st7789.c | 6 ++-- mlx90640/stm32_hx8347d_lcd.c | 2 +- 3 files changed, 30 insertions(+), 28 deletions(-) diff --git a/mlx90640/mlx90640_lcd_display.c b/mlx90640/mlx90640_lcd_display.c index 904b069..67aa101 100644 --- a/mlx90640/mlx90640_lcd_display.c +++ b/mlx90640/mlx90640_lcd_display.c @@ -132,22 +132,19 @@ static void drawLegend(void) BSP_LCD_Clear(LCD_COLOR_BLACK); draw_legend_once =1; - BSP_LCD_DrawHLine(0,246,ST7789V_LCD_PIXEL_WIDTH, LCD_COLOR_LIGHTBLUE); - BSP_LCD_DrawHLine(0,245,ST7789V_LCD_PIXEL_WIDTH, LCD_COLOR_LIGHTBLUE); -#if 0 - BSP_LCD_DrawHLine(0,0,ST7789V_LCD_PIXEL_WIDTH, LCD_COLOR_LIGHTBLUE); - BSP_LCD_DrawVLine(0,0,ST7789V_LCD_PIXEL_HEIGHT-16-2, LCD_COLOR_LIGHTBLUE); - BSP_LCD_DrawVLine(ST7789V_LCD_PIXEL_WIDTH/2,0,ST7789V_LCD_PIXEL_HEIGHT-16-16, LCD_COLOR_LIGHTBLUE); -#endif - BSP_LCD_SetFont(&Font16); - memset(tempBuffer,0,sizeof(tempBuffer)); - DrawProp.BackColor = LCD_COLOR_BLACK; - sprintf(tempBuffer,(char *)"Yunhorn Technology"); - BSP_LCD_DisplayStringAt(20,ST7789V_LCD_PIXEL_HEIGHT,(uint8_t *)tempBuffer,LEFT_MODE,LCD_COLOR_BLUE); + //BSP_LCD_DrawHLine(0,ST7789V_LCD_PIXEL_HEIGHT-16-1,ST7789V_LCD_PIXEL_WIDTH, LCD_COLOR_LIGHTBLUE); + BSP_LCD_DrawHLine(0,ST7789V_LCD_PIXEL_HEIGHT-16-1,ST7789V_LCD_PIXEL_WIDTH, LCD_COLOR_BRRED); + BSP_LCD_DrawHLine(0,16,ST7789V_LCD_PIXEL_WIDTH, LCD_COLOR_BRRED); - memset(tempBuffer,0,sizeof(tempBuffer)); - sprintf(tempBuffer,(char *)"F10.Male#1.WashBasin",centerTemp); - BSP_LCD_DisplayStringAt(8, ST7789V_LCD_PIXEL_HEIGHT-16,(uint8_t *)tempBuffer,LEFT_MODE,LCD_COLOR_WHITE); + BSP_LCD_SetFont(&Font16); + memset(tempBuffer,0,sizeof(tempBuffer)); + DrawProp.BackColor = LCD_COLOR_BLACK; + sprintf(tempBuffer,(char *)"Yunhorn Technology"); + BSP_LCD_DisplayStringAt(20,ST7789V_LCD_PIXEL_HEIGHT,(uint8_t *)tempBuffer,LEFT_MODE,LCD_COLOR_DARKBLUE); + + memset(tempBuffer,0,sizeof(tempBuffer)); + sprintf(tempBuffer,(char *)"F10.Male#1.WashBasin",centerTemp); + BSP_LCD_DisplayStringAt(8, 15,(uint8_t *)tempBuffer,LEFT_MODE,LCD_COLOR_WHITE); } #if 0 BSP_LCD_SetFont(&Font16); @@ -212,10 +209,12 @@ averageTemp = 0.0; averageTemp += tempValues[i]; averageTemp /= 768; #endif - BSP_LCD_FillRect(1,1,ST7789V_LCD_PIXEL_WIDTH-2, ST7789V_LCD_PIXEL_HEIGHT-16-16, LCD_COLOR_BLACK); + + BSP_LCD_FillRect(0,40, ST7789V_LCD_PIXEL_WIDTH, ST7789V_LCD_PIXEL_HEIGHT, LCD_COLOR_BLACK); + for (y=0; y<23; y++) { - for (x=0; x<31; x++) + for (x=1; x<32; x++) { if (zoneMask[y*32+x] > 3) { @@ -304,15 +303,18 @@ void mlx90640_display_process(void) if (blackOutTag == 0) { + //BSP_LCD_DisplayOn(); + LCD_BL_ON(); - // APP_LOG(TS_OFF, VLEVEL_L, "DetectCycle=%d \r\n", detectCycle); - BSP_LCD_DisplayOn(); - - drawPicture(); - drawMeasurement(); - + if (detectCycle !=0) + { + drawPicture(); + drawMeasurement(); + } } else { - BSP_LCD_DisplayOff(); + + LCD_BL_OFF(); + // BSP_LCD_DisplayOff(); } } diff --git a/mlx90640/st7789.c b/mlx90640/st7789.c index 6cb29ec..2c3b667 100644 --- a/mlx90640/st7789.c +++ b/mlx90640/st7789.c @@ -217,9 +217,9 @@ void st7789v_DisplayOn(void) LCD_Delay(10); LCD_IO_WriteReg(0x29);/* Display on: DISPON */ LCD_Delay(10); - LCD_IO_WriteReg(0x36);/* Memory data access control: MADCTL */ - data = 0xC0; - LCD_IO_WriteMultipleData(&data, 1); +// LCD_IO_WriteReg(0x36);/* Memory data access control: MADCTL */ +// data = 0xC0; +// LCD_IO_WriteMultipleData(&data, 1); } /** diff --git a/mlx90640/stm32_hx8347d_lcd.c b/mlx90640/stm32_hx8347d_lcd.c index 8726aaf..fb4f458 100644 --- a/mlx90640/stm32_hx8347d_lcd.c +++ b/mlx90640/stm32_hx8347d_lcd.c @@ -711,7 +711,7 @@ void BSP_LCD_FillRect(uint16_t Xpos, uint16_t Ypos, uint16_t Width, uint16_t Hei lcd_drv->FillRect(Xpos, Ypos, Width, Height, RGBCode); } - SetDisplayWindow(0, 0, BSP_LCD_GetXSize(), BSP_LCD_GetYSize()); + //SetDisplayWindow(0, 0, BSP_LCD_GetXSize(), BSP_LCD_GetYSize()); } /**