Other Parts Discussed in Thread: BLE-STACK
Hi all,
i'm developing my cc2541 based device through simplebleperipheral project. My device sends dynamic advertising packets (containing temperature, battery level and button pressing information) every 500 ms for 10 secs, then it's turned off for 50 secs then it restarts advertising and so on. If a button installed on the device is pressed corresponding byte in the advertising packets changes state, and a buzzer sounds.
In the function performperiodicTask (which lasts 50 ms) i control the button state, and consequently the buzzer alert through following instruction
static void performperiodicTask (void)
{
if (alarm ==1) //condition set by interrupt on pin P0_0
{
for (i=1; i<=250; i++)
P1_6 = 1; //pin that drives the buzzer is forced to 1
}
else
P1_6 = 0; // pin that drive buzzer is forced to 0, buzzer of
My problem is that the buzzer sounds well in this way but device advertising, during the alert period, stops,. If I reduce the duration of the for loop, acting on superior limit of i, advertising is ok but the alarm sound of the buzzer is a small clatter. It's not sounding well.
Can anyone help me please with some advice?
Regards,
Vito