Skip to content

Instantly share code, notes, and snippets.

View ladislas's full-sized avatar
💭
...

Ladislas de Toldi ladislas

💭
...
View GitHub Profile
@ladislas
ladislas / LKBLE.h
Created November 2, 2020 10:22
Mbed BLE Example
// Leka - LekaOS
// Copyright 2020 APF France handicap
// SPDX-License-Identifier: Apache-2.0
#include "events/mbed_events.h"
#include "ble/BLE.h"
#include "ble/Gap.h"
#include "ble/services/HeartRateService.h"
@ladislas
ladislas / ioc_editor.rb
Created September 14, 2020 10:26
STM32CubeMX .ioc file editor and pin names generator
#!/usr/bin/env ruby
# Leka - LekaOS
# Copyright 2020 APF France handicap
# SPDX-License-Identifier: Apache-2.0
require 'csv'
#
# MARK:- Deal with argv
#!/usr/bin/env zsh
mkdir -p $HOME/dev/tmp
cd $HOME/dev/tmp
git clone https://github.com/ladislas/dotfiles
cd $HOME/dev/tmp/dotfiles
./bootstrap.sh --hello
{"version":1,"resource":"file:///Users/ladislas/dev/leka/LekaOS/fs/README.md","entries":[{"id":"STdV.md","timestamp":1651009549944},{"id":"M5q0.md","timestamp":1651009748184},{"id":"3H5G.md","timestamp":1651009824969},{"id":"4sBt.md","timestamp":1651009860501},{"id":"RTRW.md","timestamp":1651010276572},{"id":"bQPi.md","timestamp":1651010506797},{"id":"Bx9G.md","timestamp":1651010600757},{"id":"r02C.md","timestamp":1651010638220},{"id":"e3jL.md","source":"undoRedo.source","timestamp":1651011444467},{"id":"ZlLM.md","source":"undoRedo.source","timestamp":1651072275708},{"id":"6ot5.md","source":"undoRedo.source","timestamp":1651072310350},{"id":"EG95.md","timestamp":1651925350508}]}
/usr/local/bin/openocd \
-f /usr/local/Cellar/open-ocd/HEAD-db23c13/share/openocd/scripts/board/st_nucleo_wb55.cfg \
-f /usr/local/Cellar/open-ocd/HEAD-db23c13/share/openocd/scripts/interface/stlink-v2-1.cfg \
-c init \
-c "reset init"
/usr/local/bin/openocd \
-f /usr/local/Cellar/open-ocd/HEAD-db23c13/share/openocd/scripts/board/st_nucleo_wb55.cfg \
-c "init; reset halt"
@ladislas
ladislas / script.sh
Created November 20, 2019 14:22
Check Git status
for f in *; do
cd $f
echo $f
if [ -n "$(git status --porcelain)" ]; then
echo "\n ⚠️ $f\n"
fi
cd ..
done
@ladislas
ladislas / Makefile
Created September 10, 2019 10:49
avr-gcc-unused-code
all: direct elf size
1: clean direct elf nm size
2: clean stepped elf nm size
3: clean steppedimproved elf nm size
direct:
avr-gcc -mmcu=atmega328p -Wall -flto -g -Os -c main.c -o main.c.elf --verbose
@ladislas
ladislas / .ycm_extra_conf.py
Created September 9, 2019 14:31
YCM for mbed
import os
import ycm_core
# You can set a directory with a lot of libraries to be search recursively here
nestedLibDirs = ["lib"]
include_flags = [
'-I.'
,'-I./mbed-os'
,'-I./mbed-os/cmsis'
AVR only; support -C for AVR memory usage - Rev1
Source: http://git.makehackvoid.com/cgi-bin/gitweb.cgi?p=mhvavrtools.git;a=blob_plain;f=mhvavrtools/patches/binutils-001-avr-size.patch;h=e80d28eae46217551d996a2253256c97d10aa4b5;hb=refs/heads/master
===========================================================
--- binutils/size.c
+++ binutils/size.c
@@ -34,10 +34,31 @@
#include "getopt.h"
#include "bucomm.h"
@ladislas
ladislas / buffer.swift
Created October 17, 2018 14:06
Swift Buffer
//
// Buffer.swift
// SwiftSerialport
//
// Created by Ladislas de Toldi on 09/10/2018.
//
import Foundation
public class Buffer {