Skip to content

Instantly share code, notes, and snippets.

View bnewbold's full-sized avatar

bnewbold

View GitHub Profile
@bnewbold
bnewbold / test-session.cpp
Created April 26, 2010 23:35
Interactive Hardware Test Session for Maple
/*
Interactive Hardware Test Session for Maple
Connect via Serial2 (header pins D0 and D1 on the Maple) and press
'h' for a list of options.
To use this in a sketch, remove all the #includes and the function prototypes.
Created 22 April 2010
By Bryan Newbold for LeafLabs
@bnewbold
bnewbold / overclock.cpp
Created May 20, 2010 03:05
Maple overclocking hack
// Overclocking demo, written 05/19/2010 by bnewbold for leaflabs
// THIS COULD BRICK YOUR BOARD! OVERCLOCKING IS A HACK NOT A FEATURE!
// This code is in the public domain for all intents and purposes.
// Intended for use with libmaple on a Maple board. Concept from Thomas
// Jespersen: http://elec.tkjweb.dk/blog/2010/02/stm32-overclocking/
#include "wirish.h"
#include "usb.h"
#include "rcc.h"
@bnewbold
bnewbold / strobelab-pressure.cpp
Created May 20, 2010 04:57
Strobe lab pressure range detection
#include "wirish.h"
#include "HardwareSerial.h"
#include "HardwareUsb.h"
#include "usb.h"
#define LED_PIN 13
#define AIN_PIN 20
#define CUTOFF1 3000 // 2/3.3 * 4096
#define CUTOFF2 3350 // 2/3.3 * 4096
@bnewbold
bnewbold / serialize_bench_recurse.py
Created December 1, 2011 22:04
Recursive Python Serialization Benchmarks
import time
import cPickle as pickle
import simplejson
import json
import cjson
a = {
'foo': 'bar',
'food': range(10),
'good': ['a', 2.45, True],
@bnewbold
bnewbold / audioshield_comb.pde
Last active December 12, 2015 07:08
From http://code.google.com/p/leaflabs/issues/detail?id=7 Reported by Okie "PWM outputs are always zero on 0.0.8 on windows xp on my computer. everything is fine with 0.0.6."
#define AIN1 18
#define AIN2 19
#define AOUT1 6
#define AOUT2 7
#define POT1 16
#define POT2 17
#define SAMPLETIME 10 // in microseconds
#define KNOBSAMPLETIME 21
#define SYSTICK_CSR 0xE000E010
@bnewbold
bnewbold / Pin.pde
Created February 7, 2013 21:53
From http://code.google.com/p/leaflabs/issues/detail?id=70 autoformat chokes, gui seems dead until an exception brings it back to life What steps will reproduce the problem? 1.autoformat the attached code
class Pin {
uint8 pin;
public:
Pin(uint8 pin,WiringPinMode mode):
pin(pin){
pinMode(pin,mode);
}
operator bool (void)const{
@bnewbold
bnewbold / makefile.patch
Created February 7, 2013 21:55
libmaple - missing interrupt vectors in table for high density devices
*** ./support/ld/libcs3_stm32_src/Makefile.bak 2012-01-18 11:06:14.346230175 -0500
--- ./support/ld/libcs3_stm32_src/Makefile 2012-01-18 11:13:54.546105380 -0500
***************
*** 24,29 ****
--- 24,30 ----
$(AR) $(ARFLAGS) libcs3_stm32_med_density.a $(LIB_OBJS)
rm -f $(LIB_OBJS)
+ high-density: ASFLAGS := -DSTM32_HIGH_DENSITY
high-density: CFLAGS := -DSTM32_HIGH_DENSITY

Keybase proof

I hereby claim:

  • I am bnewbold on github.
  • I am bnewbold (https://keybase.io/bnewbold) on keybase.
  • I have a public key whose fingerprint is 3F46 8108 EE58 663C B95A E9DC 0C93 37BC EC39 32B9

To claim this, I am signing this object:

@bnewbold
bnewbold / xrep_test.c
Created April 3, 2015 19:22
nanomsg xrep_test.c
/*
* nanomsg "XREP" RAW REQ/REP header handling test.
*
* Terminal #1:
* gcc xrep_test.c -o xrep_test -Wall -lnanomsg
* ./xrep_test
*
* Terminal #2:
* nn_req -l 5555 --ascii --data "ping"
*/
TTY/Serial Scalability Protocol Transport
==========================================
This document describes a new transport for the Scalability Protocols (SP). The
Scalability Protocols (as implemented in the nanomsg library) specify
lightweight protocols for common message-passing patterns in distributed
systems. They are specifically desgined to accomodate both new message types
and new message transports (as well as being completely agnostic to the content
or encoding of all messages).