@@ -67,7 +67,7 @@ def color565(r, g=0, b=0):
67
67
return (r & 0xf8 ) << 8 | (g & 0xfc ) << 3 | b >> 3
68
68
#pylint: enable-msg=invalid-name
69
69
70
- class RA8875_Device (object ):
70
+ class RA8875_Device ():
71
71
"""
72
72
Base Class for the Display. Contains all the low level stuff. As well
73
73
as the touch functions. Valid display sizes are currently 800x480 and 480x272.
@@ -276,7 +276,7 @@ def turn_on(self, display_on):
276
276
:param bool start_on: If the display should turn on or off
277
277
"""
278
278
self ._write_reg (reg .PWRR , reg .PWRR_NORMAL |
279
- (reg .PWRR_DISPON if display_on else reg .PWRR_DISPOFF ))
279
+ (reg .PWRR_DISPON if display_on else reg .PWRR_DISPOFF ))
280
280
281
281
def reset (self ):
282
282
"""Perform a hard reset"""
@@ -297,7 +297,8 @@ def sleep(self, sleep):
297
297
298
298
:param bool sleep: Should we enable sleep mode
299
299
"""
300
- self ._write_reg (reg .PWRR , reg .PWRR_DISPOFF if sleep else (reg .PWRR_DISPOFF | reg .PWRR_SLEEP ))
300
+ self ._write_reg (reg .PWRR ,
301
+ reg .PWRR_DISPOFF if sleep else (reg .PWRR_DISPOFF | reg .PWRR_SLEEP ))
301
302
302
303
def _gpiox (self , gpio_on ):
303
304
"""Enable or Disable the RA8875 GPIOs"""
@@ -341,7 +342,7 @@ def touch_enable(self, touch_on):
341
342
"""
342
343
if touch_on :
343
344
self ._write_reg (reg .TPCR0 , reg .TPCR0_ENABLE | reg .TPCR0_WAIT_4096CLK |
344
- reg .TPCR0_WAKEENABLE | self ._adc_clk )
345
+ reg .TPCR0_WAKEENABLE | self ._adc_clk )
345
346
self ._write_reg (reg .TPCR1 , reg .TPCR1_AUTO | reg .TPCR1_DEBOUNCE )
346
347
self ._write_data (self ._read_reg (reg .INTC1 ) | reg .INTC1_TP )
347
348
else :
@@ -360,7 +361,7 @@ def touched(self):
360
361
self ._gfx_mode () # Hack that seems to work
361
362
if self ._tpin .value :
362
363
return False
363
- istouched = True if self ._read_reg (reg .INTC2 ) & reg .INTC2_TP else False
364
+ istouched = self ._read_reg (reg .INTC2 ) & reg .INTC2_TP
364
365
return istouched
365
366
366
367
def touch_read (self ):
0 commit comments