Skip to content

Instantly share code, notes, and snippets.

@fanoush
Created May 23, 2020 21:33
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fanoush/424d4efb556711e3485286f19e78bc44 to your computer and use it in GitHub Desktop.
Save fanoush/424d4efb556711e3485286f19e78bc44 to your computer and use it in GitHub Desktop.
diff --git a/targets/nrf5x/bluetooth.c b/targets/nrf5x/bluetooth.c
index e5aa77d5..5f15e041 100644
--- a/targets/nrf5x/bluetooth.c
+++ b/targets/nrf5x/bluetooth.c
@@ -2489,6 +2489,7 @@ void jsble_restart_softdevice() {
jshUtilTimerDisable(); // don't want the util timer firing during this!
JsSysTime lastTime = jshGetSystemTime();
jsble_kill();
+ jsvUnLock(jspEvaluate("if(typeof(NRF.onRestart)=='function')NRF.onRestart();",true));
jsble_init();
// reinitialise everything
jswrap_ble_reconfigure_softdevice();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment