Skip to content

Instantly share code, notes, and snippets.

@ArchieAtkinson
ArchieAtkinson / out.rs
Created July 20, 2025 00:20
Confused Gemini
pub struct LoggerActiveObject {
channel: &'static Channel<LoggerMessage, 4>,
}
impl LoggerActiveObject {
pub fn new(
channel: &'static Channel<LoggerMessage, 4>,
) -> Self {
LoggerActiveObject {
channel,
@ArchieAtkinson
ArchieAtkinson / main.cpp
Created May 6, 2024 11:09
Coroutine Demo (Taken from Andreas Fertig Talk)
#include <array>
#include <concepts>
#include <coroutine>
#include <cstdlib>
#include <exception>
#include <iostream>
#include <source_location>
#include <string>
#include <utility>
@ArchieAtkinson
ArchieAtkinson / main.c
Created December 9, 2023 23:36
Deferr - Demoed with Work Queue (Active Object)
#include <string.h>
#include <stdlib.h>
#include <zephyr/kernel.h>
////////////////// deferr.h //////////////////
struct deferr_t
{
struct k_sem sem;
@ArchieAtkinson
ArchieAtkinson / main.c
Created December 9, 2023 23:17
A simple implmentation of future and promise in C using Zephyr - Demoed with Work Queue (Active Object)
#include <string.h>
#include <stdlib.h>
#include <zephyr/kernel.h>
////////////////// future_and_promise.h //////////////////
struct future_t
{
void *value;
@ArchieAtkinson
ArchieAtkinson / result.hpp
Created June 4, 2022 22:35
A very simple version of std::expected aimed at embedded applications
#pragma once
#include <cassert>
#include <utility>
enum Errors
{
no_error = 0,
error1 = 1,
error2 = 2,
not_populated,
@ArchieAtkinson
ArchieAtkinson / main.c
Last active September 3, 2022 08:21
Understanding the 2D Camera in Raylib
#include "raylib.h"
#define GRID_SIZE 100
#define TILE_SIZE 50
typedef struct Player {
Vector2 position;
float speed;
float size;
} Player;