Skip to content

Instantly share code, notes, and snippets.

View HTD's full-sized avatar
💭
I may be slow to respond.

Adam Łyskawa HTD

💭
I may be slow to respond.
View GitHub Profile
@HTD
HTD / !HAL_I2C-NB.md
Last active February 7, 2024 05:13
HAL I2C truly non-blocking reads.

STM32 HAL I2C TRULY NON-BLOCKING MEMORY I/O

Makes HAL_I2C_Mem_Read_IT and HAL_I2C_Mem_Write_IT truly non-blocking.

Known issues:

  • needs a configured system timer to provide interrupts,
  • needs a modification in original HAL driver,
  • needs an extra helper (delay_async.c / delay_async.h).
  • internal delays depend on the timer tick time (default 1ms here) so smaller intervals require smaller timer period.
@HTD
HTD / ds18b20.c
Last active May 17, 2022 20:02
DS18B20 driver for STM32
/**
* DS18B20 driver.
*/
#include <string.h>
#include "ds18b20.h"
/**
* Reads the address of the only DS18B20 connected to the configured USART.
* @param rom_code A pointer to the 8-byte array containing the address.
@HTD
HTD / ProtectedComponentBase.cs
Last active November 21, 2021 18:05
Blazor spurious updates workaround
using System.Collections.Generic;
using System.Reflection;
using System.Threading.Tasks;
using Microsoft.AspNetCore.Components;
namespace Woof.Blazor;
/// <summary>
/// Use this instead of <see cref="ComponentBase"/> to prevent <see cref="EventCallback"/>s triggers from changing the component's state and resetting all parameters.