Skip to content

Instantly share code, notes, and snippets.

@buserror
buserror / gist:3052259
Created Jul 5, 2012
devil fails to build on mountain lion
View gist:3052259
Follows "brew doctor" reported mismatch is because I have the mountain lion toolchain
installed (command line tools), but not the preliminary buggy xcode
---------------------------------------- brew doctor
Error: Your compilers are different from the standard versions for your Xcode.
If you have Xcode 4.3 or newer, you should install the Command Line Tools for
Xcode from within Xcode's Download preferences.
Otherwise, you should reinstall Xcode.
@buserror
buserror / gist:3129219
Created Jul 17, 2012
cortex-m4/stm32f4 longjmp/setjmp implementation with FPU store/restore
View gist:3129219
/*
* tested with gcc on an stm32f4
* Michel Pollet <buserror@gmail.com>
*/
#if defined(__VFP_FP__)
typedef long __jmp_buf[10 + 8 + 1]; // d8-d15 fpu + fpscr
#else
typedef long __jmp_buf[10];
#endif
@buserror
buserror / gist:7336713
Created Nov 6, 2013
quick compilation patch
View gist:7336713
From 3e76304ff29e91507aa275dfcdff77cab7109ae3 Mon Sep 17 00:00:00 2001
From: michel <michel@midesk.bsiuk.com>
Date: Wed, 6 Nov 2013 14:21:03 +0000
Subject: [PATCH] freetype-gl: fix on modern mesa
GL_TYPE is already taken, apparently
---
shared/libfreetype-gl/vertex-attribute.c | 20 ++++++++++----------
shared/libfreetype-gl/vertex-attribute.h | 26 +++++++++++++-------------
2 files changed, 23 insertions(+), 23 deletions(-)
@buserror
buserror / boxmaker.js
Created Nov 11, 2015
millcrum.com small test to generate boxes
View boxmaker.js
// examples/all_objects.millcrum - sample showing every basic object and operation
// create the tool options
// units: mm or inch
// diameter: tool diameter in mm or inch
// passDepth: depth to cut per pass in mm or inch, if a cut operation has a deeper depth then multiple passes will occur
// step: how far the bit should step for pocket operations, between 0 and 1 (full step)
// rapid: how fast the tool should move when it is not cutting
// plunge: how fast the tool should move down on the Z axis when cutting
// cut: how fast the tool should move on the X and Y axes when cutting
// zClearance: how high above the surface the tool should be when not cutting
@buserror
buserror / clock.c
Created Feb 2, 2017
protothreads, aka duff's device in use...
View clock.c
/*
*
* Ascii art http://www.network-science.de/ascii/ (font "mini")
*
* -Wall -g -Os -std=gnu99 -mcall-prologues -DF_CPU=8000000
* 8366 118 1373 9857 2681 atmega644_sure_led_clock.axf
*
* -mcall-prologues -fno-inline-small-functions \
* -ffunction-sections -fdata-sections \
* -Wl,--relax,--gc-sections \
View jit_code.c
static const void * jt[342] = {
[0x0000]= &&f0000,
[0x0001]= &&f0002,
[0x0002]= &&f0004,
[0x0003]= &&f0006,
[0x0004]= &&f0008,
[0x0005]= &&f000a,
[0x0006]= &&f000c,
[0x0007]= &&f000e,
[0x0008]= &&f0010,
View xxtea_test.c
/*
* make tea CFLAGS="-std=gnu99"
*
* ./tea "hello there how r You" -d "FOF5;?9#LDQ2'MAI\LT286+]\$63@Q;JG"
*
* XXTEA Encoder/decoder test program
* (C) Michel Pollet <buserror@gmail.com>
*/
#include <stdint.h>
#include <stdio.h>
@buserror
buserror / clocks.c
Last active May 17, 2018
proposal for the clock table
View clocks.c
struct rzn1_bitsel {
uint16_t sel;
uint16_t gate[2][5];
};
struct rzn1_gate {
uint16_t gate, reset, ready, midle,
scon, mirack, mistat;
};
@buserror
buserror / Compiler Abuse
Created Dec 31, 2019
On a G4, the pipelining was crucial. And on a 8 channel 24 bits (well 32) audio path, it was even more so.
View Compiler Abuse
/*
* Clip_48_8.cpp
* EZ8AudioDriver
*
* Created by Michel on Sun Oct 06 2002.
* Copyright (c) 2002 __MyCompanyName__. All rights reserved.
*
*/
#include <libkern/OSTypes.h>
View fpmake.c
#!/usr/bin/tcc -run
/*
* ^^ If you don't know tcc, you should.
*
* This program is a wrapper around make(1), it parses recursive make
* output and try to generate valid pathnames for errors generated by
* the compiler for relative pathnames.
* It keep tracks (well it tries to) of parallel make jobs and try to
* look in the directory for all the running jobs for a matching
* pathnames, then doctor the error message with the 'real' pathname.