Skip to content

Instantly share code, notes, and snippets.

@royratcliffe
royratcliffe / diskpart.cmd
Last active October 27, 2023 16:39
diskpart
@REM wsl --shutdown docker-desktop
@REM wsl --shutdown docker-desktop-data
select vdisk file="C:\Users\..\AppData\Local\Docker\wsl\data\ext4.vhdx"
attach vdisk readonly
compact vdisk
detach vdisk
@royratcliffe
royratcliffe / Makefile
Last active October 8, 2023 07:20
Buildroot Tarball on Docker ARM
rootfs:
docker run -it --rm -v rootfs:/mnt -v .:/home alpine tar -C /mnt -xf /home/rootfs.tar
rootfs-%:
docker run -it --rm -v rootfs:/mnt --privileged --platform linux/arm arm32v7/alpine $*
ash: rootfs-ash
# /etc/init.d/rcK
# /etc/init.d/rcS
@royratcliffe
royratcliffe / Config.in
Last active October 11, 2023 04:03
swipl-ffi-buildroot
config BR2_PACKAGE_SWIPL_FFI
bool "SWI-Prolog FFI"
depends on BR2_PACKAGE_SWIPL
depends on BR2_PACKAGE_LIBFFI
help
Dynamic calling C from Prolog.
This package deals with calling C functions from shared objects from Prolog without writing wrappers.
@royratcliffe
royratcliffe / Config.in
Last active October 21, 2023 20:22
package-swipl
# swipl supports arch for which libc fenv.h provides all four macros:
# FE_DOWNWARD, FE_TONEAREST, FE_TOWARDZERO, FE_UPWARD
# See for example in glibc https://sourceware.org/git/glibc.git
# git grep -E '^[[:space:]]*#[[:space:]]*define[[:space:]]+FE_(TONEAREST|UPWARD|DOWNWARD|TOWARDZERO)' sysdeps/
config BR2_PACKAGE_SWIPL_ARCH_SUPPORTS
bool
default y if BR2_aarch64 || BR2_aarch64_be
default y if BR2_arceb || BR2_arcle
default y if BR2_arm || BR2_armeb
default y if BR2_i386
@royratcliffe
royratcliffe / display.env
Last active September 30, 2023 06:56
MAVLink
DISPLAY=${DISPLAY}
WAYLAND_DISPLAY=${WAYLAND_DISPLAY}
XDG_RUNTIME_DIR=${XDG_RUNTIME_DIR}
PULSE_SERVER=${PULSE_SERVER}
{
for (uint8_t address = 0; address < 0x80; address++)
{
HAL_StatusTypeDef status = HAL_I2C_IsDeviceReady(&hi2c1, address << 1, 3, 1000);
if (status == HAL_OK)
{
ITM_SendChar(0);
}
}
}
@royratcliffe
royratcliffe / CMakeLists.txt
Last active August 21, 2023 12:39
stm32_h747i-disco_default
############################################################################
#
# Copyright (c) 2023 PX4 Development Team. All rights reserved.
#
# Redistribution and use in source and binary forms, with or without
# modification, are permitted provided that the following conditions are met:
#
# 1. Redistributions of source code must retain the above copyright notice, this
# list of conditions and the following disclaimer.
# 2. Redistributions in binary form must reproduce the above copyright notice,
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**",
"/opt/ros/rolling/include/*"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
{
"configurations": [
{
"name": "mingw",
"includePath": [
"${workspaceFolder}/**"
],
"defines": [],
// VS Code complains about the compiler path if not a full path.
// Without the path, if finds gcc in the search paths anyway.