Skip to content

Instantly share code, notes, and snippets.

View ArXen42's full-sized avatar

Georgii Pelageikin ArXen42

  • Russia, Saint Petersburg
View GitHub Profile
@ArXen42
ArXen42 / stm32-wrapper.hpp
Last active April 17, 2022 17:08
Example C++ wrappers around GPIO pins and FreeRTOS mutex
//----- GPIO wrapper example -----
enum class GpioPort : uintptr_t
{
A = GPIOA_BASE,
B = GPIOB_BASE,
C = GPIOC_BASE,
D = GPIOD_BASE,
E = GPIOE_BASE,
F = GPIOF_BASE,
@ArXen42
ArXen42 / VideoBox.cs
Created January 24, 2020 12:20
VideoBox.cs
/// <inheritdoc />
/// <summary>
/// Wrapper control around VlcControl. Provides basic UI for video playback.
/// </summary>
public partial class VideoBox : UserControl
{
private static readonly String[] MediaOptions = {":avcodec-hw=dxva2"}; //Should enable GPU acceleration
private readonly Dispatcher _dispatcher;
private Boolean _isChangingPosition; //Prevents (sometimes) unwanted feedback
private Video3D _video;
@ArXen42
ArXen42 / horrible_cast.hpp
Created May 30, 2018 15:35
horrible_cast.hpp
//From https://github.com/pbhogan/Signals
// horrible_cast< >
// This is truly evil. It completely subverts C++'s type system, allowing you
// to cast from any class to any other class. Technically, using a union
// to perform the cast is undefined behaviour (even in C). But we can see if
// it is OK by checking that the union is the same size as each of its members.
// horrible_cast<> should only be used for compiler-specific workarounds.
// Usage is identical to reinterpret_cast<>.
@ArXen42
ArXen42 / PortLog.txt
Last active March 15, 2018 10:30
PortLog
13:26 w013:26 e1Enable:1
#e1.#Success#
13:26 w013:26 i1
Version:2
#i1.#Success#
13:26 e0Enable:0
13:26 #e0.#Success#
13:26 e1Enable:1
13:26 #e1.#Success#
13:26 z0#z0.#Success#