Skip to content

Instantly share code, notes, and snippets.

View facchinm's full-sized avatar
🐢

Martino Facchin facchinm

🐢
  • Arduino
  • Torino, Italy
View GitHub Profile
@Gadgetoid
Gadgetoid / README.md
Last active August 18, 2024 12:51
Raspberry Pi Zero / Windows 10 automatic RNDIS driver install for composite gadgets

Preface

I owe my very rapid learning journey in the world of ConfigFs to several key sources which aren't necessarily relevant to this result, but I feel deserve a mention anyway.

@Miouyouyou
Miouyouyou / drm-prime-dumb-kms.c
Last active October 25, 2024 06:17
Simple example showing how to use DRM to : allocate a Dumb buffer on the GPU, use it as a framebuffer, use this CRTC on the currently connected screen (expecting 1 connected screen), export the buffer, reimport it implicitly with mmap and write in it.
// This will works on Embedded GPU that implements .gem_prime_mmap like Rockchip ones.
// This will fail on most DRM drivers for GPU with dedicated memory as they tend to NOT implement .gem_prime_mmap.
#include <stdio.h>
#include <libdrm/drm.h>
#include <stdint.h>
#include <sys/mman.h>
#include <string.h>
@devanlai
devanlai / svd-dump.py
Last active March 3, 2023 11:03
gdb script for dumping STM32 registers
"""
Utilities for dumping STM32 peripheral registers with tab-completion
Based on a script by vampi-the-frog
Dependencies:
pip install -U cmsis-svd
Usage (inside gdb):
(gdb) source /path/to/svd-dump.py
struct MyPrintable : Printable {
const char *p;
MyPrintable(const char *p) : p(p) {}
size_t printTo(Print &P) const {int i; for (i=0; p[i]; i++) P.write(p[i]); return i;}
};
void setup() {
#define FSH F("Flash string")
String S("String");
char arr[] = "char array";
@mikkeloscar
mikkeloscar / guide.md
Created June 14, 2014 20:44
Setup armv7h chroot under x86_64 host (Archlinux/Archlinuxarm biased)

Setup armv7h chroot under x86_64 host (Archlinux/Archlinuxarm biased)

Simple way to setup an arm chroot for building packages for your arm devices. This is an alternative to cross-compiling where you are limited to only linking against the libs in your toolchain.

Setup chroot-fs

You can store the chroot wherever you like. I choose to store it in a disk-image which I mount to my filesystem.