Skip to content

Commit

Permalink
modify
Browse files Browse the repository at this point in the history
  • Loading branch information
hishizuka committed Jun 30, 2024
1 parent f913f64 commit 7a2759b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 19 deletions.
22 changes: 4 additions & 18 deletions modules/display/mip_display_mraa.py
Original file line number Diff line number Diff line change
@@ -1,30 +1,20 @@
import time

import asyncio
import numpy as np
from .mip_display_base import MipDisplayBase

from logger import app_logger
from .display_core import Display

_SENSOR_DISPLAY = False
MODE = "Python"
try:
import mraa

_SENSOR_DISPLAY = True

#import pyximport
#pyximport.install()
#from .cython.mip_helper import conv_3bit_color

#MODE = "Cython"
except ImportError:
pass

app_logger.info(f"MIP_Mraa DISPLAY: {_SENSOR_DISPLAY}")
if _SENSOR_DISPLAY:
app_logger.info(f"MIP DISPLAY(mraa): {_SENSOR_DISPLAY}")


class MipDisplayMraa(Display):
class MipDisplayMraa(MipDisplayBase):

# GPIO.BCM
DISP = 13
Expand All @@ -42,10 +32,6 @@ def __init__(self, config, size=None, color=None):
self.conv_color = self.conv_3bit_color_py
if self.color == 64:
self.conv_color = self.conv_4bit_color_py

#######################
if self.color == 2:
self.update(self.pre_img[:, 2:], direct_update=True)

def init_spi(self):
self.spi = mraa.Spi(1)
Expand Down
3 changes: 2 additions & 1 deletion modules/display/mip_display_pigpio.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@
except ImportError:
pass

app_logger.info(f"MIP DISPLAY: {_SENSOR_DISPLAY}")
if _SENSOR_DISPLAY:
app_logger.info(f"MIP DISPLAY(pigpio): {_SENSOR_DISPLAY}")


class MipDisplayPigpio(MipDisplayBase):
Expand Down

0 comments on commit 7a2759b

Please sign in to comment.