Hi all,
I just had some general questions regarding events and timers on the nRF51822. I'm coming from a Ti CC2540 8051 which used an OSAL system. This made it quite easy to create events and sub-tasks, and handlers for each event and task. This allowed one class to trigger an event handler in another class quite easily. I'm trying to figure out how to perform equivalent custom event/task handling on the nRF51822. Case in point:
I used the Button Handler to catch button presses/releases. I use this to trigger timers in a Button_Timer.c class which monitor how long a button has been press. While pressed, the duration triggers different LED's to turn on (i.e. if 2sec has elasped, turn on Red led. After 3secs turn off LED, after 5secs trigger a buzzer...etc). I know I can do this by simply using app_timers, but I'd rather avoid using many many timers to handle tasks.
I can't seem to find any example code where the application creates its own events and at certain trigger points pushes them to the scheduler to execute via app_sched_event_put. I may be looking at this all wrong with how the Scheduler is supposed to work, so any advise on the matter is greatly appreciated. Thank you