more docs, fixes, examples

This commit is contained in:
2020-10-31 21:57:36 +01:00
parent 735f871ea0
commit f87d822432
5 changed files with 32 additions and 8 deletions
+8 -3
View File
@@ -1,16 +1,21 @@
(
; This example shows the use of critical sections.
; Set short timeslice (50us) to make the effect more pronounced
(rt-opt RT_TIMESLICE 50)
(spawn _ unsafe 'A' 'Z')
(spawn _ safe '0' '9')
(ssleep 2)
(spawn _ unsafe 'a' 'z')
(spawn _ safe '0' '9') ; Notice that the sequence 0-9 is always printed in its entirety - because it is in a critical section
(msleep 200)
(halt)
(proc unsafe start end
; This can be interrupted any time
(:x)
(yield)
(ld r0 start)
(:l)
(msleep 5)
(ld @cout r0)
(cmp r0 end)
(j.eq :x)