Skip to content

Instantly share code, notes, and snippets.

From bd3a676daae9c94afda2720d2e023312cf2d019d Mon Sep 17 00:00:00 2001
From: Angus Gratton <angus@espressif.com>
Date: Tue, 11 Jul 2017 17:59:02 +0800
Subject: [PATCH] WIP allow first 128KB of DRAM to be allocated statically
- Moves stacks to end of RAM
- Doesn't yet provide a way to block out this RAM from heap
---
components/bootloader/src/main/bootloader_jump.S | 55 ++++++++++++++++++++++
components/bootloader/src/main/bootloader_start.c | 23 +++++----
@projectgus
projectgus / kicad-regrid.py
Created December 14, 2015 05:24
kicad-regrid: Script to quantize a KiCAD eeschema schematic back onto a standard grid
#!/usr/bin/env python3
#
# Hacky script to quantize a KiCAD eeschema file back onto a standard grid
#
# Useful if someone somehow moved some components off grid and you want to clean it up.
#
# Usage is kicad-regrid.py <schematic file>
#
# Outputs <schematic file>-regrid.sch. I recommend NOT OPENING the regrid file directly in KiCAD as it assumes a new project
# with that name exists, and you'll probably get a bunch of errors. Just rename it over the original schematic
@projectgus
projectgus / i3-shell.sh
Last active February 17, 2020 13:38 — forked from viking/i3-shell.sh
Bash script for i3 to run a terminal in the same working directory as the current focused application (patched for sakura which has a thread as last process in pstree output)
#!/bin/bash
# i3 thread: https://faq.i3wm.org/question/150/how-to-launch-a-terminal-from-here/?answer=152#post-id-152
CMD=sakura
CWD=''
# Get window ID
ID=$(xdpyinfo | grep focus | cut -f4 -d " ")
# Get PID of process whose window this is
@projectgus
projectgus / esp8266.def
Created July 2, 2015 01:12
Sample simple esp8266.def file for use with scratchabit
cpu xtensa
# Show up to this many raw bytes of code/data
show bytes 4
# Load an arbitrary esp8266 ELF file
# See example.def if you want to load raw binaries instead
load /home/gus/dev/esp/rtos/open-rtos/examples/http_get/build/http_get.out elf
# First attempt at loading BootROM binary image and symbols
$ cd /sys/devices/virtual/input/lge_touch
$ cat firmware
====== Firmware Info ======
manufacturer_id = 1
product_id = TM2369
fw_version = E159
fw_image_product_id = SynaReadCo
fw_image_version = ]��
$ cat platform_data
====== Platform data ======
From b08ec678a9e4cd3cb8d41979c4049315004a94dd Mon Sep 17 00:00:00 2001
From: Angus Gratton <gus@projectgus.com>
Date: Wed, 6 May 2015 11:19:42 +1000
Subject: [PATCH] XTensa call0 ABI: Reference register cache from a0 when
unwinding
Fixes bug where wrong Frame Pointer value was read during backtrace,
leading to corrupt stack traces.
---
gdb/xtensa-tdep.c | 7 ++++---
@projectgus
projectgus / winleak.c
Created April 28, 2015 07:17
Minimal test program for libusb leaks on Windows. Relates to https://github.com/libusb/libusb/pull/64
/* Quick sample to demonstrate Windows device leaks from libusb_get_device_list when reusing instances */
#include <stdio.h>
#include "libusb.h"
#include <assert.h>
/* Set to zero to stop after 100 iterations, for running under drmemory/other */
const int RUN_INFINITE = 0;
static libusb_device **stored = NULL;
@projectgus
projectgus / user_main.c
Created March 3, 2015 11:08
Debuggable esp8266 program
#include "ets_sys.h"
#include "osapi.h"
#include "gpio.h"
#include "os_type.h"
#include "user_config.h"
#include <stdio.h>
volatile uint32_t fast_blink = 250*1000;
volatile uint32_t slow_blink = 1200*1000;
@projectgus
projectgus / sub_mate.txt
Created January 22, 2015 05:01
"Sub-Mate" homebrew Club Mate recipe
Translated from http://subsalzburg.blogsport.eu/2014/12/16/sub-mate-diy-cooking/
by desperate Club Mate enthusiasts from Australia
Sugar Syrup: 150g sugar, 1 pinch citric acid, 1 half teaspoon tamarind paste.
Mate: 5 full tablespoons Mate, 5x infused so a stronger brew results
Dissolve sugar syrup in Mate brew, add juice of one lemon
@projectgus
projectgus / _KiCad_Length_Matching
Last active February 10, 2021 05:18
Length matching scripts for KiCad
This script now has its own proper repo thanks to @mithro:
https://github.com/mithro/kicad-length-matching-checks