File tree Expand file tree Collapse file tree 2 files changed +9
-0
lines changed
Expand file tree Collapse file tree 2 files changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -804,6 +804,7 @@ elseif(TARGET_DEVICE STREQUAL "MOY-UNK") # P8b mirrored
804804 add_definitions (-DCLOCK_CONFIG_LF_SRC=0) # RC
805805 add_definitions (-DMYNEWT_VAL_BLE_LL_SCA=500)
806806 add_definitions (-DCLOCK_CONFIG_LF_CAL_ENABLED=1)
807+ add_definitions (-DDISPLAY_DRIVER_MIRROR)
807808else ()
808809 message (FATAL_ERROR "Invalid TARGET_DEVICE" )
809810endif ()
Original file line number Diff line number Diff line change @@ -21,7 +21,10 @@ void St7789::Init() {
2121 MemoryDataAccessControl ();
2222 ColumnAddressSet ();
2323 RowAddressSet ();
24+ // P8B Mirrored version does not need display inversion.
25+ #ifndef DISPLAY_DRIVER_MIRROR
2426 DisplayInversionOn ();
27+ #endif
2528 NormalModeOn ();
2629 SetVdv ();
2730 DisplayOn ();
@@ -62,7 +65,12 @@ void St7789::ColMod() {
6265
6366void St7789::MemoryDataAccessControl () {
6467 WriteCommand (static_cast <uint8_t >(Commands::MemoryDataAccessControl));
68+ // P8B Mirrored version sets MX bit high in MADCTL register to flip about vertical axis.
69+ #ifdef DISPLAY_DRIVER_MIRROR
70+ WriteData (0x40 ); // MY(0) MX(1) MV(0) ML(0) RGB(0) 0 0 0
71+ #else
6572 WriteData (0x00 );
73+ #endif
6674}
6775
6876void St7789::ColumnAddressSet () {
You can’t perform that action at this time.
0 commit comments