• So the lines ...
    are not needed at all, because there are no events generated.

    Yes, I think it is there just in case there are more events handled in future but so far there are none other than the flash related ones that will not arrive. Also in your case the

      uint8_t sd_enabled;
      sd_softdevice_is_enabled(&sd_enabled);
    

    could be simplified to have sd_enabled to be 0, so something like

      uint8_t sd_enabled=0;
     [#ifdef](https://forum.espruino.com/search/?q=%23ifdef) BLUETOOTH
      sd_softdevice_is_enabled(&sd_enabled);
     [#endif](https://forum.espruino.com/search/?q=%23endif)
    

    could be a better patch handling both cases, but it doesn't matter that much. There is actually slight nuance because there is sd_softdevice_enable and also sd_ble_enable and you can enable softdevice without enabling BLE so then the sd_softdevice_is_enabled will return true even if BLE is not enabled. But when BLUETOOTH library is enabled both are enabled and when disabled both are disabled. But we could in theory have bare softdevice enabled with BLUETOOTH disabled.

    https://infocenter.nordicsemi.com/topic/com.nordic.infocenter.s132.api.v6.1.1/group___b_l_e___c_o_m_m_o_n___e_n_a_b_l_e.html?cp=5_7_3_4_2_0_4_0

About

Avatar for Chris3006 @Chris3006 started