Fix TouchGFX again

This commit is contained in:
Julian 2024-07-21 16:30:53 +02:00
parent 0f5cfe56a9
commit a32d497074
4 changed files with 39 additions and 5 deletions

View File

@ -20,7 +20,6 @@
/* Includes ------------------------------------------------------------------*/
#include "main.h"
/* USER CODE BEGIN Includes */
/* USER CODE END Includes */

View File

@ -1,5 +1,5 @@
##########################################################################################################################
# File automatically-generated by tool: [projectgenerator] version: [4.3.0-B58] date: [Sun Jul 21 12:04:39 CEST 2024]
# File automatically-generated by tool: [projectgenerator] version: [4.3.0-B58] date: [Sun Jul 21 16:29:55 CEST 2024]
##########################################################################################################################
# ------------------------------------------------

View File

@ -19,6 +19,7 @@
#include <TouchGFXGeneratedHAL.hpp>
#include <touchgfx/hal/OSWrappers.hpp>
#include <gui/common/FrontendHeap.hpp>
#include <touchgfx/hal/GPIO.hpp>
#include <touchgfx/hal/PaintImpl.hpp>
#include <touchgfx/hal/PaintRGB565Impl.hpp>
@ -37,7 +38,7 @@ void TouchGFXGeneratedHAL::initialize()
{
HAL::initialize();
registerEventListener(*(Application::getInstance()));
setFrameBufferStartAddresses((void*)0x24040000, (void*)0x24040000, (void*)0);
setFrameBufferStartAddresses((void*)0x24040000, (void*)0x240A0000, (void*)0);
}
void TouchGFXGeneratedHAL::configureInterrupts()
@ -123,4 +124,37 @@ void TouchGFXGeneratedHAL::FlushCache()
}
}
extern "C"
{
void HAL_LTDC_LineEventCallback(LTDC_HandleTypeDef* hltdc)
{
if (!HAL::getInstance())
{
return;
}
if (LTDC->LIPCR == lcd_int_active_line)
{
//entering active area
HAL_LTDC_ProgramLineEvent(hltdc, lcd_int_porch_line);
HAL::getInstance()->vSync();
OSWrappers::signalVSync();
// Swap frame buffers immediately instead of waiting for the task to be scheduled in.
// Note: task will also swap when it wakes up, but that operation is guarded and will not have
// any effect if already swapped.
HAL::getInstance()->swapFrameBuffers();
GPIO::set(GPIO::VSYNC_FREQ);
}
else
{
//exiting active area
HAL_LTDC_ProgramLineEvent(hltdc, lcd_int_active_line);
// Signal to the framework that display update has finished.
HAL::getInstance()->frontPorchEntered();
GPIO::clear(GPIO::VSYNC_FREQ);
}
}
}
/************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/

View File

@ -577,13 +577,14 @@ STMicroelectronics.X-CUBE-AZRTOS-H7.3.0.0_IsAnAzureRtosMw=true
STMicroelectronics.X-CUBE-AZRTOS-H7.3.0.0_SwParameter=ThreadXCcRTOSJjThreadXJjCore\:true;
STMicroelectronics.X-CUBE-TOUCHGFX.4.23.2.ApplicationCcGraphicsJjApplication=TouchGFXOoGenerator
STMicroelectronics.X-CUBE-TOUCHGFX.4.23.2.GraphicsJjApplication_Checked=true
STMicroelectronics.X-CUBE-TOUCHGFX.4.23.2.IPParameters=tgfx_custom_height,ApplicationCcGraphicsJjApplication,tgfx_location,tgfx_address1,tgfx_display_interface,tgfx_buffering_strategy,tgfx_address2
STMicroelectronics.X-CUBE-TOUCHGFX.4.23.2.IPParameters=tgfx_custom_height,tgfx_location,tgfx_address1,tgfx_display_interface,tgfx_buffering_strategy,tgfx_address2,ApplicationCcGraphicsJjApplication,tgfx_vsync
STMicroelectronics.X-CUBE-TOUCHGFX.4.23.2.tgfx_address1=0x24040000
STMicroelectronics.X-CUBE-TOUCHGFX.4.23.2.tgfx_address2=0x24040000
STMicroelectronics.X-CUBE-TOUCHGFX.4.23.2.tgfx_address2=0x240A0000
STMicroelectronics.X-CUBE-TOUCHGFX.4.23.2.tgfx_buffering_strategy=Double
STMicroelectronics.X-CUBE-TOUCHGFX.4.23.2.tgfx_custom_height=480
STMicroelectronics.X-CUBE-TOUCHGFX.4.23.2.tgfx_display_interface=disp_ltdc
STMicroelectronics.X-CUBE-TOUCHGFX.4.23.2.tgfx_location=By Address
STMicroelectronics.X-CUBE-TOUCHGFX.4.23.2.tgfx_vsync=vsync_ltdc
STMicroelectronics.X-CUBE-TOUCHGFX.4.23.2_IsPackSelfContextualization=true
STMicroelectronics.X-CUBE-TOUCHGFX.4.23.2_SwParameter=ApplicationCcGraphicsJjApplication\:TouchGFXOoGenerator;
TIM1.Channel-PWM\ Generation1\ CH1=TIM_CHANNEL_1