Skip to content

Instantly share code, notes, and snippets.

View amcjen's full-sized avatar

Allison Clift-Jennings amcjen

View GitHub Profile
/**
* \file at86rf212.h
*
* \brief AT86RF212 registers description and interface
*
* Copyright (C) 2012 Atmel Corporation. All rights reserved.
*
* \asf_license_start
*
* Redistribution and use in source and binary forms, with or without
@amcjen
amcjen / gist:d6b56e7111ed51db81ba
Created April 30, 2014 01:10
atmega128rfa1.h
/**
* \file atmega128rfa1.h
*
* \brief ATMEGA128RFA1 registers description
*
* Copyright (C) 2012 Atmel Corporation. All rights reserved.
*
* \asf_license_start
*
* Redistribution and use in source and binary forms, with or without
@amcjen
amcjen / gist:5c004c41280ae9adb6d9
Last active August 29, 2015 14:00
atmega128rfa1/phy.h
/**
* \file phy.h
*
* \brief ATMEGA128RFA1 PHY interface
*
* Copyright (C) 2012 Atmel Corporation. All rights reserved.
*
* \asf_license_start
*
* Redistribution and use in source and binary forms, with or without
@amcjen
amcjen / gist:76a43b5dd53cfc2171a7
Last active August 29, 2015 14:00
at86rf212/phy.h
/**
* \file phy.h
*
* \brief AT86RF212 PHY interface
*
* Copyright (C) 2012 Atmel Corporation. All rights reserved.
*
* \asf_license_start
*
* Redistribution and use in source and binary forms, with or without
char buf[128];
uint32_t time = millis();
int i;
int timeout = 3000;
while (millis() - time < timeout) {
if (Serial.available() > 0) {
buf[i] = Serial.read();
Serial1.write(buf[i]);
if (i > 0 && buf[i-1] == '>' && buf[i] == ' ') {
static void digitalPinEventHandler(uint8_t pin, int8_t value, int8_t mode) {
uint32_t time = millis();
char buf[32];
if (findscript("event.digital")) {
String callback = "event.digital(" + String(pin) + "," + String(value) + "," + String(mode) + ")";
callback.toCharArray(buf, callback.length() + 1);
int ret1 = doCommand(buf);
}
report.appendSprintf("[%d,[%d,%d],[\"%s\",%s]]",
keyMap("custom", 0),
keyMap("name", 0),
keyMap("custom", 0),
name,
getstringarg(2));
var serialport = require('serialport');
var bindexof = require('buffer-indexof');
var ready = new Buffer("> ");
function die(err)
{
console.log(err);
process.exit(1);
}
void prompt(void) {
char buf[IDLEN+1];
#if defined(TINY_BUILD)
msgp(M_prompt);
#else
// Run the script named "prompt" if there is one else print "> "
strncpy_P(buf, getmsg(M_promptid), IDLEN); // get the name "prompt" in our cmd buf
if (findscript(buf)) doCommand(buf);
else msgp(M_prompt); // else print default prompt
/////////////////////////////
//
// runBitlash
//
// This is the main entry point where the main loop gives Bitlash cycles
// Call this frequently from loop()
//
void runBitlash(void) {
// Pipe the serial input into the command handler. Read up to 12