Skip to content

Commit 305dd4d

Browse files
committed
Updated readme.md
1 parent 397343a commit 305dd4d

File tree

5 files changed

+31
-25
lines changed

5 files changed

+31
-25
lines changed

‎README.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,12 @@ In spanish, RTOS sounds like "fed up", so the author thought it would be appropr
6767
kuashio@gmail.com
6868

6969
## Known Bugs
70-
The current version does not use the PendSV handler for context switching, and so it has the potential of handling other interrupts while context-switching, resulting in a usage fault
70+
Please let me know :)
7171

7272
## License
7373
estamosRTOS is distributed under the ***DWYWADC*** license (Do Whatever You Want And Don't Complain).
7474

75-
By using estamosRTOS, you agree to the following terms:
75+
By downloading estamosRTOS, you agree to the following terms:
7676

7777
- Do whatever you want and don't complain.
7878

‎estamosRTOS.uvoptx‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -244,27 +244,27 @@
244244
<Wi>
245245
<IntNumber>0</IntNumber>
246246
<FirstString>`t1</FirstString>
247-
<SecondString>FF0000000000000000000000000000000000F03F01000000000000000000000000000000743100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000010000009A9999999999C93F1800000000000000000000000000000000000000A6050008</SecondString>
247+
<SecondString>FF0000000000000000000000000000000000F03F01000000000000000000000000000000743100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000010000009A9999999999C93F1000000000000000000000000000000000000000A6050008</SecondString>
248248
</Wi>
249249
<Wi>
250250
<IntNumber>1</IntNumber>
251251
<FirstString>`t2</FirstString>
252-
<SecondString>000080000000000000000000000000000000F03F01000000000000000000000000000000743200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000020000009A9999999999C93F1800000000000000000000000000000000000000A6050008</SecondString>
252+
<SecondString>000080000000000000000000000000000000F03F01000000000000000000000000000000743200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000020000009A9999999999C93F1000000000000000000000000000000000000000A6050008</SecondString>
253253
</Wi>
254254
<Wi>
255255
<IntNumber>2</IntNumber>
256256
<FirstString>`t3</FirstString>
257-
<SecondString>000000000000000000000000000000000000F03F01000000000000000000000000000000743300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000030000009A9999999999C93F1800000000000000000000000000000000000000A6050008</SecondString>
257+
<SecondString>000000000000000000000000000000000000F03F01000000000000000000000000000000743300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000030000009A9999999999C93F1000000000000000000000000000000000000000A6050008</SecondString>
258258
</Wi>
259259
<Wi>
260260
<IntNumber>3</IntNumber>
261261
<FirstString>`t4</FirstString>
262-
<SecondString>FF00000000000000000000000000000000E06F4001000000000000000000000000000000743400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000040000009A9999999999C93F18000000000000000000000000000000000000000C070008</SecondString>
262+
<SecondString>FF00000000000000000000000000000000E06F4001000000000000000000000000000000743400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000040000009A9999999999C93F10000000000000000000000000000000000000000C070008</SecondString>
263263
</Wi>
264264
<Wi>
265265
<IntNumber>4</IntNumber>
266266
<FirstString>`sched</FirstString>
267-
<SecondString>0080000000000000000000000000000000E06F4001000000000000000000000000000000736368656400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000050000009A9999999999C93F1800000000000000000000000000000000000000C4060008</SecondString>
267+
<SecondString>0080000000000000000000000000000000E06F4001000000000000000000000000000000736368656400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001000000050000009A9999999999C93F1000000000000000000000000000000000000000C4060008</SecondString>
268268
</Wi>
269269
</LogicAnalyzers>
270270
</TargetOption>

‎estamosRTOS_MCU.h‎

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@
2929
// Uncomment the following line to enable debug mode
3030
// #define ESTAMOSRTOS_DEBUG
3131
// ... or the following line to only enable logic analyzer signals
32-
#define ESTAMOSRTOS_LOGIC_ANALYZER
32+
//#define ESTAMOSRTOS_LOGIC_ANALYZER
33+
3334

3435
// Specific MCU definition
3536
#ifndef MCU_STM32F303X8
@@ -66,11 +67,16 @@
6667
#define SVC_MISC 0x33
6768

6869

69-
#ifndef EXIT_SUCCESS
70-
#define EXIT_SUCCESS 0
70+
#ifdef EXIT_SUCCESS
71+
#define ESTAMOSRTOS_EXIT_SUCCESS EXIT_SUCCESS
72+
#else
73+
#define ESTAMOSRTOS_EXIT_SUCCESS 0
7174
#endif
72-
#ifndef EXIT_FAILURE
73-
#define EXIT_FAILURE 1
75+
76+
#ifdef EXIT_FAILURE
77+
#define ESTAMOSRTOS_EXIT_FAILURE EXIT_FAILURE
78+
#else
79+
#define ESTAMOSRTOS_EXIT_FAILURE 1
7480
#endif
7581

7682

‎estamosRTOS_asm.S‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ estamosRTOS_asm_launch PROC
4646
; The PendSV_Handler switches stack pointer spaces
4747
; by moving the MSP (for now) to the next task's allocated buffer.
4848
;
49-
; This Handler code was almost entirely borrowed from Jon Valvano's RTOS code.
49+
; This Handler code was mostly borrowed from Jon Valvano's RTOS code.
5050
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
5151
PendSV_Handler PROC ; R0-R3,R12,LR,PC,PSR saved by SysTick or other
5252
; tail-chained interrupt/exception.
@@ -91,12 +91,12 @@ estamosRTOS_mutex_lock PROC
9191
CMP R1, #0 ; 0 means success in STREX
9292
BNE was_locked
9393
94-
MOV R0, #EXIT_SUCCESS
94+
MOV R0, #ESTAMOSRTOS_EXIT_SUCCESS
9595
BX LR ; Return success
9696

9797
was_locked
9898
CLREX
99-
MOV R0, #EXIT_FAILURE
99+
MOV R0, #ESTAMOSRTOS_EXIT_FAILURE
100100
BX LR ; Return failure
101101
ENDP
102102

‎main.c‎

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ uint8_t t1=0,t2=0,t3=0,t4=0;
1919
uint8_t iterations[4]={2,5,3,4};
2020

2121
void task1(){
22-
volatile unsigned int i=0, j=0, k=0;
22+
volatile int i=0, j=0, k=0;
2323
while(1){
2424
t1=t1?0:1;
25-
i=iterations[k++%4];
25+
i=iterations[k++&0xf];
2626
while(estamosRTOS_mutex_lock(&my_mutex)){
2727
//TODO: Yield();
2828
estamosRTOS_yield();
@@ -34,7 +34,7 @@ void task1(){
3434
}
3535
estamosRTOS_mutex_unlock(&my_mutex);
3636

37-
i=iterations[k++%4]*980;
37+
i=iterations[k++&0xf]*980;
3838
while(i--){
3939
j=40-i*j;
4040
j=60-i*7;
@@ -44,7 +44,7 @@ void task1(){
4444
}
4545

4646
void task2(){
47-
volatile unsigned int i=0, j=0, k=0;
47+
volatile int i=0, j=0, k=0;
4848
while(1){
4949
t2=t2?0:1;
5050
i=20;
@@ -54,7 +54,7 @@ void task2(){
5454
j=60-i*7;
5555
i=j+70;
5656
i=80;
57-
i=iterations[k++%4];
57+
i=iterations[k++&0xf];
5858
while(estamosRTOS_mutex_lock(&my_mutex)){
5959
estamosRTOS_yield();
6060
}
@@ -65,7 +65,7 @@ void task2(){
6565
}
6666
estamosRTOS_mutex_unlock(&my_mutex);
6767

68-
i=iterations[k++%4]*230;
68+
i=iterations[k++&0xf]*230;
6969
while(i--){
7070
j=40-i*j;
7171
j=60-i*7;
@@ -75,10 +75,10 @@ void task2(){
7575
}
7676

7777
void task3(){
78-
volatile unsigned int i=0, j=0, k=0;
78+
volatile int i=0, j=0, k=0;
7979
while(1){
8080
t3=t3?0:1;
81-
i=iterations[k++%4];
81+
i=iterations[k++&0xf];
8282
if(!estamosRTOS_mutex_lock(&my_mutex)){
8383
while(i--){
8484
t3=t3?0:1;
@@ -98,10 +98,10 @@ void task3(){
9898
}
9999

100100
void task4(){
101-
volatile unsigned int i=0, j=0, k=0;
101+
volatile int i=0, j=0, k=0;
102102
while(1){
103103
t4=t4?0:1;
104-
i=iterations[k++%4];
104+
i=iterations[k++&0xf];
105105
if(!estamosRTOS_mutex_lock(&my_mutex)){
106106
while(i--){
107107
t4=t4?0:1;

0 commit comments

Comments
 (0)