Closed GoogleCodeExporter closed 9 years ago
Original comment by matthias.ringwald@gmail.com
on 28 Jan 2014 at 10:57
I've made embedded_execute_once public by exposing it in the run_loop.h for now
(until a better approach if found)
Can you explain in more detail why extern const run_loop_t run_loop_embedded
should be in run_lopo.h instead of run_loop.c. To add your own run loop type,
you have to modify run_loop.c anyway, no?
timers: my idea was that your global timer can periodically call
embedded_tick_handler(). the times in BTstack are in the seconds range (I think
the shortest one is a 2 seconds timer in l2cap signaling). what benefit do you
see if your local counter would be used (aside from saving 4 bytes)?
Original comment by matthias.ringwald@gmail.com
on 4 Feb 2014 at 9:14
Ohhhhhh I'm supposed to store a function pointer to the result of
hal_tick_set_handler's argument and call it?
Ok I didn't understand that bit before. Now that I actually understand your
intention, I agree that it works, at the cost of a few bytes and cycles.
By the way, to me, every byte counts, every cycle counts. I am always in favor
of setting things during compile time instead of run time.
Wouldn't it be much easier to just write one public function and tell us to
"call this once every ms"? Is the stack really ever going to register more than
one tick handler?
Original comment by frank.zhao.main@gmail.com
on 4 Feb 2014 at 10:02
The one public function already exists: you can call embedded_tick_handler()
periodically and provide it's period by the hal_tick_get_tick_period_in_ms().
lol. Just got BTstack running on an Arduino Mega Pro 3.3 and was wondering how
to bridge between the Arduino's time functions (mainly millis()) and BTstack's
tick counter. Without an extra timer, I would need to track changes to millis()
and then call embedded_tick_handler - that's certainly not good.
I'll go with your suggestion and add a setter for the system tick.
other insights? :)
Original comment by matthias.ringwald@gmail.com
on 4 Feb 2014 at 10:38
Ask your average Arduino user what a "function pointer" means, they won't be
able to answer.
Arduino users will also be confused as hell when they call run_loop and
everything just freezes.
Original comment by frank.zhao.main@gmail.com
on 5 Feb 2014 at 7:06
With the tick setter and the public execute once, that's done, right?
Original comment by matthias.ringwald@gmail.com
on 6 Feb 2014 at 9:59
Yea, it should be usable
Original comment by frank.zhao.main@gmail.com
on 6 Feb 2014 at 2:42
Original issue reported on code.google.com by
frank.zhao.main@gmail.com
on 26 Jan 2014 at 5:25