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
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) |
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
void display_num(DisplayType type, uint16_t v) { | |
uint8_t out[DISPLAY_DIGITS]; | |
unsigned int i; | |
for (i = 0; i < DISPLAY_DIGITS; i++) { | |
out[i] = v % 10; | |
v /= 10; | |
if (!v) { | |
break; | |
} | |
} |
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
pub async fn run(&mut self) -> anyhow::Result<()> { | |
loop { | |
for ad_or_news in &[true, false] { | |
for _ in 0..1 { | |
self.play_music().await?; | |
if *ad_or_news { | |
self.play_ad().await?; | |
} else { | |
self.play_news().await?; | |
} |
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
pub async fn run(&mut self) -> anyhow::Result<()> { | |
let mut now = Time::frames(0); | |
loop { | |
for ad_or_news in &[true, false] { | |
//let _: u8 = true; | |
for _ in 0..1 { | |
self.play_music().await?; | |
if *ad_or_news { | |
self.play_ad().await?; |
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
let mut fileio = sf::SF_VIRTUAL_IO { | |
get_filelen: Self::vio_get_filelen, | |
seek: Self::vio_seek, | |
read: Self::vio_read, | |
//write: unsafe { std::mem::transmute(std::ptr::null::<libc::c_void>()) }, | |
write: Self::vio_write, | |
tell: Self::vio_tell, | |
}; |
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
#include <stdint.h> | |
#include <mcs51/at89x051.h> | |
#define OSCILLATOR_FREQ 12000000 | |
// assuming 8-bit counter in timer | |
#define INTERRUPTS_PER_SECOND (OSCILLATOR_FREQ / ((1 << 8) * 12)) | |
// display multiplexing | |
#define DISPLAY_FREQ 1000 * 3 |
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
import random | |
import sqlite3 | |
import timeit | |
import numpy | |
import tempfile | |
import os.path | |
A_VALUES = ['foo', 'bar', 'baz'] | |
B_VALUES = ['magrat', 'nanny', 'granny'] |
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
# link to vcpkg libsndfile | |
# https://github.com/evpobr/sndfile-sys | |
[target.'cfg(all(windows, target_env="msvc"))'] | |
#[build] | |
rustflags = ["-Ctarget-feature=+crt-static"] |
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
// Censor a part of the screen (such as a chat window) by pixelation in | |
// obs-shaderfilter. | |
// https://obsproject.com/forum/resources/obs-shaderfilter.775/ | |
// https://creativecommons.org/publicdomain/zero/1.0/ | |
// To the extent possible under law, ion has waived all copyright and related | |
// or neighboring rights to obs-pixelate-rectangle. This work is published | |
// from: Suomi. | |
// originally from |
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
// Author: Aaron Griffith | |
// License: MIT | |
uniform int strips; // = 10; | |
uniform float seed; // = 0.0; | |
uniform vec4 background; // = vec4(0.0, 0.0, 0.0, 1.0) | |
uniform bool twopart; // = true; | |
// https://stackoverflow.com/a/4275343 |