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
#define EXPECT | |
#include <assert.h> | |
#include <math.h> | |
#include <stdbool.h> | |
#include <stddef.h> | |
#include <stdio.h> |
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
// Ask Hackaday: How do you DIY a Top-Octave Generator? | |
// https://hackaday.com/2018/05/24/ask-hackaday-diy-top-octave-generator/?utm_source=feedburner | |
// Target Arduino Mega. | |
// N.B., Timer 1 has highest interrupt priority, so | |
// use it for the highest frequency oscillators. | |
// Note Comp Port/Pin Arduino Pin | |
// C OC1A PB5 pin 11 | |
// B OC1B PB6 pin 12 |
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
// BEGIN kbob | |
// This is identical to https://vulkan-tutorial.com/Drawing_a_triangle/Swap_chain_recreation | |
// as of 2018-06-13 except for code between the "BEGIN kbob" and "END kbob" comments. | |
// The original code is still there but commented out with "//-". | |
// | |
// Built with MoltenVK 1.1.73 and GLFW 20180519 for MacOS, the original never recreated | |
// the swap chain. It continued to draw at the original 800 by 600 resolution and scaled | |
// the result to fit the resized window. | |
// | |
// Also, according to GLFW doc, the glfwGetWindowSize() is not the right function to call. |
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
`default_nettype none | |
`define W 24 | |
module top ( | |
input CLK, | |
output LED1, | |
output LED2, | |
output LED3, | |
output LED4, |
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
# 12 MHz clock | |
set_io -nowarn CLK 35 | |
# RS232 | |
set_io -nowarn RX 6 | |
set_io -nowarn TX 9 | |
# LEDs and Button | |
set_io -nowarn BTN_N 10 | |
set_io -nowarn LEDR_N 11 |
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
#[macro_use] | |
extern crate vulkano; | |
extern crate vulkano_shaders; | |
extern crate winit; | |
extern crate vulkano_win; | |
use vulkano::buffer::{CpuAccessibleBuffer, CpuBufferPool, BufferUsage}; | |
use vulkano::command_buffer::{AutoCommandBufferBuilder, DynamicState}; | |
use vulkano::descriptor::descriptor_set::PersistentDescriptorSet; | |
use vulkano::device::{Device, DeviceExtensions}; |
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
`default_nettype none | |
module blinky (CLK, LED1); | |
input wire CLK; | |
output wire LED1; | |
parameter WIDTH = 24; | |
parameter CLK_HZ = 12_000_000; | |
reg [WIDTH-1:0] counter; | |
reg [7:0] led1; |
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
#!/usr/bin/env shaderbox | |
#define TAU 6.283185307179586 | |
#define A vec3(0.5, 0.5, 0.5) | |
#define B vec3(0.5, 0.5, 0.5) | |
#define C vec3(1.0, 0.7, 0.4) | |
#define D vec3(0.0, 0.15, 0.20) | |
vec3 pal(in float t, in vec3 a, in vec3 b, in vec3 c, in vec3 d) |
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
""" | |
Function decorator with optional keyword arguments. | |
""" | |
from functools import wraps | |
def decorate(func=None, kind=''): | |
if func is None: | |
# was called pre-decoration. Return anonymous decorator. | |
return lambda f: decorate(f, kind) |
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
from nmigen import * | |
from nmigen_boards.icebreaker import ICEBreakerPlatform | |
from nmigen.cli import main | |
class Foo(Elaboratable): | |
def __init__(self): | |
self.bar = Signal(signed(24)) | |
def elaborate(self, platform): |