Skip to content

Instantly share code, notes, and snippets.

View DaelonSuzuka's full-sized avatar
💭
LFG

David Kincaid DaelonSuzuka

💭
LFG
View GitHub Profile
@DaelonSuzuka
DaelonSuzuka / cloudSettings
Last active June 25, 2019 11:48
Visual Studio Code Settings Sync Gist
{"lastUpload":"2019-06-25T11:48:36.195Z","extensionVersion":"v3.3.0"}
@DaelonSuzuka
DaelonSuzuka / keybindings.json
Last active March 12, 2020 20:50
VS Code Keybindings
{
"key": "alt+`",
"command": "workbench.action.terminal.focus",
"when": "editorTextFocus"
},
{
"key": "alt+`",
"command": "workbench.action.focusActiveEditorGroup",
"when": "terminalFocus"
},
@DaelonSuzuka
DaelonSuzuka / json_node.h
Last active March 13, 2020 03:18
JSON node representation
#ifndef _JSON_NODE_H_
#define _JSON_NODE_H_
/* ************************************************************************** */
/* JSON node type
The contents of a json_node_t(see below) are in a void pointer, and can't be
correctly deferenced without knowing what type to expect. This enum contains
all the possible types you can expect in a node.
@DaelonSuzuka
DaelonSuzuka / 1_json_print.h
Last active June 16, 2020 22:47
JSON printing module written for small embedded systems with serial ports.
#ifndef _JSON_PRINT_H_
#define _JSON_PRINT_H_
/* ************************************************************************** */
/* json_node.h contains the definition of the json_node_t data structure and
its elements, as well as instructions and examples on how to construct your
own C representations for JSON objects.
*/
#include "json_node.h"
@DaelonSuzuka
DaelonSuzuka / usb_json_hash.c
Last active April 4, 2020 01:12
gperf script
#include "usb_json_hash.h"
#include "os/serial_port.h"
#include "os/shell/shell_command_processor.h"
#include <stdint.h>
#include <string.h>
/* ************************************************************************** */
/* [[[cog
import cogutils as utils, codegen as code
@DaelonSuzuka
DaelonSuzuka / code_gen.ipynb
Last active March 26, 2020 20:38
python code generator
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
{
"type": "array",
"title": "Pins:",
"items": {
"type": "object",
"title": "Pin",
"required": [
"name",
"port",
"pin",
#include "auto_start.h"
#include <stdint.h>
/* ************************************************************************** */
// The linker defines these during compilation.
extern const char _Lauto_start[];
extern const char _Hauto_start[];
// Use those linker symbols to calculate how many functions are registered
#include "str_len.h"
/* ************************************************************************** */
uint8_t str_len(char *string) {
char *cp = string;
while (*cp) {
cp++;
}
@DaelonSuzuka
DaelonSuzuka / config.h
Last active May 26, 2020 00:23
System Time Files
#ifndef _CONFIG_H_
#define _CONFIG_H_
/* ************************************************************************** */
// CONFIG1L
#pragma config FEXTOSC = OFF // External Oscillator Selection->Oscillator not enabled
#pragma config RSTOSC = HFINTOSC_64MHZ // Reset Oscillator Selection->HFINTOSC with HFFRQ = 64 MHz and CDIV = 1:1