Hello,
我想打开LED BLE-Conn一次ection is established. I've done that in the ble_multi_link demo and it works flawlessly. However, if I try to do the same in the PXP-Reporter demo, I see some unexpected behaviour.
So, i initialize the Output in main -> periph_init() via:
hw_gpio_configure_pin(HW_GPIO_PORT_3, HW_GPIO_PIN_7, HW_GPIO_MODE_OUTPUT, HW_GPIO_FUNC_GPIO, false);
And I turn the LED on in the main task when a GAP_Connect happens:
case BLE_EVT_GAP_CONNECTED:
handle_evt_gap_connected((ble_evt_gap_connected_t *) hdr);
hw_gpio_set_active(HW_GPIO_PORT_3, HW_GPIO_PIN_7);
break;
So when I connect via BLE, the LED flashes up for a few milliseconds and then turns off again - but I can't see anywhere in the code where the Pin gets pulled low again. Do you have any idea what could disable the Output-pin?
Thanks in advance,
Philipp

Hi dsandbue,
When the device goes in sleep (which that happens between each connection or advertising interval) it will retain the state of the pins, but when the device wakes up the periph_init() function runs again and reconfigures the pins it their original state, so to keep the pin at the previous state before the device wakes up, you will have to retain the value of the pin before going to sleep (via a variable that will keep the state of the pin) and reconfigure the pin in its previous state in the periph_init() function.
Thanks MT_dialog
Thank you very much for the explanation - that solved my problem. :-)
Greetings
Philipp