Skip to content

Commit

Permalink
🚸 (video): Set screen in correct orientation
Browse files Browse the repository at this point in the history
  • Loading branch information
YannLocatelli authored and ladislas committed Mar 15, 2022
1 parent e7ad0b7 commit b07dabd
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
6 changes: 3 additions & 3 deletions drivers/CoreVideo/source/CoreLCDDriverOTM8009A.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,11 +273,11 @@ void CoreLCDDriverOTM8009A::setLandscapeOrientation()

std::byte _settings {0x00};

auto set_vertical_symmetry = [&]() constexpr { _settings |= std::byte {1 << 7}; };
auto set_landscape_mode = [&]() constexpr { _settings |= std::byte {1 << 5}; };
auto set_landscape_mode = [&]() constexpr { _settings |= std::byte {1 << 5}; };
auto set_horizontal_symmetry = [&]() constexpr { _settings |= std::byte {1 << 6}; };

set_vertical_symmetry();
set_landscape_mode();
set_horizontal_symmetry();

return std::to_integer<uint8_t>(_settings);
};
Expand Down
8 changes: 7 additions & 1 deletion drivers/CoreVideo/tests/CoreLCDDriverOTM8009A_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,13 @@ TEST_F(CoreOTM8009ATest, initialize)

TEST_F(CoreOTM8009ATest, setLandscapeOrientation)
{
auto expected_instruction_array = ElementsAre(lcd::otm8009a::madctr::command, 0xA0);
auto _settings = uint8_t {0x00};
auto set_landscape_mode = [&] { _settings |= (1 << 5); };
auto set_horizontal_symmetry = [&] { _settings |= (1 << 6); };
set_landscape_mode();
set_horizontal_symmetry();

auto expected_instruction_array = ElementsAre(lcd::otm8009a::madctr::command, _settings);
auto expected_set_address_for_column_array =
ElementsAre(0x00, 0x00, 0x03, 0x1F, lcd::otm8009a::set_address::for_column::command);
auto expected_set_address_for_page_array =
Expand Down

0 comments on commit b07dabd

Please sign in to comment.