Skip to content

Instantly share code, notes, and snippets.

' Gambas module file
Library "libgpiod:2"
Library "libc:6"
Extern gpiod_version_string() As String In "libgpiod:2"
Extern gpiod_chip_open_by_number(chip As Integer) As Pointer In "libgpiod:2"
Extern __errno_location() As Pointer In "libc:6"
Public Sub Main()
@microhobby
microhobby / main.c
Created October 6, 2022 15:09
Testing getting errno with Gambas3
#include <stdio.h>
#include <gpiod.h>
#include <errno.h>
int main(int argc, char *argv[])
{
struct gpiod_chip *chip;
int ret;
chip = gpiod_chip_open_by_number(0);
@microhobby
microhobby / memo.c
Created February 26, 2021 20:12
Testware
#include <stdlib.h>
#include <stdio.h>
#include <unistd.h>
#include <string.h>
int
main(int argc, char **argv)
{
size_t sz = 4000000000;
char *a = malloc(sz);
@microhobby
microhobby / .config
Created December 14, 2020 04:21
.config for WSL 2 v5.10
#
# Automatically generated file; DO NOT EDIT.
# Linux/x86 5.10.0 Kernel Configuration
#
CONFIG_CC_VERSION_TEXT="gcc (Debian 10.2.0-19) 10.2.0"
CONFIG_CC_IS_GCC=y
CONFIG_GCC_VERSION=100200
CONFIG_LD_VERSION=235010000
CONFIG_CLANG_VERSION=0
CONFIG_LLD_VERSION=0
#include <stdio.h>
#include <unistd.h>
#include <gpiod.h>
int main(int argc, char *argv[])
{
struct gpiod_chip *output_chip;
struct gpiod_line *output_line;
int line_value;
echo o > /proc/sysrq-trigger
echo c > /proc/sysrq-trigger
docker run --rm -it -d ubuntu
docker run --rm -it --privileged -v /:/host alpine
chroot /host
# Kernel
kernel=zImage
#initramfs ramdisk.img 0x01f00000
# Audio
dtparam=audio=on
# Camera
#disable_camera_led=1
#gpu_mem=128