Hi all,
I have a firmware in which I want to use BLE and ANT communication (with Softdevice S310) to send and receive commands from other Nordic devices or smartphones. I also have 64 RGB LEDs WS2812 which have a specific communication protocol and I want to update the color of the LEDs at a given frequency. I plan to do that by instantiating an App Timer as described here.
It is important that the communication to the LEDs is not interrupted by any events or interrupts.
So I have BLE & ANT events as well as a timer handler.
What is the best way to handle this? It is important that the communication to the LEDs is not interrupted and that I can still communicate through BLE and ANT from time to time.
One possibility would be to setup a radio notification with
ble_radio_notification_init(NRF_APP_PRIORITY_HIGH, NRF_RADIO_NOTIFICATION_DISTANCE_2680US,myradio_callback_handler);
to know when the radio is active.
Then I could set a flag each time I enter my Timeout handler to request for an update of the LEDs color.
In the main loop, I could just check these two conditions to be active at the same time and then update the LEDs.
Is there a better way to do this? Would a Scheduler or a TImeslot API be more appropriate?
Best regards