Skip to content

Instantly share code, notes, and snippets.

View jepler's full-sized avatar

Jeff Epler jepler

View GitHub Profile
(gdb) where
#0 dma_transfer_status (channel_number=channel_number@entry=4 '\004') at peripherals/samd/samd51/dma.c:88
#1 0x0002bb5c in shared_dma_transfer (peripheral=0x40003400, buffer_out=buffer_out@entry=0x0, dest=<optimized out>,
src=0x40003428, buffer_in=<optimized out>,
buffer_in@entry=0x20016734 "g\005\236\247\034\177`\263\207R\373M\224\356M̻\254\363\025\304\341n|\310\356mā\326`\312\n\034E\202\307\346\331e,\026_Z4q\230\232u\243\206\234\343z\021\253iT\241\355S\214\242\227\264\204c.d\224\240\346\267g\337x3\236\341\070C\033\204\342\034T)֡\224cpت\274\364\235w,3\257F\235I\252P\251Eը\241[\235RU\251M\316\061i\335$~\327x#C\360\367\204\374\177\247\353:\274s\352'@\274\067\313\f^T\357-̈́Ō3K\031\211\374\243z\200J#td*H\371\205}\r\256~Ԟ\"\361\066\245\026\265\341++\353\037\025G\243\334\351)u\242k\277\020\255/4\210"..., length=<optimized out>, length@entry=512, tx=<optimized out>) at peripherals/samd/dma.c:206
#2 0x0002bc82 in sercom_dma_read (sercom=<optimized out>,
buffer=buffer@entry=0x20016734 "g\
linuxcnc@linuxcnc:~ $ halrun -I sserial.hal
Note: Using POSIX realtime
hm2: loading Mesa HostMot2 driver version 0.15
hm2/hm2_7c81.0: Smart Serial Firmware Version 43
Board hm2_7c81.0.7i73.0.0 Hardware Mode 0 = nokeyboardnodisplay
Board hm2_7c81.0.7i73.0.0 Software Mode 0 = inputoutputencoder
Board hm2_7c81.0.7i73.0.0 Software Mode 1 = inputoutputencoderanalog
Board hm2_7c81.0.7i73.0.0 Software Mode 2 = inputoutputencoderanalog
Board hm2_7c81.0.7i73.0.0 Hardware Mode 1 = nokeyboarddisplay
Board hm2_7c81.0.7i73.0.0 Software Mode 0 = inputoutputencoderdisplay
$ halrun -I eth_sserial.hal
detect_env_override (nil) []
Note: Using POSIX non-realtime
hm2: loading Mesa HostMot2 driver version 0.15
hm2_eth: loading Mesa AnyIO HostMot2 ethernet driver version 0.2
hm2_eth: 192.168.1.121: Hardware address: 00:60:1b:10:00:fe
hm2_eth: discovered 7I92
hm2/hm2_7i92.0: Low Level init 0.15
hm2/hm2_7i92.0: Smart Serial Firmware Version 43
Board hm2_7i92.0.7i73.0.0 Hardware Mode 0 = nokeyboardnodisplay
log_levels = {}
def function_name_dirty(fn):
"""This function works around a CircuitPython limitation where 'closure'
functions do not have '__name__' properties. It depends on
implementation details of CircuitPython and might not work properly on
all versions. It was tested against 5.0.0-beta0"""
def inner():
# This function exists merely so that we can refer to its type,
# which is "<class 'closure'>". It is never called.
num_pixels = const(96)
@micropython.asm_thumb
def vfill(r0, r1, r2):
# r0 = length in words
# r1 = base pointer
# r2 = value
label(loop)
cmp(r0, 0)
import collections
import base64
import cgi
import json
from io import BytesIO
import subprocess
def respond(err, res=None, headers=None):
if isinstance(res, bytes):
return {
import gc
import adafruit_display_text.label
import board
import displayio
import terminalio
gc.collect()
m0 = gc.mem_free()
def mem_info(k):
start 32
l# 0 528
l# 1 448
l# 2 448
l# 3 448
l# 4 464
l# 5 448
l# 6 448
l# 7 448
l# 8 480
import displayio
class GridLabel(displayio.TileGrid):
def __init__(self, font, *, text="", color=0xffffff,
width=None, height=None, **kwargs):
if not text and not (width and height):
raise RuntimeError("Provide width and height or initial text")
cwidth, cheight = self.calc_size(text)
width = width or cwidth
height = height or cheight
@jepler
jepler / code.py
Last active February 1, 2020 20:00
#
# Display a "witty" slogan using GridLabel
# Use color cycling to make it a bit more interesting
#
import board
import displayio
import gridlabel
import terminalio
import time