Skip to content

Instantly share code, notes, and snippets.

View Harakan's full-sized avatar

Will Topping Harakan

  • Hacking on firmware for something
  • Saskatoon, SK - Canada
View GitHub Profile

Keybase proof

I hereby claim:

  • I am harakan on github.
  • I am willtopping (https://keybase.io/willtopping) on keybase.
  • I have a public key ASBWU24RS0KOpSVI7-kF2VVtS8nx1nIJnRGxbeyBPMQZGwo

To claim this, I am signing this object:

@Harakan
Harakan / transform.py
Created August 31, 2016 02:59
Transformer shifts center to 0 as Z approaches 0
import numpy as np
class LinearAlgebraTransformer():
def __init__(self, upper_height, lower_points, upper_points):
'''Given upper_height as the offset to upper points,
<upper|lower>_points as a zippered array of (deflection,distance),
where each <distance|deflection> are given as (x,y)
This class creates a linear transform matrix that you can transform any size of inputs into.
top_mask=0xF0;
bot_mask=0x0F;
//You provide nibble_top and nibble_bot
the_byte = (nibble_top<<4)&top_mask;
the_byte |= (nibble_bot&bot_mask);
@Harakan
Harakan / Flagger.h
Last active March 11, 2016 22:56
why won't this work, m_flags doesn't work
#ifndef _FLAGGER_H
#define _FLAGGER_H
#include <stdint.h>
#define MAX_NUM_FLAGS 8
struct Flag_info{
uint8_t id;
uint16_t trig_count;
@Harakan
Harakan / callbackThings.cpp
Created March 10, 2016 17:49
julian... callback.... wats?
class Wrap
{
public:
virtual void printerStatusHandler(void* newMessage);
virtual void moveToDripCountHandler(void* newMessage);
};
struct Handler {
uint8_t typeId;
@Harakan
Harakan / Crazy_c_function_stars.c
Created February 2, 2016 21:14
is that a staticly defined function by function address?
#define BOOTLOADER_START_ADDR 0x1fffc400 //This may be c800
static uint32_t *bootloader_msp = (void *)BOOTLOADER_START_ADDR;
static void *(**bootloader)() = (void *)BOOTLOADER_START_ADDR + 4;
__set__MSP(*bootloader_msp); //set the stack pointer to the addr
(*bootloader)(); //Execute program at location bootloader
void Reset_Handler()
{
int *from = &_data_flash_start;
int *to = &_data_start;
while (to != &_data_end)
*(to++) = *(from++);
to = &_bss_start;
while (to != &_bss_end)
#!/usr/bin/python
import time
import os
import sys
sys.path.insert(0, os.path.join(os.path.dirname(__file__), '..', 'src'))
from peachyprinter.infrastructure.communicator import UsbPacketCommunicator
from peachyprinter.infrastructure.messages import *