Skip to content

Instantly share code, notes, and snippets.

View psiroki's full-sized avatar

Peter Siroki psiroki

  • I've helped establishing a Hungarian dev LLC
  • Budapest
  • 20:16 (UTC +02:00)
View GitHub Profile
@psiroki
psiroki / fdi.md
Created May 19, 2026 11:52
Draft: Fairly Decent Image Codec

Fairly Decent Image Codec — Encoding Specification

This document defines the Fairly Decent Image Codec which aims to be byte‑aligned and simple to encode or decode (sacrificing a bit of compression).
All opcodes are one full byte, and additional payload bytes follow as specified.


1. Overview

TODO: file header.

@psiroki
psiroki / ringlite.c
Last active July 7, 2020 22:54
Charlieplexed ring light using an ATTiny13A
// avrdude ... -U lfuse:w:0x6a:m
// 1.2 MHz (9.6 MHz oscillator divided by 8)
// Brown-out detection at 2.7 V (I guess the blue leds wouldn't work anyway)
#define F_CPU 1200000UL
#define MCU attiny13
#include <avr/io.h>
#include <avr/pgmspace.h>
void turnAllOff() {
PORTB = 0;
#include <math.h>
#define SWAP(a,b) tempr=(a);(a)=(b);(b)=tempr
/*
* Discrete Fast Fourier Transform based on the algorithm in
* Numerical Recipes in C, slighly modified by removing the
* insane 1 based array access.
*
* Takes the data pointer which contains nn pairs of doubles,