Skip to content

Instantly share code, notes, and snippets.

View PyroAVR's full-sized avatar

Andy PyroAVR

View GitHub Profile
@PyroAVR
PyroAVR / libwdi-parent_id-v1.5.0.patch
Last active November 2, 2023 19:41
libwdi parent_id patch
diff --git a/libwdi/libwdi.c b/libwdi/libwdi.c
index 0bd1296..2c2b072 100644
--- a/libwdi/libwdi.c
+++ b/libwdi/libwdi.c
@@ -25,6 +25,7 @@
#include <crtdbg.h>
#endif
+#include <initguid.h>
#include <windows.h>
@PyroAVR
PyroAVR / select_interactive.py
Created December 4, 2021 19:12
Interactive fuzzy select feat. FZF
from __future__ import annotations
from subprocess import Popen, PIPE
import sys
def select_i(choices: List[str], multi:bool=False) -> (List[int], List[str]):
"""
Interactively select from a list of choices, returning the selections
and their indices in the original list of choices.
"""
stdin_data = '\n'.join(choices).encode('utf-8')
@PyroAVR
PyroAVR / quotes.txt
Created March 19, 2021 20:49
it's going in the report
the gradients are gone bro, they left
"initialization game"
"probable uncertainty"
@PyroAVR
PyroAVR / cam_plot.py
Last active December 4, 2021 19:14
bogus plotting script for IDE / Freescale cup car (replaces matlab script)
import numpy as np
import matplotlib.pyplot as plt
import serial
plt.ion()
fig = plt.figure()
ax1 = fig.add_subplot(3, 1, 1)
ax2 = fig.add_subplot(3, 1, 2)
ax3 = fig.add_subplot(3, 1, 3)
@PyroAVR
PyroAVR / hardfault_handler.c
Created August 28, 2020 15:35
Hardfault handler that blinks SOS on red LED for FRDM-K64 boards.
// Hardfault handler and setup functions for error reporting.
#include <MK64F12.h>
#define __GPIO_CLEAR(thing) thing->PCOR
#define __GPIO_SET(thing) thing->PSOR
#define SET_LED(base, which) do { __GPIO_CLEAR(GPIO##base) |= (1 << which); } while(0)
#define CLEAR_LED(base, which) do { __GPIO_SET(GPIO##base) |= (1 << which); } while(0)
#if CLOCK_SETUP == 1
#undef DEFAULT_SYSTEM_CLOCK
#define DEFAULT_SYSTEM_CLOCK (SystemCoreClock >> 3)
@PyroAVR
PyroAVR / Makefile
Created April 9, 2020 03:14
GHDL makefile with xilinx ip support
# setup variables
src := src
out := build
test := test
ip := lab_uart.srcs/sources_1/ip
std := 93
search_dirs := ../unisim_ghdl/xilinx-vivado/unisim/v93 ../unisim_ghdl/xilinx-vivado/secureip/v93
# source lists
main_sources := math uart_rx uart_tx axi_tx axi_rx baudgen uart
@PyroAVR
PyroAVR / brot.py
Last active June 8, 2017 01:23
draw stuff
import numpy as np
def print_palette(M, m, v):
pass
def scale(r1, r2, v):
left = r1[1] - r1[0]
right = r2[1] - r2[0]
scaled = float(v - r1[0]) / float(left)
@PyroAVR
PyroAVR / ComplexData.hpp
Last active February 24, 2021 00:32
SO Question: OpenCV frame corruption
#pragma once
struct video_handshake {
int rows, cols, cvtype, cvstep;
};
@PyroAVR
PyroAVR / supertouchplate-rev2.stl
Last active February 21, 2016 21:00
Touchplate designs
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@PyroAVR
PyroAVR / SuperTouchPlate.json
Created February 19, 2016 23:17
A 3-D touchplate made for Three.js
{
"metadata": {
"version": 4.4,
"type": "Object",
"generator": "Object3D.toJSON"
},
"geometries": [
{
"uuid": "0A9F7777-88C8-41A1-964E-FBFA30EA265E",
"type": "BoxGeometry",