This snippet provides a generic implementation of a singly linked list. Each value in the list points forward to the next item.
Currently only supports one list per VM, which is acceptable for my use case.
+------+
|LINK |---*
+------+ |
1780 700 410 | |
1790 700 410 | |
1790 770 410 | |
1730 760 413 | |
1780 720 413 | |
1780 770 413 | |
1790 780 413 | |
1770 700 417 | |
1790 680 417 | |
1740 750 420 |
1000 1000 450 | |
1000 1010 450 | |
1000 1020 450 | |
1000 1030 453 | |
1000 1040 450 | |
1000 1050 453 | |
1000 1060 450 | |
1000 210 443 | |
1000 220 447 | |
1000 230 447 |
:activate-burners 'Burners_ON s:put nl ;
:begin-timer 'Timer_SET s:put nl ;
:toaster.on-start hook ;
:activate-toaster toaster.on-start activate-burners begin-timer ;
:custom-callback 'Hello_from_my_callback s:put nl ;
Run without callbacks:
[ 0.000000] Booting Linux on physical CPU 0x0 | |
[ 0.000000] Linux version 5.10.9-v7+ (dom@buildbot) (arm-linux-gnueabihf-gcc-8 (Ubuntu/Linaro 8.4.0-3ubuntu1) 8.4.0, GNU ld (GNU Binutils for Ubuntu) 2.34) #1396 SMP Thu Jan 21 15:54:00 GMT 2021 | |
[ 0.000000] CPU: ARMv7 Processor [410fd034] revision 4 (ARMv7), cr=10c5383d | |
[ 0.000000] CPU: div instructions available: patching division code | |
[ 0.000000] CPU: PIPT / VIPT nonaliasing data cache, VIPT aliasing instruction cache | |
[ 0.000000] OF: fdt: Machine model: Raspberry Pi 3 Model B Rev 1.2 | |
[ 0.000000] earlycon: uart8250 at MMIO32 0x3f215040 (options '') | |
[ 0.000000] printk: bootconsole [uart8250] enabled | |
[ 0.000000] Memory policy: Data cache writealloc | |
[ 0.000000] Reserved memory: created CMA memory pool at 0x37400000, size 64 MiB |
This is a beta feature. For early access, consider donating to the RetroForth Patreon.
Retro exposes multitasking as an I/O device at the VM layer.
#900 'task:DEVICE_ID const
@wait_time 25 | |
# Base case: We have a pid | |
def wait_for(pid) when is_pid(pid), do: continue_waiting(pid) | |
# Failure case: We failed to find a pid for a module. | |
def wait_for(nil), do: raise("Attempted to wait on bad module/pid") | |
# Edge case: We have a module and need to try finding its pid. | |
def wait_for(mod), do: wait_for(Process.whereis(mod)) | |
defp continue_waiting(pid) do | |
wait(pid, Process.info(pid, :message_queue_len)) |
Reference before I try a new Nerves System build | |
---Not included, Probably not important: | |
CONFIG_VIDEO_USBTV=m (USB TV Tuners) | |
CONFIG_USB_PWC_DEBUG=y (Debug support for a Phillis brand camera) | |
CONFIG_USB_S2255=m (Support for what appears to be a USB card for video studios) | |
BR2_PACKAGE_V4L2GRAB=y (Virtual video devices) | |
BR2_PACKAGE_V4L2LOOPBACK_UTILS=y (Virtual video devices) | |
BR2_PACKAGE_V4L2LOOPBACK=y (Virtual video devices) | |
Not included, will add: |