Skip to content

Instantly share code, notes, and snippets.

View triffid's full-sized avatar

Michael Moon triffid

View GitHub Profile
@triffid
triffid / pin.patch
Created January 31, 2014 01:07
smoothie: bitbanded gpio
diff --git a/src/libs/Pin.cpp b/src/libs/Pin.cpp
index bc234d2..3190935 100644
--- a/src/libs/Pin.cpp
+++ b/src/libs/Pin.cpp
@@ -4,6 +4,7 @@
Pin::Pin(){
this->inverting= false;
+ bitband = NULL;
}
#include <cstdio>
void foo(const int * const ptr)
{
printf("%d\n", *ptr);
};
int bar(void)
{
int i = 123;
@triffid
triffid / test_latency.patch
Created February 7, 2014 01:03
aprinter test_latency fix
diff --git a/host_stuff/test_latency.py b/host_stuff/test_latency.py
index d1c3645..55e8054 100755
--- a/host_stuff/test_latency.py
+++ b/host_stuff/test_latency.py
@@ -4,6 +4,7 @@ from __future__ import print_function
import sys
import argparse
import time
+import re
import littlevent.close
@triffid
triffid / 0C- Crane.craft
Last active August 29, 2015 13:56
Extra Planetary Bootstrap
ship = 0C- Crane
version = 0.23.0
description = addcCCccccvvadaaeqeqdasdasadq w
type = VAB
PART
{
part = probeCoreCube_4293725204
partName = Part
pos = 0.2159832,3.508374,-0.03990517
rot = 0,0,0,1
@triffid
triffid / persistent.sfs
Created February 16, 2014 08:58
KSP persistence - EL debugging
This file has been truncated, but you can view the full file.
GAME
{
version = 0.23.0
Title = Lentil (CAREER)
Description = No description available.
Mode = 1
Status = 1
scene = 5
flag = Squad/Flags/kerbinmunflag
PARAMETERS
@triffid
triffid / involute_gear_2d.scad
Created February 11, 2015 02:31
openscad 2d involute gear
module gear_shape_2d (
number_of_teeth = 15,
circular_pitch = false, diametral_pitch = false,
pressure_angle = 28,
clearance = 0.2,
circles=0,
backlash=0,
involute_facets=0)
{
if (circular_pitch==false && diametral_pitch==false)
@triffid
triffid / bar-clamp.scad
Created March 5, 2012 11:53
Improved bar clamp for Prusa Mendel Reprap
wedge_width = 7.6;
m8_diam_tight = 8.2;
m8_diameter = 8.6;
wall_thickness = 3.3;
wedge_outer_angle = 2;
$fn=64;
module teardrop (r=8, h=20) {
@triffid
triffid / demo.txt
Created April 30, 2012 03:31
C++ USB for cortex-m3
USB u;
USBCDC uc;
USBMSC msc;
USBECM ecm;
UART dbg(UART0, 230400);
int main(void) {
dbg.send((uint8_t *) "start\n", 6);
@triffid
triffid / map.txt
Created May 24, 2012 10:26
netrap object model
Object Model for a netrap server, exposed via AJAX
server-server protocol may substitute a server object for TOP so tree-walk can be performed.
listPrintersWithCapabilities() is the major function to be implemented, this should also cause a broadcast amongst any server-server networks where all other functions are server-local
TOP
+- Printers[]
| +- Printer
| +- capabilities
@triffid
triffid / pymenu.py
Created June 18, 2012 13:16
python menu
import collections
def menu(items):
while 1:
for item in range(0, len(items)):
print "%d - %s" % (item + 1, items[item])
selection = raw_input("> ")
try:
selection = int(selection) + 1
if (selection >= 0) and (selection < len(items)):