Skip to content

Instantly share code, notes, and snippets.

giulio@builder:~/xenomai-images$ kas-container build kas.yml:board-beagle-bone-black.yml:opt-linux-latest-5.4.yml
2021-02-09 11:04:37 - INFO - kas 2.3.3 started
2021-02-09 11:04:37 - INFO - /repo$ git rev-parse --show-toplevel
2021-02-09 11:04:37 - INFO - /repo$ git rev-parse --show-toplevel
2021-02-09 11:04:37 - INFO - /repo$ git rev-parse --show-toplevel
2021-02-09 11:04:37 - INFO - /repo$ git rev-parse --show-toplevel
2021-02-09 11:04:37 - INFO - Using /repo as root for repository xenomai
2021-02-09 11:04:37 - INFO - /work/isar$ git remote set-url origin https://github.com/ilbers/isar.git
2021-02-09 11:04:37 - INFO - /work/isar$ git cat-file -t 1cfe166c5e53ae96bc07b895a92bf6cd7ace7bc9
2021-02-09 11:04:37 - INFO - Repository isar already contains 1cfe166c5e53ae96bc07b895a92bf6cd7ace7bc9 as commit
@giuliomoro
giuliomoro / render.cpp
Last active May 21, 2021 07:37
Bela: Compute CPU time for render()
#include <Bela.h>
#include <chrono>
bool setup(BelaContext* context, void* userArg)
{
// your initialisation code goes here
// ...
auto start = std::chrono::steady_clock::now();
unsigned int times = 10000;
for(unsigned int n = 0; n < times; ++n)
void loop(void*)
{
unsigned int logIdx = 0;
std::vector<float> logs(10000);
unsigned int writeFileSize = logs.size() + 5000;
freq_mod_tone_bela.setBufferSize(writeFileSize);
while(!Bela_stopRequested())
{
// Read locations from Trill sensor
#include <Bela.h>
#include <DigitalChannelManager.h>
#include <cmath>
#include <stdio.h>
#define PD_THREADED_IO
#include <libpd/z_libpd.h>
extern "C" {
#include <libpd/s_stuff.h>
};
#include <libraries/UdpServer/UdpServer.h>
/*
____ _____ _ _
| __ )| ____| | / \
| _ \| _| | | / _ \
| |_) | |___| |___ / ___ \
|____/|_____|_____/_/ \_\
The platform for ultra-low latency audio and sensor processing
http://bela.io
@giuliomoro
giuliomoro / flash_mainline.sh
Created September 23, 2019 12:19
update uboot (locally or remotely) on a single-partition SD card with BeagleBoard image.
#!/bin/bash -ex
MLO=MLO
IMG=u-boot.img
if [ ! "x${SSH_DEST}" = "x" ]; then
SSH_CMD="ssh -tt $SSH_DEST"
scp $MLO ${SSH_DEST}:MLO
scp $IMG ${SSH_DEST}:uboot.img
MLO=MLO
IMG=uboot.img
else
```
/*
* Default render file for Bela projects running Pd patches
* using libpd.
*/
#include <Bela.h>
#include <DigitalChannelManager.h>
#include <cmath>
#include <stdio.h>
/*
* Default render file for Bela projects running Pd patches
* using libpd.
*/
#include <Bela.h>
#include <DigitalChannelManager.h>
#include <cmath>
#include <stdio.h>
#define PD_THREADED_IO
@giuliomoro
giuliomoro / uEnv.txt
Last active October 16, 2018 00:39
uEnv.txt for CTAG image, place in /uEnv.txt
uenvcmd=echo loading am335x-bonegreen-ctag-face.dtb; load mmc ${mmcid}:1 ${fdtaddr} boot/dtbs/${uname_r}/am335x-bonegreen-ctag-face.dtb; if env exists uboot_overlay_addr0; then setenv overlay ${uboot_overlay_addr0}; run bela_loadoverlay; fi; if env exists uboot_overlay_addr1; then setenv overlay ${uboot_overlay_addr1}; run bela_loadoverlay; fi; if env exists uboot_overlay_addr2; then setenv overlay ${uboot_overlay_addr2}; run bela_loadoverlay; fi; if env exists uboot_overlay_addr3; then setenv overlay ${uboot_overlay_addr3}; run bela_loadoverlay; fi; if env exists uboot_overlay_addr4; then setenv overlay ${uboot_overlay_addr4}; run bela_loadoverlay; fi; if env exists uboot_overlay_addr5; then setenv overlay ${uboot_overlay_addr5}; run bela_loadoverlay; fi; if env exists uboot_overlay_addr6; then setenv overlay ${uboot_overlay_addr6}; run bela_loadoverlay; fi; if env exists uboot_overlay_addr7; then setenv overlay ${uboot_overlay_addr7}; run bela_loadoverlay; fi; load mmc ${mmcid}:1 ${loadaddr} /boot/vmlinuz-$
// Pass audio data between two RtThreads bi-directionally.
// This should create a slave RtThread.
// The master thread should be a RtThread.
// The master thread starts a transmission;
// the slave thread should be woken up when there is data available,
// process the data, and send data back to the master thread
// Uni-directional RT-safe-queue.
// A light wrapper around __wrap_mq_...
class DataFifo