From 54971d4b01b927a8b29a16a13c2708730bc209f9 Mon Sep 17 00:00:00 2001 From: Nicolas Schodet Date: Thu, 13 Oct 2016 11:07:02 +0200 Subject: ucoo/hal/frame_buffer: add refresh without waiting HSYNC This is needed when screen is OFF. --- ucoo/hal/frame_buffer/dsi.stm32f4.cc | 7 +++++-- ucoo/hal/frame_buffer/dsi.stm32f4.hh | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'ucoo/hal') diff --git a/ucoo/hal/frame_buffer/dsi.stm32f4.cc b/ucoo/hal/frame_buffer/dsi.stm32f4.cc index 8e13982..e344c81 100644 --- a/ucoo/hal/frame_buffer/dsi.stm32f4.cc +++ b/ucoo/hal/frame_buffer/dsi.stm32f4.cc @@ -180,10 +180,13 @@ Dsi::layer_setup (int layer, const Surface &surface, int x, int y) } void -Dsi::refresh () +Dsi::refresh (bool wait_hsync) { refreshing_ = true; - ucoo::Dsi::write_command ({ DCS_SET_TEAR_ON, 0x00 }); + if (wait_hsync) + ucoo::Dsi::write_command ({ DCS_SET_TEAR_ON, 0x00 }); + else + ucoo::reg::DSI->WCR |= DSI_WCR_LTDCEN; while (refreshing_) ucoo::barrier (); } diff --git a/ucoo/hal/frame_buffer/dsi.stm32f4.hh b/ucoo/hal/frame_buffer/dsi.stm32f4.hh index 5f785aa..6842f19 100644 --- a/ucoo/hal/frame_buffer/dsi.stm32f4.hh +++ b/ucoo/hal/frame_buffer/dsi.stm32f4.hh @@ -44,7 +44,7 @@ class Dsi : public Ltdc /// Setup a layer. void layer_setup (int layer, const Surface &surface, int x, int y); /// Refresh screen. - static void refresh (); + static void refresh (bool wait_hsync); /// Write a command to display. static void write_command (std::initializer_list data); private: -- cgit v1.2.3