Skip to content

Instantly share code, notes, and snippets.

View jepler's full-sized avatar
💭
I may be slow to respond.

Jeff Epler jepler

💭
I may be slow to respond.
View GitHub Profile
OW = 249;
OH = OW;
pin_dx = 41;
pin_dy = 55;
screw_dy = 45;
screw_dx = 56;
aperture = 128 - 24;
import time
import subprocess
import contextlib
@contextlib.contextmanager
def TerminatingPopen(*args, **kw):
p = subprocess.Popen(*args, **kw)
try:
yield p
finally:
--- fbmirror_scaled_tmp.py.orig 2025-02-10 09:27:49.407999983 -0600
+++ fbmirror_scaled_tmp.py 2025-02-10 15:21:41.577745068 -0600
@@ -47,11 +47,12 @@
@click.option("--x-offset", "xoffset", type=int, help="The x offset of top left corner of the region to mirror", default=0)
@click.option("--y-offset", "yoffset", type=int, help="The y offset of top left corner of the region to mirror", default=0)
@click.option("--scale", "scale", type=int, help="The scale factor to reduce the display down by.", default=3)
-@piomatter_click.standard_options
-def main(xoffset, yoffset, scale, width, height, serpentine, rotation, colorspace, pinout, n_planes, n_addr_lines):
+@piomatter_click.standard_options(colorspace=None)
+def main(xoffset, yoffset, scale, width, height, serpentine, rotation, pinout, n_planes, n_addr_lines):
diff --git a/ports/raspberrypi/common-hal/microcontroller/__init__.c b/ports/raspberrypi/common-hal/microcontroller/__init__.c
index 7911c21e3c..971c1db9ef 100644
--- a/ports/raspberrypi/common-hal/microcontroller/__init__.c
+++ b/ports/raspberrypi/common-hal/microcontroller/__init__.c
@@ -23,11 +23,13 @@
#include "src/rp2_common/hardware_sync/include/hardware/sync.h"
#include "hardware/watchdog.h"
+#include "hardware/irq.h"
#!/usr/bin/python3
"""
Do framebuffer magic
Run like this:
$ python hub85_fb.py
The upper left corner of the framebuffer is displayed until the user hits ctrl-c
"""
from __future__ import annotations
import functools
from typing import Callable, ParamSpec, TypeVar, Generic
P = ParamSpec("P")
T = TypeVar("T")
class Recur(BaseException, Generic[P, T]):
f: Callable[P, T] | None
./api/1912/thermostat.png: 179858 0.8404265261111734
./api/755/interdisciplinary.png: 95303 0.7915005647465285
./api/1405/meteor.png: 71947 0.8293602305475505
./api/1523/microdrones.png: 145557 0.7931397122929381
./api/1743/coffee.png: 164902 0.7928857517898614
./api/881/probability.png: 158659 0.8246309771309771
./api/211/hamster_ball_heist.png: 282321 0.7975169491525423
./api/1672/women_on_20s.png: 320098 0.761557860677579
./api/2114/launch_conditions.png: 168211 0.8643047990956736
./api/2194/how_to_send_a_file.png: 256603 0.8247691412665812
From 7188d09390183a4333562fcb6bba7f93b85d5ac4 Mon Sep 17 00:00:00 2001
From: Jeff Epler <[email protected]>
Date: Mon, 9 Dec 2024 18:06:17 -0600
Subject: [PATCH] proof of concept: mpy-cross -mno-long
This causes an OverflowError to be raised if an integer constant doesn't
fit on builds without long int support.
Hypothetically, circuitpython-build-tools could first run mpy-cross with
this flag; if it fails, put into some new metadata file "requires
# SPDX-FileCopyrightText: Copyright (c) 2024 Jeff Epler for Adafruit Industries LLC
#
# SPDX-License-Identifier: MIT
"""Work around the RP2350 E9 erratum by turning off input buffer
A silicon bug in the RP2350 "A2" stepping (the latest and only available version in
December 2024) prevents input pull-downs larger than about 8.2kOhm from working
properly, including the built-in pull down resistors.
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.common.exceptions import TimeoutException
# Configure Chrome options
options = Options()
options.add_argument("--headless")