Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes hard fault when calling smart config with wifi off #320

Merged
merged 1 commit into from
Oct 21, 2014

Conversation

technobly
Copy link
Member

In reference to this issue: https://github.com/spark/firmware/issues/310

Simply calling WiFi.on() after WiFi.disconnect() with Start_Smart_Config() ensures that calling WiFi.listen() (which effectively calls: Start_Smart_Config() ) always runs without failing (Hard Fault SOS) under the following test set:

Starting with the following 3 system modes:
SYSTEM_MODE(AUTOMATIC); // default behavior when no system mode is explicitly set
SYSTEM_MODE(MANUAL);
SYSTEM_MODE(SEMI_AUTOMATIC);

After calling:
Spark.connect();
Spark.disconnect();
WiFi.connect();
WiFi.disconnect();
WiFi.on();
WiFi.off();

We finally call:
WiFi.listen();

TEST APP

#include "application.h"

/* uncomment one of the following at a time */
//SYSTEM_MODE(AUTOMATIC); // default behavior when no system mode is explicitly set
//SYSTEM_MODE(MANUAL);
//SYSTEM_MODE(SEMI_AUTOMATIC);

void setup() {
  Serial.begin(9600);
}

void loop() {
  if (Serial.available()) {
    int c = Serial.read();
    switch (c) {
      case 'C': Spark.connect(); break;
      case 'c': Spark.disconnect(); break;
      case 'W': WiFi.connect(); break;
      case 'w': WiFi.disconnect(); break;
      case 'O': WiFi.on(); break;
      case 'o': WiFi.off(); break;
      case 'L': WiFi.listen(); break;
    }
  }
}

towynlin pushed a commit that referenced this pull request Oct 21, 2014
fixes hard fault when calling smart config with wifi off
@towynlin towynlin merged commit dedf38a into master Oct 21, 2014
@towynlin towynlin deleted the bug-fix/smart-config-red-flash branch October 21, 2014 18:33
avtolstoy pushed a commit that referenced this pull request Mar 31, 2022
* tinker-fqc app for P2 FQC testing at factory
* Implement CTRL_REQUEST_WRITE_SERIAL1 custom request
* [sc-95590] Implement CTRL_REQUEST_BLE_SCAN
* [sc-94805] Implement CTRL_REQUEST_WIFI_NETCAT
* [sc-95592] Implement wifi scanning for 2.4 and 5ghz networks with external / internal antennas
* [sc-94804] GPIO test
* Run all tinker apps in AUTOMATIC mode, allow system thread on FQC
* Fix [sc-97541] Close TCP connection after using it. Parse IP/port from ble scan
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants