This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[package] | |
name = "clapment" | |
version = "0.1.0" | |
edition = "2021" | |
[dependencies] | |
anyhow = "1.0.72" | |
clap = { version = "4.3.21", features = ["derive"] } | |
figment = { version = "0.10.10", features = ["env", "json", "toml"] } | |
humantime = "2.1.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
trait PushUnique { | |
type Item; | |
fn push_unique(&mut self, item: Self::Item) -> Result<(), Self::Item>; | |
} | |
impl<T> PushUnique for Vec<T> | |
where | |
T: PartialEq, | |
{ | |
type Item = T; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![no_main] | |
#![no_std] | |
use defmt_rtt as _; // global logger | |
// same panicking *behavior* as `panic-probe` but doesn't print a panic message | |
// this prevents the panic message being printed *twice* when `defmt::panic` is invoked | |
#[defmt::panic_handler] | |
fn panic() -> ! { | |
cortex_m::asm::udf() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
cargo-valgrind: version 2.0.3 | |
XML format mismatch between `valgrind` and `cargo valgrind`: custom: duplicate field `stack` | |
XML output of valgrind: | |
```xml | |
<?xml version="1.0"?> | |
<valgrindoutput> | |
<protocolversion>4</protocolversion> | |
<protocoltool>memcheck</protocoltool> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- rtic_v0.5/stm32f0_hid_mouse/src/main.rs 2022-02-10 14:15:04.270648800 +0100 | |
+++ rtic_v1/stm32f0_hid_mouse/src/main.rs 2022-02-10 10:32:55.309537420 +0100 | |
@@ -1,13 +1,16 @@ | |
+/* | |
#![deny(unsafe_code)] | |
+*/ | |
#![deny(warnings)] | |
#![no_std] | |
#![no_main] | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
use tokio::sync::mpsc; | |
#[derive(Debug)] | |
pub enum Message { | |
SomeU8(u8), | |
SomeBool(bool), | |
SomeChar(char), | |
} | |
/// Panics if all the channel sender handles are gone (disables all branches). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#pragma once | |
#ifndef ARDUINO_AVR_UNO | |
#include <cstddef> | |
#endif | |
template<typename T, size_t SIZE> | |
class Vec { | |
public: | |
Vec(std::initializer_list<T> init) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <FastLED.h> | |
// How many leds are in the strip? | |
#define NUM_LEDS 144 | |
#define DATA_PIN_1 2 | |
#define DATA_PIN_2 4 | |
// This is an array of leds. One item for each led in your strip. | |
CRGB leds_1[NUM_LEDS]; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
fn print_i2c_it_flags(b: &stm32f0xx_hal::stm32f0::R<u32, stm32f0xx_hal::stm32f0::Reg<u32, pac::i2c1::_ISR>>) { | |
rprintln!("{"); | |
if b.txe().is_empty() { | |
rprintln!("TXE Transmit Data Register Empty"); | |
} | |
if b.txis().is_empty() { | |
rprintln!("TXIS Transmit Interrupt Status"); | |
} | |
if b.rxne().is_not_empty() { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdint.h> | |
#include <stddef.h> | |
#include <stdlib.h> | |
#include <string.h> | |
#include <stdio.h> | |
typedef struct packet_st { | |
char *data; | |
size_t length; | |
} packet_t; |
NewerOlder