Skip to content

Commit 8ae151b

Browse files
author
Rajmund Szymanski
committed
updated examples
1 parent 15a607a commit 8ae151b

File tree

5 files changed

+21
-11
lines changed

5 files changed

+21
-11
lines changed

IntrOS/README

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,14 @@ Features:
2222
- timers (one-shot, periodic)
2323
- all documentation is contained within the source files
2424
---------
25+
2.8
26+
- updated OS_TMR / static_TMR macros
27+
- added OS_TMR_DEF / static_TMR_DEF macros
28+
- updated OS_WRK / static_WRK macros
29+
- renamed OS_DEF / static_DEF macros to OS_WRK_DEF / static_WRK_DEF
30+
- renamed OS_NEW / static_NEW macros to OS_TSK_DEF / static_TSK_DEF
31+
- updated examples
32+
---------
2533
2.7
2634
- added tick-less mode
2735
- function core_tsk_break renamed to core_tsk_switch

examples/main.c (demo 2)

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@ void proc(volatile unsigned *led, unsigned timePoint)
1010
}
1111
}
1212

13-
OS_DEF(t1, 256) { proc(&LED[0], SEC/8*0); }
14-
OS_DEF(t2, 256) { proc(&LED[1], SEC/8*1); }
15-
OS_DEF(t3, 256) { proc(&LED[2], SEC/8*2); }
16-
OS_DEF(t4, 256) { proc(&LED[3], SEC/8*3); }
17-
OS_DEF(t5, 256) { proc(&GRN, SEC/8*4); }
13+
OS_WRK_DEF(t1, 256) { proc(&LED[0], SEC/8*0); }
14+
OS_WRK_DEF(t2, 256) { proc(&LED[1], SEC/8*1); }
15+
OS_WRK_DEF(t3, 256) { proc(&LED[2], SEC/8*2); }
16+
OS_WRK_DEF(t4, 256) { proc(&LED[3], SEC/8*3); }
17+
OS_WRK_DEF(t5, 256) { proc(&GRN, SEC/8*4); }
1818

1919
int main()
2020
{

examples/main.c (memory pool)

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33

44
OS_MEM(mem, 1, sizeof(unsigned));
55
OS_BOX(box, 1, sizeof(void*));
6-
OS_TSK(sla, slave);
7-
OS_TSK(mas, master);
86

97
void slave()
108
{
@@ -32,6 +30,9 @@ void master()
3230
}
3331
}
3432

33+
OS_TSK(sla, slave);
34+
OS_TSK(mas, master);
35+
3536
int main()
3637
{
3738
LED_Init();

examples/main.c (timer 1)

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,6 @@
22
#include <os.h>
33

44
OS_SEM(sem, 0);
5-
OS_TSK(sla, slave);
6-
OS_TMR(tmr, proc);
75

86
void slave()
97
{
@@ -16,6 +14,9 @@ void proc()
1614
sem_give(sem);
1715
}
1816

17+
OS_TSK(sla, slave);
18+
OS_TMR(tmr, proc);
19+
1920
int main()
2021
{
2122
LED_Init();

examples/main.c (timer 2)

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#include <stm32f4_discovery.h>
22
#include <os.h>
33

4-
OS_TMR(tmr, proc);
5-
64
void proc()
75
{
86
LED_Tick();
97
}
108

9+
OS_TMR(tmr, proc);
10+
1111
int main()
1212
{
1313
LED_Init();

0 commit comments

Comments
 (0)