<commit_before>#include <Adafruit_SleepyDog.h>
#include <Adafruit_CC3000.h>
#include <ccspi.h>
#include <SPI.h>

#define STATICIP 0

#define halt(s) { Serial.println(F( s )); while(1);  }

uint16_t checkFirmwareVersion(void);
bool displayConnectionDetails(void);

extern Adafruit_CC3000 cc3000;

boolean CC3000connect(const char* wlan_ssid, const char* wlan_pass, uint8_t wlan_security) {
  Watchdog.reset();
    
  // Check for compatible firmware
  if (checkFirmwareVersion() < 0x113)   halt("Wrong firmware version!");
  
  // Delete any old connection data on the module
  Serial.println(F("\nDeleting old connection profiles"));
  if (!cc3000.deleteProfiles())     halt("Failed!");

#ifdef STATICIP
  Serial.println(F("Setting static IP"));
  uint32_t ipAddress = cc3000.IP2U32(10, 0, 1, 19);
  uint32_t netMask = cc3000.IP2U32(255, 255, 255, 0);
  uint32_t defaultGateway = cc3000.IP2U32(10, 0, 1, 1);
  uint32_t dns = cc3000.IP2U32(8, 8, 4, 4);
  
  if (!cc3000.setStaticIPAddress(ipAddress, netMask, defaultGateway, dns)) {
    Serial.println(F("Failed to set static IP!"));<commit_msg>Make static IP optional and off by default in CC3k example.<commit_after>#include <Adafruit_SleepyDog.h>
#include <Adafruit_CC3000.h>
#include <ccspi.h>
#include <SPI.h>

//#define STATICIP

#define halt(s) { Serial.println(F( s )); while(1);  }

uint16_t checkFirmwareVersion(void);
bool displayConnectionDetails(void);

extern Adafruit_CC3000 cc3000;

boolean CC3000connect(const char* wlan_ssid, const char* wlan_pass, uint8_t wlan_security) {
  Watchdog.reset();
    
  // Check for compatible firmware
  if (checkFirmwareVersion() < 0x113)   halt("Wrong firmware version!");
  
  // Delete any old connection data on the module
  Serial.println(F("\nDeleting old connection profiles"));
  if (!cc3000.deleteProfiles())     halt("Failed!");

#ifdef STATICIP
  Serial.println(F("Setting static IP"));
  uint32_t ipAddress = cc3000.IP2U32(10, 0, 1, 19);
  uint32_t netMask = cc3000.IP2U32(255, 255, 255, 0);
  uint32_t defaultGateway = cc3000.IP2U32(10, 0, 1, 1);
  uint32_t dns = cc3000.IP2U32(8, 8, 4, 4);
  
  if (!cc3000.setStaticIPAddress(ipAddress, netMask, defaultGateway, dns)) {
    Serial.println(F("Failed to set static IP!"));
{'fraction_non_alphanumeric': 0.13384064458370637, 'fraction_numerical': 0.08415398388540735, 'mean_word_length': 4.991957104557641, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '911334', 'n_tokens_mistral': 948, 'n_tokens_neox': 802, 'n_words': 202}