1 of 1 people found this helpful
Change the BLE_bless_isr to have a higher priority interrupt (set it to 2, and leave the rest at 3). Possibly the device is refusing to connect as the interrupts from the BLESS are not working at the correct timing.
Comment out the CyDelay(1000); and the CyBle_GapDisconnect(dummy); in the event case: CYBLE_EVT_GATT_CONNECT_IND
UART_UartPutString("Triggered ||| ");
connectionHandle = *(CYBLE_CONN_HANDLE_T *)eventParam;
GREEN_Write(0); /* Red,Blue - OFF */
BLUE_Write(1); /* Green - ON */
Calling the CyDelay and CyBle_GapDisconnect() while inside the event will cause lots of problems I think.
The event handler doesn't finish acting on the event until you exit the event handler and "return" to the bless system to finish processing.
If you are wanting to have the device disconnect after a second, then you will want to use flags being set in the event handler and to act on those flags in the main loop/code. The event handler is still and IRQ/ISR for the bless system and freezing the device for the CyDelay() will lock up the entire chip for the delay. (This is due to the chip being single-threaded versus multithreaded PC programs.)
The bless behaves like a peripheral that is clocked by calls to the CyBle_ProcessEvents() and calls back for data processing requests using the events. If you lock up the events, it will lock up the CPU/chip as well.
I've changed the BLE_bless_isr priority to 2 (0x02) and the other 2 interrupts to 3 (0x03) and removed the delay & disconnect
However I've encountered another problem in the Accelerometer, so I'll sort that out and then keep the progress posted
Yes It's working now, Thanks