Skip to content

Commit

Permalink
final changes for beta 3
Browse files Browse the repository at this point in the history
  • Loading branch information
ekettenburg committed Feb 13, 2016
1 parent 1d00c2b commit eec7414
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 10 deletions.
21 changes: 14 additions & 7 deletions cores/oak/OakParticle/particle_core.cpp
Expand Up @@ -32,6 +32,9 @@ namespace particle_core {
#define PROTOCOL_BUFFER_SIZE 800
#define QUEUE_SIZE 800

uint8_t spark_failed_connects = 0;
bool spark_ok_to_connect = false;

//this has to be aligned
uint8_t chunk_buffer[512];

Expand Down Expand Up @@ -1742,8 +1745,11 @@ bool handle_update_begin(msg& message)
}

void spark_disconnect(){
if(pClient.connected())
if(pClient.connected()){
pClient.stop();
set_system_mode(SEMI_AUTOMATIC);
spark_ok_to_connect = false;
}
}

void spark_delay(uint32_t ms){
Expand Down Expand Up @@ -2761,7 +2767,7 @@ void SystemEvents(const char* name, const char* data)
{
if (!strncmp(name, CLAIM_EVENTS, strlen(CLAIM_EVENTS))) {
//mark as claimed
deviceConfig->claim_code[0] != '\0';
deviceConfig->claim_code[0] = '\0';
deviceConfig->claimed = 1;
writeDeviceConfig();
}
Expand Down Expand Up @@ -2940,8 +2946,7 @@ bool spark_internal_connect(){
return true;
}

uint8_t spark_failed_connects = 0;
bool spark_ok_to_connect = false;


uint32_t spark_last_failed_connect = 0;

Expand Down Expand Up @@ -3842,14 +3847,16 @@ void init_bootloader_flags(void){
}
void check_safe_mode(void){
#ifndef OAK_SYSTEM_ROM_4F616B
if(digitalRead(SAFE_MODE_PIN) == HIGH){
pinMode(SAFE_MODE_PIN,INPUT_PULLUP);
if(digitalRead(SAFE_MODE_PIN) == LOW){
uint32_t startHold = millis();
while(millis() - startHold < 100){
if(digitalRead(SAFE_MODE_PIN) == LOW)
if(digitalRead(SAFE_MODE_PIN) == HIGH)
return;
}
reboot_to_config();
}
}
pinMode(SAFE_MODE_PIN,INPUT);
#endif
}
uint8_t read_factory_reason(){
Expand Down
2 changes: 1 addition & 1 deletion cores/oak/OakParticle/particle_globals.h
Expand Up @@ -5,7 +5,7 @@

//#define OAK_SYSTEM_ROM_4F616B 82

#define SAFE_MODE_PIN 1
#define SAFE_MODE_PIN 0

#define PRODUCT_ID 82
#define PLATFORM_ID 82
Expand Down
Expand Up @@ -7,7 +7,6 @@

// Use hardware SPI (on Uno, #13, #12, #11) and the above for CS/DC
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);
#define min(a,b) ((a)<(b)?(a):(b))
#define SERIAL_OUT Serial

unsigned long testFillScreen() {
Expand Down
Expand Up @@ -27,7 +27,6 @@
#define TFT_DC 1
#define TFT_CS 5
Adafruit_ILI9341 tft = Adafruit_ILI9341(TFT_CS, TFT_DC);
#define min(a,b) ((a)<(b)?(a):(b))

#define SD_CS 4

Expand Down

0 comments on commit eec7414

Please sign in to comment.