This file contains hidden or 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
{ nixpkgs ? ./. | |
, lib ? import ./lib | |
# Host systems to test from. | |
, systems ? [ | |
"i686-linux" | |
"x86_64-linux" | |
# "x86_64-darwin" |
This file contains hidden or 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
# Look at `lib/customization.nix`, specifically `makeOverridable`. | |
# | |
# ``` | |
# func(args) -> Res | |
# | |
# override: | |
# func( override(args) ) -> Res | |
# where override :: Args -> Args | |
# + to reinsert the overrides: `makeOverridable func override(args)` | |
# |
This file contains hidden or 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
//! https://twitter.com/joseph_h_garvin/status/1597272949098438656 | |
//! https://users.rust-lang.org/t/shrinking-bitset-with-compile-time-known-length/84244 | |
//! https://rust.godbolt.org/z/9sevMvhsa | |
//! https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=5bb14fbfa4d086945e10107baf111679 | |
#![allow(type_alias_bounds)] | |
// #![recursion_limit = "20"] | |
use core::{ |
This file contains hidden or 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
{ | |
inputs = { | |
nixpkgs.url = github:NixOS/nixpkgs?ref=60b1608ad793c763ffbeabddc95dba7b4ed9cbc8; # nixos-unstable as of this writing | |
flu.url = github:numtide/flake-utils; | |
}; | |
outputs = { nixpkgs, flu, self }: | |
with flu.lib; eachSystem [ "aarch64-darwin" "x86_64-darwin" ] (system: let | |
# The `nixpkgs` bintools wrapper passes `-no_uuid` to `ld` when targeting | |
# macOS which causes `ld` to omit `LC_UUID`. |
This file contains hidden or 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
{ pkgs ? import <nixpkgs> {} }: | |
let | |
flakeCompat = import (pkgs.fetchFromGitHub { | |
owner = "edolstra"; | |
repo = "flake-compat"; | |
rev = "b4a34015c698c7793d592d66adbab377907a2be8"; | |
sha256 = "sha256-Z+s0J8/r907g149rllvwhb4pKi8Wam5ij0st8PwAh+E"; | |
}); | |
riffRepo = pkgs.fetchFromGitHub { | |
owner = "DeterminateSystems"; |
This file contains hidden or 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
.orig 0x3000 | |
; Set the stack pointer | |
LD R6, STARTING_SP | |
; Set up the loop: | |
LD R1, NUM_GPIO_PINS | |
NOT R1, R1 | |
ADD R1, R1, #1 | |
AND R0, R0, #0 |
This file contains hidden or 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
(placeholder to set the gist name) |
This file contains hidden or 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
(see flake.nix) |
This file contains hidden or 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
(see flake.nix) |
This file contains hidden or 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
; a rough benchmark of a typical solar panel controller | |
; loop time is 1.21ms | |
.orig x3001 | |
; Set the stack pointer | |
LD R6, STARTING_SP | |
; Put G1 - G7 in input mode, G0 in output mode | |
AND R0, R0, #0 | |
ADD R0, R0, #7 | |
PIN_INIT |