Hello Giovanni,
I don't see the documentation of the NIL 4.0.0, may be it is not released yet?
I'm looking on this page: http://www.chibios.org/dokuwiki/doku.php?id=chibios:documentation:start
I need to update AVR NIL demo because of new method on the NIL API.
THD_TABLE_ENTRY have been replace by THD_TABLE_THREAD in file: includet/ch.h:583:#define THD_TABLE_THREAD(_prio, _name, _wap, _funcp, _arg)
So I need to know the new parameters used by the new API. It is present in code source but I wanted to look at the online documentation.
Is there another place to look please?
NIL 4.0.0 Documentation
- Giovanni
- Site Admin
- Posts: 14455
- Joined: Wed May 27, 2009 8:48 am
- Location: Salerno, Italy
- Has thanked: 1076 times
- Been thanked: 922 times
- Contact:
Re: NIL 4.0.0 Documentation
Hii,
It is not yet released but you could look at the demos in trunk.
Note that there is a huge difference, threads can be defined in the table OR created at runtime. In chconf.h you can define how many priority level you need, then you can have one thread at each priority level (or none). It is not possible to have multiple threads at same priority, just like the previous NIL.
The table has one extra parameter for each thread: the priority:
In chconf.h:
In main.c:
Note that the "tester" thread needs 2 free priority levels before and after itself, it needs those empty slots to create its own threads during execution. Zero is the highest priority, the main has implicitly the lowest priority and is the idle thread (just like before).
Giovanni
It is not yet released but you could look at the demos in trunk.
Note that there is a huge difference, threads can be defined in the table OR created at runtime. In chconf.h you can define how many priority level you need, then you can have one thread at each priority level (or none). It is not possible to have multiple threads at same priority, just like the previous NIL.
The table has one extra parameter for each thread: the priority:
In chconf.h:
Code: Select all
/**
* @brief Maximum number of user threads in the application.
* @note This number is not inclusive of the idle thread which is
* implicitly handled.
* @note Set this value to be exactly equal to the number of threads you
* will use or you would be wasting RAM and cycles.
* @note This values also defines the number of available priorities
* (0..CH_CFG_MAX_THREADS-1).
*/
#if !defined(CH_CFG_MAX_THREADS)
#define CH_CFG_MAX_THREADS 8
#endif
In main.c:
Code: Select all
/*
* Threads creation table, one entry per thread.
*/
THD_TABLE_BEGIN
THD_TABLE_THREAD(0, "blinker1", waThread1, Thread1, NULL)
THD_TABLE_THREAD(1, "blinker2", waThread2, Thread2, NULL)
THD_TABLE_THREAD(4, "tester", waThread3, Thread3, NULL)
THD_TABLE_END
Note that the "tester" thread needs 2 free priority levels before and after itself, it needs those empty slots to create its own threads during execution. Zero is the highest priority, the main has implicitly the lowest priority and is the idle thread (just like before).
Giovanni
Who is online
Users browsing this forum: No registered users and 17 guests