Skip to content

Instantly share code, notes, and snippets.

View kitchensink.txt
Bluegrass Kitchen Sink
Run `help` to list commands.
> help
Main
====
help show this help text
test run the built-in test
EEMBC CoreMark
View table.c
/* calibration table generated 2022-03-21T15:12:26.123655
table represented within tolerance 0.1% by 46 points
capacity: 12.57 Ah
138.89 Wh
100% | ~~~~~
| ~~
| ~
View main.rs
// find the segmented address of STAGE3_ENTRY
// be careful: rust *really* wants to optimize STAGE3_ENTRY into a u16
// in the resulting binary
let mut buf_address: u32;
unsafe {
core::arch::asm!(
"mov {1}, {0}",
in(reg) STAGE3_ENTRY,
out(reg) buf_address,
);
View main.rs
#![no_std]
#![no_main]
#![feature(asm_sym)]
#![feature(naked_functions)]
use blue_loader_stage3::{realmode, realmode_asm};
extern "sysv64" {
static REALMODE_IMAGE: &'static [u8];
static mut REALMODE: &'static mut [u8];
View lib.rs
use angle::Rad;
use wasm_bindgen::prelude::*;
use wasm_bindgen::JsCast;
macro_rules! log {
( $( $t:tt )* ) => {
web_sys::console::log_1(&format!( $( $t )* ).into());
}
}
View lite3dp-convert.py
#!/usr/bin/env python3
import argparse
import io
import os.path
import shutil
import zipfile
from PIL import Image
View example.py
import carbide
import numpy as np
s = carbide.scene.Scene()
s.camera.resolution.modify(1920, 1080)
s.renderer.spp = 64
s.renderer.spp_step = 4
for _ in range(100):
c = carbide.scene.Cube()
View example.py
import carbide
import numpy as np
s = carbide.scene.Scene()
s.camera.resolution.modify(1920, 1080)
s.renderer.spp = 64
a = carbide.scene.Sphere()
a.translate(-2, 0, 5)
a.emission = carbide.scene.ConstantTexture.grey(2.0)
View test.txt
connected.
>>> GetProperties {
version: Version(
"1.7",
),
device: None,
name: None,
}
<<< DefSwitchVector {
device: "Telescope Simulator",
View temp.diff
diff --git a/bootloaders/caterina/Caterina.h b/bootloaders/caterina/Caterina.h
index 5ce80fa..c273d50 100644
--- a/bootloaders/caterina/Caterina.h
+++ b/bootloaders/caterina/Caterina.h
@@ -65,10 +65,10 @@
#define SOFTWARE_IDENTIFIER "CATERINA"
#define CPU_PRESCALE(n) (CLKPR = 0x80, CLKPR = (n))
- #define LED_SETUP() DDRC |= (1<<7); DDRB |= (1<<0); DDRD |= (1<<5);
- #define L_LED_OFF() PORTC &= ~(1<<7)