I am using DA14681 devkit PRO board and pxp_reporter example. I want to add hw_timer0 to this project and want to toggle an i/O line in timer0_isr. I noticed that this toggle is synchronous to the blue LED flashing (fast or slow advertising) on the board.
Where can I find the source code for this blinking LED?
Is hw_timer0 being used anywhere in this example? How do I know what peripherals are being used by the different sdk examples? From the forums, I realize that timer1 is used by the FreeRTOS. Can you list different peripherals that are used by this example?
This is my test code in periph_init function:
hw_timer0_init(NULL);
hw_timer0_set_clock_source (HW_TIMER0_CLK_SRC_SLOW);
hw_timer0_set_t0_reload(32767, 32767);
hw_timer0_set_on_reload(200);
hw_timer0_register_int(timer0_interrupt_cb);
hw_timer0_enable();
Hi kvenkatraman,
You mean the blue led that keeps on blinking ? that led is not driven via sw but from the hw itself, actually its a led that indicates that the device is sleeping or not, and that is why you see it light up when your sw driven LED is toggling, since in order for the peripherals to be active, the device should be active as well.
Most of the peripherals are used in the peripherals_demo project and there are a couple readme files in the bottom of the eclipse tree (every SDK project has this readme file with instructions how to set up the demo), so you can check there for the peripherals that are used for each demo. Yes the tick for the Free RTOS is provided by timer 1 which also is the only peripheral that is not shut down during sleep, and its also adviced not to mess with that timer. Please check the peripherals_demo, there is a timer especially for timer 0.
Thanks MT_dialog