Protecting against callbacks queuing up?

Esben von Buchwald find.mig at paa.google
Wed Aug 26 16:07:25 EDT 2009


Dennis Lee Bieber wrote:
> On Tue, 25 Aug 2009 15:21:16 +0200, Esben von Buchwald
> <find.mig at paa.google> declaimed the following in
> gmane.comp.python.general:
> 
>> This is how the accelerometer is accessed
>> http://pys60.garage.maemo.org/doc/s60/node59.html
>>
>> I found this called "after"...
>> http://pys60.garage.maemo.org/doc/s60/node12.html
>>
>> would that be usable?

> 
> 	Based on the documentation... I'd suggest...
> 
> 	def doCallback(self):
> 		self.accelerometer.stop_listening()
> 		self.data_callback()
> 		self.accelerometer.start_listening()
> 
> with appropriate changes to whatever reference you use for the
> accelerometer would solve the problem... IE, when the callback is
> triggered, you STOP the accelerometer action, compute results, and then
> restart the accelerometer..

I just tried that - it made the application lock up, leaving the sensors 
unusable until next reboot of the phone.

I don't think these start/stop calls are supposed to be called as often 
as it does the callback...



More information about the Python-list mailing list