Skip to content

Instantly share code, notes, and snippets.

View zignig's full-sized avatar
💭
RL(tm) getting in the way of good coding time.

Simon Kirkby zignig

💭
RL(tm) getting in the way of good coding time.
  • Perth Australia
View GitHub Profile
@zignig
zignig / ANSI.md
Created August 23, 2020 00:47 — forked from fnky/ANSI.md
ANSI Escape Codes

ANSI Escape Sequences

Standard escape codes are prefixed with Escape:

  • Ctrl-Key: ^[
  • Octal: \033
  • Unicode: \u001b
  • Hexadecimal: \x1b
  • Decimal: 27
from .registers import *
from boneless.arch.opcode import *
from boneless.arch.asm import Assembler
import pprint
from .uart import Serial
from .leds import Blinker
from .lister import register
@register
class Caller(Firmware):
def instr(self):
w = self.w
w.req(['value','counter'])
ll = LocalLabels()
r = Recurse()
return [
C('depth',3),
MOVI(w.value,1000),
@zignig
zignig / gist:b3615d48cf2d7e921026908d3e69933e
Created February 3, 2020 10:37
Boneless calling structure.
from registers import *
from boneless.arch.opcode import *
from boneless.arch.asm import Assembler
import pprint
class Adder(SubR):
def setup(self):
self.params = ["left", "right"]
self.ret = ["sum"]
class uLoader(Firmware):
def instr(self):
w = self.w
w.req("rx")
w.req("led_val")
w.req("led_next")
w.req("checksum")
# map the IO to all the Subroutines
SubR.io_map = FakeIO()
s = Serial()
### Keybase proof
I hereby claim:
  * I am zignig on github.
  * I am zignig (https://keybase.io/zignig) on keybase.
  * I have a public key ASC5el3uWhp-iugKuQRWSr0mKNdkX0ECMRHloQJqbXYMCwo
To claim this, I am signing this object: