Instantly share code, notes, and snippets.

Embedded systems software engineering
- SLAC@slaclab
- SF Bay Area
- 17:16
(UTC -07:00) - https://jlorelli.xyz
This file contains hidden or 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
#!/usr/bin/env python3 | |
# vim: et sw=4 ts=4 | |
# Preprocess a compile_commands.json so that it plays nice with clangd | |
# Does the following: | |
# - removes arguments that clangd cannot understand (i.e. -qrtems) | |
# - Adds -I for each -B search path | |
# - Adds built-in compiler include paths to the command line | |
# This script is public domain |
This file contains hidden or 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
#!/usr/bin/env python3 | |
fromclang.cindeximportIndex,Cursor,CursorKind,TranslationUnitLoadError,TranslationUnit | |
importargparse | |
importjson | |
importos | |
fromdataclassesimportdataclass | |
importclang.cindex |
JJL772 /kernel-warnings.cpp
CreatedDecember 5, 2024 02:27
Code to reproduce the write-back/uncache-minus memory mismatch in aes-stream-drivers This file contains hidden or 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"getopt.h" | |
#include<stdlib.h> | |
#include<stdio.h> | |
#include<string.h> | |
#include"DmaDriver.h" | |
#defineAXI_VERSION_OFFSET0x20000 |
For all examples, we will be using/epics
as the root directory for the EPICS install. Please substitute with your own directory.
- Complete EPICS documentation can be found here:https://docs.epics-controls.org/en/latest/
- Documentation about the EPICS build system:https://docs.epics-controls.org/en/latest/build-system/specifications.html
- EPICS base:https://github.com/epics-base
- EPICS modules:https://github.com/epics-modules
JJL772 /device-versions.md
CreatedJune 16, 2023 01:03
This file contains hidden or 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
addonsystem: | |
- handle mounting/unmounting of addons | |
- download/upload of UGC files | |
- mounting/unmounting of games too? |
JJL772 /game-rules.md
Last activeJanuary 8, 2023 18:11
JJL772 /mimalloc-stub.c
Last activeJuly 15, 2022 00:22
Tiny library to override reallocarray for valgrind This file contains hidden or 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
// Compile with: gcc -o libmimalloc-proxy.so -shared mimalloc-stub.c | |
#include<stdlib.h> | |
#include<stddef.h> | |
void*reallocarray(void*ptr,size_tnmemb,size_tsize) { | |
returnrealloc(ptr,nmemb*size); | |
} |
NewerOlder