ContikiClock enhance controling rTimer resolution and CLOCK_SECOND #39
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
this patch provide mote control of cooja ContikiClock controling rTimer resolution and CLOCK_SECOND. It work in cooperate with contiki-ng PR #1257 , that provide mote-side resolution control.
Since resolution of mote polling was hard-fixed on 1ms, this accuracy not enough for TSCH stack simulate. A bit changes on slot-operation timing algorithm crushes abylity to syncheonise TSCH motes with each other, since this accuracy can`t be less then 1ms. (Present stack surprisingly takes into sync, bu with the cost of not accurate sync of transmition slot start - it is adjust transmition to 1ms granularity. Looks that sync achieves only with RTIMER_GUARD=0 ).
To provide cooja with accurate syncronise need allow RTIMER_BUSY_WAIT work with accuracy of rtmer, hat demanded by TSCH stack about 32kHz. (but even 8rHz pretty enough)
So for precise resolution, no any cooja sim project changes need to do - it takes mote project RTIMER_CONF_ARCH_SECOND into account, if mote build with PR #1257.
Evaluated roesolution display in log, and saves with .csc project, so, later, this setup loads with project. And if mote have no resolution setup, saved one used as default.
So there:
resolution of system clock was hard-fixed on 1kHz, now mote can provide it by simCLOCK_SECOND
mote can provide resolution for rTimer by simRtimerResolution_hz. This affects polling period of mote.
By default cooja polls mote by 1ms. But for accurate process better time precision
need polling with less then 1ms. rTimer also ordinary much more precise.
RTIMER_BUSY_WAIT resolution was downgraded to 1ms. now Mote can provide time for precise wait via simRtimerWaitTime.