View gist:9040807
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I want to make better tools for electronics makers and hobbyists, and I want you | |
to help me do it. | |
About a year ago, I was working on a project with a power supply I needed to | |
test, and I designed the original Re:load. As it happens, I'm not the only one | |
that needed one, and the Re:load became my first commercial product, and led to | |
the formation of Arachnid Labs. The Re:load's hugely popular with anyone who | |
needs to test a power supply, check battery life or discharge rates, or anything | |
else that requires a steady current source - especially if they don't have | |
thousands of dollars to throw at expensive lab equipment. |
View Bootloader.map
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Archive member included because of file (symbol) | |
.\CortexM0\ARM_GCC_473\Release\Bootloader.a(cyfitter_cfg.o) | |
.\CortexM0\ARM_GCC_473\Release\Cm0Start.o (cyfitter_cfg) | |
.\CortexM0\ARM_GCC_473\Release\Bootloader.a(Bootloader.o) | |
.\CortexM0\ARM_GCC_473\Release\Cm0Start.o (CyBtldr_CheckLaunch) | |
.\CortexM0\ARM_GCC_473\Release\Bootloader.a(UART.o) | |
.\CortexM0\ARM_GCC_473\Release\main.o (UART_Start) | |
.\CortexM0\ARM_GCC_473\Release\Bootloader.a(UART_SPI_UART.o) | |
.\CortexM0\ARM_GCC_473\Release\main.o (UART_SpiUartGetRxBufferSize) |
View gist:cb86b6a2a50620a7792f
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
>>> struct.pack("B", 0x38) + struct.pack("H", 0) | |
'8\x00\x00' | |
>>> struct.pack("BH", 0x38, 0) | |
'8\x00\x00\x00' |
View gist:ef2abaf78e600b97aab0
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CommsLink cl("My device", 12345); | |
int my_int; | |
void ioinit() { | |
cl.register(&my_int); | |
} | |
void loop() { | |
while(1) { |
View gist:0436410147f979d4a119
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define register(exporter, var) ExportedVariable _exported ## #var (exporter, #var, &var) | |
Exporter ex; | |
int blah; | |
register(ex, blah); |
View gist:9b4820d7b857cb3d6d1e
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
template <typename T> | |
class Monitored { | |
protected: | |
T value; | |
boolean dirty; | |
public: | |
Monitored<T>& operator=(const T source) { | |
value = source; | |
dirty = true; | |
} |
View gist:5d73b82938cf51f98429
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define NEXT goto *opcodes[program[pc++]] | |
int interpret(char *stack, int sp, char *program) { | |
int pc = 0; | |
static const void *opcodes[] = {&&push, &&pop, &&add, &&sub, &&ret}; | |
NEXT; | |
push: | |
stack[sp++] = program[pc++]; | |
NEXT; |
View gist:d237f55cf7839de78662
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
switch (GET_DURATION(*pByte)) { | |
case 7: | |
delay(vel * 6); | |
case 6: | |
delay(vel * 2); | |
case 5: | |
delay(vel * 4); | |
case 4: | |
delay(vel * 4); | |
case 3: |
View gist:eac23706517c89f3e35b
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
typedef enum { | |
STATE_MAIN, | |
STATE_RECEIVE, | |
STATE_SEND, | |
STATE_PLAY | |
} state_t; | |
void state_machine() { | |
while(1) | |
{ |
View gist:9acde4424fbecf744708
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#define PIN 3 | |
void setup() { | |
Serial.begin(115200); | |
} | |
void loop() { | |
long last = 0; | |
boolean last_value = -1; | |
while(1) { |
OlderNewer