Re: [riot-devel] Stop other thread
Thanks it works with highest priority and irq disabled 2016-07-13 13:56 GMT+02:00 Kaspar Schleiser : > Hey, > > On 07/13/2016 01:32 PM, Baptiste Clenet wrote: >> I've got a chip which needs precise timing to be read. A year ago, I >> was able to communicate with this chip but now, even if I go as fast I >> can it seems that timing have increased with same source code. >> So is there a way to force the CPU to do only one task at the time for >> the duration of the function. Can we tell the scheduler to stop other thread? > > two things might interrupt: > > 1. a thread with higher priority > > This can be solved by increasing the priority of the thread talking to > your code, possibly to the maximum. > (beware: lower priority value means higher priority) > > 2. interrupts > > If an interrupt messes with your timing, that can be prevented by > disabling interrupts for a time-critical section: > > unsigned state = irq_disable() > /* timing critical code */ > irq_restore(state); > > Kaspar > > > ___ > devel mailing list > devel@riot-os.org > https://lists.riot-os.org/mailman/listinfo/devel -- Baptiste ___ devel mailing list devel@riot-os.org https://lists.riot-os.org/mailman/listinfo/devel
Re: [riot-devel] Stop other thread
Hey, On 07/13/2016 01:32 PM, Baptiste Clenet wrote: > I've got a chip which needs precise timing to be read. A year ago, I > was able to communicate with this chip but now, even if I go as fast I > can it seems that timing have increased with same source code. > So is there a way to force the CPU to do only one task at the time for > the duration of the function. Can we tell the scheduler to stop other thread? two things might interrupt: 1. a thread with higher priority This can be solved by increasing the priority of the thread talking to your code, possibly to the maximum. (beware: lower priority value means higher priority) 2. interrupts If an interrupt messes with your timing, that can be prevented by disabling interrupts for a time-critical section: unsigned state = irq_disable() /* timing critical code */ irq_restore(state); Kaspar ___ devel mailing list devel@riot-os.org https://lists.riot-os.org/mailman/listinfo/devel
Re: [riot-devel] Stop other thread
Should I simply run a thread with highest priority so I'm sure it will be run before running other thread? 2016-07-13 13:32 GMT+02:00 Baptiste Clenet : > Hi, > > I've got a chip which needs precise timing to be read. A year ago, I > was able to communicate with this chip but now, even if I go as fast I > can it seems that timing have increased with same source code. > So is there a way to force the CPU to do only one task at the time for > the duration of the function. Can we tell the scheduler to stop other thread? > > Cheers, > > 2016-07-13 13:32 GMT+02:00 Baptiste Clenet : >> Hi, >> >> I've got a chip which needs precise timing to be read. A year ago, I >> was able to communicate with this chip but now, even if I go as fast I >> can it seems that timing have increased with same source code. >> So is there a way to force the CPU to do only one task at the time for >> the duration of the function. Ca >> >> -- >> Baptiste > > > > -- > Baptiste -- Baptiste ___ devel mailing list devel@riot-os.org https://lists.riot-os.org/mailman/listinfo/devel
Re: [riot-devel] Stop other thread
Hi, I've got a chip which needs precise timing to be read. A year ago, I was able to communicate with this chip but now, even if I go as fast I can it seems that timing have increased with same source code. So is there a way to force the CPU to do only one task at the time for the duration of the function. Can we tell the scheduler to stop other thread? Cheers, 2016-07-13 13:32 GMT+02:00 Baptiste Clenet : > Hi, > > I've got a chip which needs precise timing to be read. A year ago, I > was able to communicate with this chip but now, even if I go as fast I > can it seems that timing have increased with same source code. > So is there a way to force the CPU to do only one task at the time for > the duration of the function. Ca > > -- > Baptiste -- Baptiste ___ devel mailing list devel@riot-os.org https://lists.riot-os.org/mailman/listinfo/devel
[riot-devel] Stop other thread
Hi, I've got a chip which needs precise timing to be read. A year ago, I was able to communicate with this chip but now, even if I go as fast I can it seems that timing have increased with same source code. So is there a way to force the CPU to do only one task at the time for the duration of the function. Ca -- Baptiste ___ devel mailing list devel@riot-os.org https://lists.riot-os.org/mailman/listinfo/devel