File tree Expand file tree Collapse file tree 4 files changed +17
-17
lines changed Expand file tree Collapse file tree 4 files changed +17
-17
lines changed Original file line number Diff line number Diff 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}
Original file line number Diff line number Diff 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}
Original file line number Diff line number Diff line change 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
76void slave()
87{
9- sem_wait(& sem);
8+ sem_wait(sem);
109 LED_Tick();
1110}
1211
1312void 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
2020int 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}
Original file line number Diff line number Diff line change 11#include <stm32f4_discovery.h>
22#include <os.h>
33
4- tmr_t tmr = TMR_INIT();
5-
64void proc()
75{
86 LED_Tick();
97}
108
9+ OS_TMR(tmr, proc);
10+
1111int main()
1212{
1313 LED_Config();
1414
15- tmr_startPeriodic(& tmr, SEC, proc );
15+ tmr_startPeriodic(tmr, SEC);
1616 tsk_stop();
1717}
You can’t perform that action at this time.
0 commit comments