Skip to content

Commit

Permalink
Merge branch 'Allen-Synthesis:main' into poly_square
Browse files Browse the repository at this point in the history
  • Loading branch information
t-schreibs authored May 18, 2022
2 parents 8f1b10b + f2b8cff commit 0b76fe9
Show file tree
Hide file tree
Showing 5 changed files with 28 additions and 9 deletions.
12 changes: 6 additions & 6 deletions software/contrib/cvecorder.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@
import json
import gc
import os
#import framebuf
import micropython
import framebuf

'''
CVecorder
Expand Down Expand Up @@ -86,7 +87,7 @@ def __init__(self):

# Test routine, pick a random bank n times and save, then load the state
if self.initTest:
#print(micropython.mem_info("level"))
print(micropython.mem_info("level"))
for n in range(3000):
# Clear vars
#self.CvRecording = []
Expand Down Expand Up @@ -271,7 +272,7 @@ def saveState(self):
print(f'[{attempts}] Error: Memory allocation failed, retrying: {e}')
if self.debugLogging:
self.writeToDebugLog(f"[saveState] Error: Memory allocation failed, retrying: {e}")
#print(micropython.mem_info("level"))
print(micropython.mem_info("level"))
else:
pass

Expand Down Expand Up @@ -430,9 +431,8 @@ def writeToDebugLog(self, msg):
def showLoadingScreen(self):
# push the bytearray of the Rpi logo into a 32 x 32 framebuffer, then show on the screen

# framebuf stuff commented out until we have framebuf testing built
# buffer = bytearray(b"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00|?\x00\x01\x86@\x80\x01\x01\x80\x80\x01\x11\x88\x80\x01\x05\xa0\x80\x00\x83\xc1\x00\x00C\xe3\x00\x00~\xfc\x00\x00L'\x00\x00\x9c\x11\x00\x00\xbf\xfd\x00\x00\xe1\x87\x00\x01\xc1\x83\x80\x02A\x82@\x02A\x82@\x02\xc1\xc2@\x02\xf6>\xc0\x01\xfc=\x80\x01\x18\x18\x80\x01\x88\x10\x80\x00\x8c!\x00\x00\x87\xf1\x00\x00\x7f\xf6\x00\x008\x1c\x00\x00\x0c \x00\x00\x03\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00")
# fb = framebuf.FrameBuffer(buffer, 32, 32, framebuf.MONO_HLSB)
buffer = bytearray(b"\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00|?\x00\x01\x86@\x80\x01\x01\x80\x80\x01\x11\x88\x80\x01\x05\xa0\x80\x00\x83\xc1\x00\x00C\xe3\x00\x00~\xfc\x00\x00L'\x00\x00\x9c\x11\x00\x00\xbf\xfd\x00\x00\xe1\x87\x00\x01\xc1\x83\x80\x02A\x82@\x02A\x82@\x02\xc1\xc2@\x02\xf6>\xc0\x01\xfc=\x80\x01\x18\x18\x80\x01\x88\x10\x80\x00\x8c!\x00\x00\x87\xf1\x00\x00\x7f\xf6\x00\x008\x1c\x00\x00\x0c \x00\x00\x03\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00")
fb = framebuf.FrameBuffer(buffer, 32, 32, framebuf.MONO_HLSB)
oled.fill(0)
#oled.blit(fb, 0,0)
oled.text('Loading...', 40, 12, 1)
Expand Down
6 changes: 3 additions & 3 deletions software/firmware/europi.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
Will set the CV output 3 to a voltage of 4.5V.
"""
import sys
import time

from machine import ADC
Expand All @@ -22,10 +23,9 @@

from ssd1306 import SSD1306_I2C

try:
import micropython
if sys.implementation.name == "micropython":
TEST_ENV = False # We're in micropython, so we can assume access to real hardware
except ModuleNotFoundError:
else:
TEST_ENV = True # This var is set when we don't have any real hardware, for example in a test or doc generation setting

try:
Expand Down
3 changes: 3 additions & 0 deletions software/tests/mocks/framebuf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@

class FrameBuffer:
pass
Empty file.
16 changes: 16 additions & 0 deletions software/tests/mocks/rp2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import functools

class PIO:
OUT_LOW = 0

class StateMachine:
pass


def asm_pio(**kwargs):
def decorator(func):
@functools.wraps(func)
def wrapper(*args, **kwargs):
pass
return wrapper
return decorator

0 comments on commit 0b76fe9

Please sign in to comment.