Skip to content

Instantly share code, notes, and snippets.

View FHeilmann's full-sized avatar
🎯
Focusing

Florian Heilmann FHeilmann

🎯
Focusing
View GitHub Profile
@FHeilmann
FHeilmann / fix_klipper_deprecation.md
Last active July 12, 2022 00:56
Fixing klipper config errors related to deprecation updates in late 2021

In late 2021, klipper removed some features that were deprecated over the course of 2020 and 2021. This document summarizes them briefly and shows how to fix them:

Removal of step_distance

step_distance describes the distance covered by a certain axis with 1 stepper (micro-)step. The downside of this parameter (and one of the reasons for its removal, is that if one were to change the microstepping of a stepper, the step_distance changes as well. Klipper therefore removed the step_distance parameter in favor of rotation_distance and full_steps_per_rotation. These two parameters are unaffected by microstepping, and can be easily determined by inspecting the used hardware.

Perform the following steps to convert your config:

  • comment out the old step_distance parameter
  • add three new parameters:
blueprint:
name: Z2M - IKEA five button remote for lights - modified
description: 'Control lights with an IKEA five button remote (the round ones).
The middle "on" button, toggle the lights on/off to the last set brightness
(unless the force brightness is toggled on in the blueprint).
@FHeilmann
FHeilmann / sph0645_esp32.ino
Created December 4, 2020 21:40
using SPH0645 with ESP32 in arduino framework with platformio
#define SAMPLE_RATE 32000
#define BLOCK_SIZE 512
const i2s_port_t I2S_PORT = I2S_NUM_0;
#define I2S_WS 15 // LRCL
#define I2S_SD 32 // DOUT
#define I2S_SCK 14 // BCLK
void setup() {
@FHeilmann
FHeilmann / library.patch
Created August 8, 2018 12:11
ATMEL SAM4E Series Device Support and CMSIS 5, fix for AFEC and exception table
--- a/ic.sam4e/gcc/gcc/startup_sam4e.c
+++ b/ic.sam4e/gcc/gcc/startup_sam4e.c
@@ -135,6 +136,7 @@ const DeviceVectors exception_table = {
(void*) PMC_Handler, /* 5 Power Management Controller */
(void*) EFC_Handler, /* 6 Enhanced Embedded Flash Controller */
(void*) UART0_Handler, /* 7 UART 0 */
+ (void*) Dummy_Handler, /* 8 Dummy */
(void*) PIOA_Handler, /* 9 Parallel I/O Controller A */
(void*) PIOB_Handler, /* 10 Parallel I/O Controller B */
(void*) PIOC_Handler, /* 11 Parallel I/O Controller C */
@FHeilmann
FHeilmann / futures.py
Last active September 19, 2016 11:23
Create an asynchronous interruptible loop with python 2
from concurrent import futures
import time
# Container class for our worker loop.
# Wrapping the loop in a class allows us to create
# an instance which hosts an interrupt variable which
# we can access after we submitted the loop to the Executor.
# That way we can cancel the loop from the outside.
class Worker(object):