Skip to content

Instantly share code, notes, and snippets.

View jepler's full-sized avatar

Jeff Epler jepler

View GitHub Profile
From 5b3d37f6f19e951e412a921b877b61eb57e76668 Mon Sep 17 00:00:00 2001
From: Jeff Epler <jepler@gmail.com>
Date: Mon, 19 Feb 2024 13:25:38 -0600
Subject: [PATCH] espressif: add a script to check for incompatibilities...
betweek sdkconfig and circuitpython. For now there's a single check,
for CIRCUITPY_STORAGE_EXTEND & CIRCUITPY_DUALBANK that require
there to be an ota_1 partition.
---
ports/espressif/Makefile | 7 ++++-
import time
import datetime
import pyvisa
import rigol1000z
rm = pyvisa.ResourceManager()
osc_resource = rm.open_resource("USB0::6833::1230::DS1ZD194301173::0::INSTR")
osc = rigol1000z.Rigol1000z(osc_resource)
while True:
Bus 001 Device 104: ID 239a:8118 Adafruit Camera
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
Bus 001 Device 093: ID 239a:8118 Adafruit Camera
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
#define ROLL_R(x, n) ({ typeof(x) tmp = x; (tmp >> n) | (tmp << (32-n)); })
unsigned bcd_next(unsigned n) {
n = n + 1;
for(unsigned i=0; i<5; i++) {
if ((n & 0xf) == 0xa) {
n += 0x6;
}
n = ROLL_R(n, 4);
Bus 001 Device 067: ID 239a:8108 Adafruit Macropad RP2040
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
Frame 466: 8768 bytes on wire (70144 bits), 8768 bytes captured (70144 bits) on interface usbmon1, id 0
Section number: 1
Interface id: 0 (usbmon1)
Encapsulation type: USB packets with Linux header and padding (115)
Arrival Time: Jan 21, 2024 12:53:45.304074000 CST
[Time shift for this packet: 0.000000000 seconds]
Epoch Time: 1705863225.304074000 seconds
[Time delta from previous captured frame: 0.032027000 seconds]
[Time delta from previous displayed frame: 0.032027000 seconds]
[Time since reference or first frame: 8.051458000 seconds]
Bus 001 Device 066: ID 239a:8108 Adafruit Macropad RP2040
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 2.00
bDeviceClass 0
bDeviceSubClass 0
bDeviceProtocol 0
bMaxPacketSize0 64
// build with arm-non-eabi-g++ -std=c++20
#include <type_traits>
#include <array>
#include <stdio.h>
constexpr int decimal_to_bcd(int x) {
int scale = 1;
int result = 0;
for(size_t i = 0; i<5; i++) {
#!/usr/bin/python
import pulsectl
def default_source(pulse):
default_source_name = pulse.server_info().default_source_name
for source in pulse.source_list():
if source.name == default_source_name:
return source