From 1ec4500b945384f34e21855f580cfc0de3311284 Mon Sep 17 00:00:00 2001 From: LailaTheElf Date: Fri, 26 Sep 2025 17:18:54 +0200 Subject: [PATCH] spellcheck --- assets/assignment_4.2.zip | Bin 332533 -> 333139 bytes report-2/week_1.3.md | 16 ++++++++-------- report-2/week_1.4.md | 22 +++++++++++++--------- 3 files changed, 21 insertions(+), 17 deletions(-) diff --git a/assets/assignment_4.2.zip b/assets/assignment_4.2.zip index 74c8e5b845b279e8f81be7ac37dc0158693fdd6c..f474ba3457e5d882803645bdc7ce69ed7a0d48fa 100644 GIT binary patch delta 7246 zcmbVRc|4SB8-8cZj4{L51~DB=N%mcqNS4M{w(OKW`$`t5zu)`ET-SX+_kF+5{anw?UB*8w#j9Ieup#gO z8jS`vMd-K!KbSc5ObiGO_KkP<+`BixFEqqAG)mlET~W0{;U1Ulr|{K3mtgwyN&;>g zPST*G7i0Q+CB^W_us~n$sA{`iR?Xu0{R1t_<^PJe&EN8o5}m7IkwD4m*Hii@(!?6W zMIkQNQL5FV+sfK5apyJHrm_uZbnnJ!m-adp^sDP^^y@_n_)Fn05J^|tTVLC&TUedU z?E8BoBKDwQnsmP7z7NtiRSi)RSuKw>svW}ZFGd#5ZOE03P!qPhczkQI+3*SYkjo&d zMX#zP#V7tKk2O}!-CQ6jC&n{G%OL%aD$^wG@mDe?10B6Q6cmSvJ;g7$cHa80X5q%# z(cdwAB_d&RGVO*38hK8Wx+3_d1#ZIw;{+yj*3KW5+=AAT{vBs0qn_*F+E`XU*r0D5 zmOI6l5a=iz+`l<}aY%Atp{yonYqi0;H5qW(Nbs6y%zXT)w9%WQ@#6m6_R-A=x-Aor zwtn8<>3UfEtP3!>VPNl{8=G&c_-WWD$;TEYUliQ~F4fz5IXE;2XM4EZ9u=GN`)x3C zM;NZ^jmA=eqb824h9tjO)=RLqU`MlCCSThF1AuM>0MMF(zRD&{s|F?@kt&%;{wP@i zx=L?iipk95Uq|W<9aP5e-_!S{@djnLECC&rM0Bumx@va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!i^0Dgo!8EksK?V zSF^jF_q#T@`{1FkFN4abbl5TW|E*oDW<1>h06yJ=(X5>Z!LZTh2@`j5td5&G^d#`x zUI3UXhSQ9@WI~56;aDB_?9z$&@1_9IIZQjQ&5ey&J#}c!rbPP1PuT*%enU9T>`7B} zR5YO~!!d?GPD=v7nQ{PF-@Ipx5F71*AhDfuwFyi;d*Ji{Y@C%PFdBB)pAM_VwaV&s z+@7@p-{lX%qFaA%OQa2143Wr%4XJoYWcve&gzZ zVkjP@_{vhdCV7lA!8gQFu)(ayl!l-f==*pekLM18L8>)~p91?6)dH>s=Ll4yj0Y)& zrTW32FI-eVxE7^vp%^CyDY7!*XKrB+G2m_G{%+b=x%U_p1Mg;=h$)!Wtt~IV#5fDS z6Li2%ynbuD=AbNiTa#WHG67K`Gy`I4AV$5Xt%dY56x+;;ltdq32Y^5X$N>KbTGCl) diff --git a/report-2/week_1.3.md b/report-2/week_1.3.md index dbff569..af3fc9b 100644 --- a/report-2/week_1.3.md +++ b/report-2/week_1.3.md @@ -56,7 +56,7 @@ int main(void) } ``` -I measured the resulting frequency with an logic analyser ([[#logic-analiser-view-of-LEDs-for-assignment-31]]; channels are collerd to the led color). It measuerd a period time of $499.568ms$, I call this error could be my cheap logic analyser or en error in the internal oscilator. +I measured the resulting frequency with an logic analyser ([[#logic-analiser-view-of-LEDs-for-assignment-31]]; channels are coloured to the led colour). It measured a period time of $499.568ms$, I call this error could be my cheap logic analyser or en error in the internal oscillator. ![Logic analiser view of LEDs for assignment 3.1](https://live.kladjes.nl/uploads/84591270-95b0-4601-aea2-ca44b51adbf9.png) @@ -152,7 +152,7 @@ int main(void) > C) Why must the flag variable be defined as volatile? -becouse the compiler doesn't know when `flag` changes. Without `volatile` optimisations can think it does not change at all. +because the compiler doesn't know when `flag` changes. Without `volatile` optimisations can think it does not change at all. ## assignment 3.4 @@ -290,13 +290,13 @@ int main(void) } ``` -Again I validated the timesing with the logicanalyser. +Again I validated the timings with the logic-analyser. ![](https://live.kladjes.nl/uploads/16fe6424-cff1-4ce4-b506-7f8d87ec4dc4.png) ## assignment 3.6 -> - reate a copy of the previous project and rename it to opdr_3_6. +> - create a copy of the previous project and rename it to opdr_3_6. > - Using the description of this assignment, define a struct for a “task” and create a global array of 8 empty tasks. > - Create a function `addTask(...)` to help create a task from a function pointer and other parameters, and add it to the task list (the array) at an appropriate index. > - Create 4 functions to toggle each led separately, these are the functions that will correspond to 4 tasks. @@ -428,9 +428,9 @@ int main(void) ## Assignment 3.7 -> Now add initial delays5 (in systicks) to your tasks. Use an initial delay of 100, 200, 300, and 400 for green, orange, red, and blue respectively. Make use of a logic analyzer to verify the timing. +> Now add initial delays (in systicks) to your tasks. Use an initial delay of 100, 200, 300, and 400 for green, orange, red, and blue respectively. Make use of a logic analyser to verify the timing. -When A task is created, in the version of [[#Assignment 3.7]], the folloing function is used: +When A task is created, in the version of [[#Assignment 3.7]], the following function is used: ```c bool addTask(void (*fn)(void), uint32_t counter) @@ -446,9 +446,9 @@ bool addTask(void (*fn)(void), uint32_t counter) } ``` -Here the `counter` and `counter_rst` menbers are set to the same value. `counter` is the counter that is decremented eacht SysClock. `counter_rst` is the value `counter` is reset to if it reachts 0 after the task is run. +Here the `counter` and `counter_rst` members are set to the same value. `counter` is the counter that is decremented each SysClock. `counter_rst` is the value `counter` is reset to if it reacts 0 after the task is run. -Setting `counter` to the initail delay already solves this assignment. The foloing code implements this change. +Setting `counter` to the initial delay already solves this assignment. The following code implements this change. ```c {.numberLines} #include diff --git a/report-2/week_1.4.md b/report-2/week_1.4.md index 25a8386..b9a25ab 100644 --- a/report-2/week_1.4.md +++ b/report-2/week_1.4.md @@ -11,15 +11,15 @@ ![](https://live.kladjes.nl/uploads/1cdce708-a2e7-4a3d-b727-d5423b892687.png) -In the Code it the values for blocking delay are 100, 200, 400, 800 for green, orange, red, blue. The `blocking_delay` function wait for this number of SysTicks, witch is set to $1ms$. I measure delays of $0.4s$, $0.8s$, $1.6s$ and $3.2s$. This is indeed 4x slower of what I would expect on first flance. This delay is becouse this is a preemtive scheduler, the other tasks run in between. There are 4 task all with the same priority, so each task takes 4 time longer. +In the Code it the values for blocking delay are 100, 200, 400, 800 for green, orange, red, blue. The `blocking_delay` function wait for this number of SysTicks, witch is set to $1ms$. I measure delays of $0.4s$, $0.8s$, $1.6s$ and $3.2s$. This is indeed 4x slower of what I would expect on first glance. This delay is because this is a preemptive scheduler, the other tasks run in between. There are 4 task all with the same priority, so each task takes 4 time longer. ## Assignment 4.2 -> A) mplement a non-blocking delay so that a task can request the OS to be kept out of the scheduling loop for a certain number of system ticks. The scheduler should remain preemptive and perform round-robin on all the available(not delayed) tasks. Once the requested number of system ticks have passed, the scheduler should include the task in the selection process. You may use the `taskYield()` function to let the OS know a task is ready to be switched out. +> A) implement a non-blocking delay so that a task can request the OS to be kept out of the scheduling loop for a certain number of system ticks. The scheduler should remain preemptive and perform round-robin on all the available(not delayed) tasks. Once the requested number of system ticks have passed, the scheduler should include the task in the selection process. You may use the `taskYield()` function to let the OS know a task is ready to be switched out. -To allow for a non blocking delay the OS sould keep track of the time the to wake it up on the corect time. I did this by adding the new task state `SLEEPING_DELAY` to the enum. +To allow for a non blocking delay the OS should keep track of the time the to wake it up on the correct time. I did this by adding the new task state `SLEEPING_DELAY` to the `enum`. -There already is an counter in the task struct. but no function that decrements this counter. So I added the folloing function the the OS. +There already is an counter in the task struct. but no function that decrements this counter. So I added the following function the the OS. ```c void decrement_sleeping_delay() @@ -41,9 +41,9 @@ void decrement_sleeping_delay() } ``` -This function is added to the `SysTick_Handeler` before the cudeule is run. So that if the counter is 0 the `decrement_sleeping_delay` makes the task ready again, and waits one more SysTick. +This function is added to the `SysTick_Handeler` before the scheduler is run. So that if the counter is 0 the `decrement_sleeping_delay` makes the task ready again, and is directly available for to be scheduled. This makes a delay of 0, wait for the next SysTick. -The `SysTick_Handeler` now look like the folloing +The `SysTick_Handeler` now look like the following ```c void SysTick_Handler(void) @@ -58,7 +58,7 @@ void SysTick_Handler(void) } ``` -Before stating to write the delay function for the tasks, in the `schedule` funciton the line that sets the current task to ready sould be removed (line 163 in `VersdOS.c`). If the state is chanced during execution of the task, this line reset is at the next try to reschedule ths state back to `READY` so the state will never actualy be changed. +Before stating to write the delay function for the tasks, in the `schedule` funciton the line that sets the current task to ready sould be removed (line 163 in `VersdOS.c`). If the state is chanced during execution of the task, this line reset is at the next try to reschedule this state back to `READY` so the state will never actually be changed. As last the delay function itself. @@ -75,6 +75,10 @@ Now all the line `extern void delay(uint32_t ticks);` can be added to the begin ### Result -![](https://live.kladjes.nl/uploads/c65810e2-a5fc-48f3-be6b-2f30acc5747a.png) +![logic-analyser measurement of the preemptive scheduler](https://live.kladjes.nl/uploads/c65810e2-a5fc-48f3-be6b-2f30acc5747a.png) + +This implementation works, only the delays are a bit off. To make it a nice counter again all delays should be decremented by one (figure [[#logic-analyser measurement of the preemptive scheduler]] shows the output with the original timings, not the decremented ones). + +## Assignment 4.3 + -This implementation works, only the delays are a bit off. To make it a nice counter again all delays should be decremented by one.