Example #1
0
/**
 * Reset the Espruino environment.
 */
void jshReset() {
  jshResetDevices();
  os_printf("> jshReset\n");

  // Set all GPIO pins to be input with pull-up
  jshPinSetState(0, JSHPINSTATE_GPIO_IN_PULLUP);
  //jshPinSetState(2, JSHPINSTATE_GPIO_IN_PULLUP); // used for debug output
  jshPinSetState(4, JSHPINSTATE_GPIO_IN_PULLUP);
  jshPinSetState(5, JSHPINSTATE_GPIO_IN_PULLUP);
  jshPinSetState(12, JSHPINSTATE_GPIO_IN_PULLUP);
  jshPinSetState(13, JSHPINSTATE_GPIO_IN_PULLUP);
  jshPinSetState(14, JSHPINSTATE_GPIO_IN_PULLUP);
  jshPinSetState(15, JSHPINSTATE_GPIO_IN_PULLUP);
  g_spiInitialized = false; // Flag the hardware SPI interface as un-initialized.
  g_lastSPIRead = -1;

  extern void user_uart_init(void); // in user_main.c
  user_uart_init();

  jswrap_ESP8266_wifi_reset(); // reset the wifi

  os_printf("< jshReset\n");
}
Example #2
0
void jshReset() {
  jshResetDevices();
}
Example #3
0
/** Initialize any device-specific structures, like flow control states.
 * Called from jshInit */
void jshInitDevices() {
  jshResetDevices();
}
Example #4
0
// When 'reset' is called - we try and put peripherals back to their power-on state
void jshReset() {
  jshResetDevices();
  // TODO: Reset all pins to their power-on state (apart from default UART :)
}