using in main() chSemResetI and so on Topic is solved

Discussions and support about ChibiOS/NIL, the almost nil RTOS.
Alex
Posts: 33
Joined: Sat Feb 22, 2014 2:40 pm
Been thanked: 3 times

using in main() chSemResetI and so on  Topic is solved

Postby Alex » Tue Mar 15, 2016 12:52 pm

Can i use functions chSemResetI(), chSemGetCounterI() and so on after chSysInit() ?

User avatar
RoccoMarco
Posts: 655
Joined: Wed Apr 24, 2013 4:11 pm
Location: Munich (Germany)
Has thanked: 83 times
Been thanked: 67 times
Contact:

Re: using in main() chSemResetI and so on

Postby RoccoMarco » Tue Mar 15, 2016 1:19 pm

Yes you can do this. Take a look to os\nil\include\nil.h: all the functions and macros available in NIL are declared here. Otherwise you can look the documentation here under the voice Modules/NIL Kernel/API

Ciao,
RM

User avatar
Giovanni
Site Admin
Posts: 14444
Joined: Wed May 27, 2009 8:48 am
Location: Salerno, Italy
Has thanked: 1074 times
Been thanked: 921 times
Contact:

Re: using in main() chSemResetI and so on

Postby Giovanni » Tue Mar 15, 2016 1:56 pm

The main is the idle thread in NIL. You can use any I-class function as follow:

Code: Select all

chSysLock();
chSemResetI(...);
chSchRescheduleS();
chSysUnlock();


Of course you could just do:

Code: Select all

chSemReset(...);


You cannot call there those functions that can case the thread to sleep, for example: chThdSleep(), chSemWait() etc.

Giovanni


Return to “ChibiOS/NIL”

Who is online

Users browsing this forum: No registered users and 3 guests