@@ -143,7 +143,7 @@ def power_up(self) -> None:
143
143
# driver output control
144
144
self .command (
145
145
_SSD1681_DRIVER_CONTROL ,
146
- bytearray ([self ._width - 1 , (self ._width - 1 ) >> 8 , 0x00 ]),
146
+ bytearray ([( self ._width - 1 ) & 0xFF , (self ._width - 1 ) >> 8 , 0x00 ]),
147
147
)
148
148
# data entry mode
149
149
self .command (_SSD1681_DATA_MODE , bytearray ([0x03 ]))
@@ -152,7 +152,7 @@ def power_up(self) -> None:
152
152
# Set ram Y start/end postion
153
153
self .command (
154
154
_SSD1681_SET_RAMYPOS ,
155
- bytearray ([0 , 0 , self ._height - 1 , (self ._height - 1 ) >> 8 ]),
155
+ bytearray ([0 , 0 , ( self ._height - 1 ) & 0xFF , (self ._height - 1 ) >> 8 ]),
156
156
)
157
157
# Set border waveform
158
158
self .command (_SSD1681_WRITE_BORDER , bytearray ([0x05 ]))
@@ -190,4 +190,4 @@ def set_ram_address(self, x: int, y: int) -> None: # noqa: PLR6301, F841
190
190
# Set RAM X address counter
191
191
self .command (_SSD1681_SET_RAMXCOUNT , bytearray ([x ]))
192
192
# Set RAM Y address counter
193
- self .command (_SSD1681_SET_RAMYCOUNT , bytearray ([y , y >> 8 ]))
193
+ self .command (_SSD1681_SET_RAMYCOUNT , bytearray ([y & 0xFF , y >> 8 ]))
0 commit comments