Skip to content

Instantly share code, notes, and snippets.

View lesterlo's full-sized avatar
😽
Cat Lover

Lester Lo lesterlo

😽
Cat Lover
View GitHub Profile
@lesterlo
lesterlo / zub1cg.dtsi
Created January 3, 2025 15:20
zuboard custom device tree for Xilinx SDTgen workflow
#include "include/dt-bindings/input/input.h"
#include "include/dt-bindings/interrupt-controller/irq.h"
#include "include/dt-bindings/gpio/gpio.h"
#include "include/dt-bindings/pinctrl/pinctrl-zynqmp.h"
#include "include/dt-bindings/phy/phy.h"
/ {
chosen {
bootargs = "earlycon console=ttyPS0,115200 clk_ignore_unused root=/dev/mmcblk0p2 rw rootwait cma=512M";
nvmem0 = &eui_eepromm;
@lesterlo
lesterlo / .Xresources
Created December 9, 2024 20:11
My xterm settings
XTerm*faceName: Monospace
XTerm*faceSize: 15
xterm*background: black
xterm*foreground: white
@lesterlo
lesterlo / main.cpp
Created November 25, 2024 20:46
My first FreeRTOS code
#include "FreeRTOS.h"
#include "task.h"
#include "xil_printf.h"
#include "xparameters.h"
#define DELAY_5s 5000UL
#define DELAY_1s 1000UL
//Thread implementation
@lesterlo
lesterlo / init_yocto.sh
Last active November 18, 2024 16:40
Initialize my recommended Yocto structure
git clone git://git.yoctoproject.org/poky $1
cd $1
git checkout -t origin/scarthgap -b my-scarthgap
source ./oe-init-build-env
# Download required layer's files
git clone git://git.yoctoproject.org/meta-xilinx ../meta-xilinx -b scarthgap
git clone git://git.yoctoproject.org/meta-xilinx-tools ../meta-xilinx-tools -b scarthgap
git clone https://github.com/OpenAMP/meta-openamp.git ../meta-openamp -b scarthgap
@lesterlo
lesterlo / fix_rlwrap.patch
Last active November 16, 2024 06:38
Replacement of "petalinux-boot jtag --prebuilt 3 --hw_server-url "
mv ./build/xsct/Vitis/2024.1/bin/unwrapped/lnx64.o/rlwrap ./build/xsct/Vitis/2024.1/bin/unwrapped/lnx64.o/rlwrap.old;
ln -s /usr/bin/rlwrap ./build/xsct/Vitis/2024.1/bin/unwrapped/lnx64.o/rlwrap;
@lesterlo
lesterlo / run.sh
Last active July 11, 2024 03:24
Build a gitbook from source to PDF
# https://stackoverflow.com/questions/58498643/no-result-or-error-when-using-gitbook-pdf
# Must use calibre-3.48.0, https://download.calibre-ebook.com/3.48.0/
# Otherwise, no photo will be generated
$ ln -s /Applications/calibre.app/Contents/MacOS/ebook-convert /opt/homebrew/bin/ebook-convert
$ npm install @gitbook-ng/gitbook
const int INTERVAL = 10;
uint64_t _previous_msTimeNow=0;
void loop_A()
{
uint64_t msTimeNow = std::chrono::duration_cast<std::chrono::milliseconds>(std::chrono::system_clock::now().time_since_epoch()).count();
if(msTimeNow % INTERVAL == 0)
{
doSomething();
}
@lesterlo
lesterlo / additional_install.sh
Last active March 1, 2024 15:49
Nvidia sdkmamger
sudo apt install libxshmfence1 libglu1 libatk-bridge2.0-0 libatk-bridge2.0-0 libgbm1 libx11-xcb-dev
@lesterlo
lesterlo / .condarc
Last active January 12, 2023 03:54
Backup all environment from anaconda
# Place this to your home directories
# If you use this config, all of the envs will store into your home directories
channels: [conda-forge]
auto_activate_base: false
envs_dirs:
- /Users/"YOUR_HOME_DIR"/.conda/envs