Skip to content

Instantly share code, notes, and snippets.

View Palladinium's full-sized avatar

Patrick Chieppe Palladinium

View GitHub Profile
@Palladinium
Palladinium / avr-hal.diff
Last active July 24, 2023 02:06
Unsound (?) Attiny84 I2C implementation through USI
diff --git a/avr-hal-generic/src/port.rs b/avr-hal-generic/src/port.rs
index 1ecc275..6b6e070 100644
--- a/avr-hal-generic/src/port.rs
+++ b/avr-hal-generic/src/port.rs
@@ -121,6 +121,15 @@ impl<PIN: PinOps> Pin<mode::Input<mode::Floating>, PIN> {
}
}
+impl<PIN: PinOps, MODE: mode::Io> Pin<MODE, PIN> {
+ /// Returns the underlying pin for direct manipulation
@Palladinium
Palladinium / opensimplex.cpp
Last active April 24, 2019 12:12
OpenSimplex in C++
/* OpenSimplex Noise in C++
* Ported by Patrick Chieppe from C#
* Original at https://gist.github.com/digitalshadow/134a3a02b67cecd72181
*
* This is free and unencumbered software released into the public domain.
*
* Anyone is free to copy, modify, publish, use, compile, sell, or
* distribute this software, either in source code form or as a compiled
* binary, for any purpose, commercial or non-commercial, and by any
* means.