Skip to content

Commit b665dfd

Browse files
author
Rajmund Szymanski
committed
updated examples
1 parent bef5b9b commit b665dfd

File tree

4 files changed

+17
-17
lines changed

4 files changed

+17
-17
lines changed

examples/main.c (demo 1)

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,10 +28,10 @@ int main()
2828
LED_Config();
2929
GRN_Config();
3030

31-
tsk_start((tsk_id)TSK_CREATE(proc));
32-
tsk_start((tsk_id)TSK_CREATE(proc));
33-
tsk_start((tsk_id)TSK_CREATE(proc));
34-
tsk_start((tsk_id)TSK_CREATE(proc));
35-
tsk_start((tsk_id)TSK_CREATE(proc));
31+
tsk_start(TSK_CREATE(proc));
32+
tsk_start(TSK_CREATE(proc));
33+
tsk_start(TSK_CREATE(proc));
34+
tsk_start(TSK_CREATE(proc));
35+
tsk_start(TSK_CREATE(proc));
3636
tsk_stop();
3737
}

examples/main.c (signal 2)

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ int main()
1919
{
2020
LED_Config();
2121

22-
tsk_start((tsk_id)TSK_CREATE(slave));
23-
tsk_start((tsk_id)TSK_CREATE(master));
22+
tsk_start(TSK_CREATE(slave));
23+
tsk_start(TSK_CREATE(master));
2424
tsk_sleep();
2525
}

examples/main.c (timer 1)

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

4-
sem_t sem = SEM_INIT(0);
5-
tmr_t tmr = TMR_INIT();
4+
OS_SEM(sem, 0);
65

76
void slave()
87
{
9-
sem_wait(&sem);
8+
sem_wait(sem);
109
LED_Tick();
1110
}
1211

1312
void proc()
1413
{
15-
sem_give(&sem);
14+
sem_give(sem);
1615
}
1716

18-
tsk_t sla = TSK_INIT(slave);
17+
OS_TSK(sla, slave);
18+
OS_TMR(tmr, proc);
1919

2020
int main()
2121
{
2222
LED_Config();
2323

24-
tsk_start(&sla);
25-
tmr_startPeriodic(&tmr, SEC, proc);
24+
tsk_start(sla);
25+
tmr_startPeriodic(tmr, SEC);
2626
tsk_stop();
2727
}

examples/main.c (timer 2)

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

4-
tmr_t tmr = TMR_INIT();
5-
64
void proc()
75
{
86
LED_Tick();
97
}
108

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

15-
tmr_startPeriodic(&tmr, SEC, proc);
15+
tmr_startPeriodic(tmr, SEC);
1616
tsk_stop();
1717
}

0 commit comments

Comments
 (0)