Protecting against callbacks queuing up?

Esben von Buchwald find.mig at
Wed Aug 26 22:07:25 CEST 2009

Dennis Lee Bieber wrote:
> On Tue, 25 Aug 2009 15:21:16 +0200, Esben von Buchwald
> <find.mig at> declaimed the following in
> gmane.comp.python.general:
>> This is how the accelerometer is accessed
>> I found this called "after"...
>> 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