void GPIOTE_IRQHandler(void) { #ifdef STOP_ADV Nrf51822BluetoothStack &stack = Nrf51822BluetoothStack::getInstance(); if (stack.isAdvertising()) { LOGi("Stop advertising"); stack.stopAdvertising(); } #endif CMesh & mesh = CMesh::getInstance(); NRF_GPIOTE->EVENTS_PORT = 0; for (uint8_t i = 0; i < 2; ++i) { if (NRF_GPIO->IN & (1 << (BUTTON_0 + i))) { LOGi("Button %i pressed", i); uint32_t value = mesh.receive(i+1); // value = 1 - value; value = rng.getRandom8(); // led_config(i + 1, value); LOGi("1"); mesh.send(i + 1, value); } } }