Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
krzychb committed Dec 30, 2015
2 parents 9fc5ac4 + bbaed29 commit b8691b5
Show file tree
Hide file tree
Showing 20 changed files with 2,214 additions and 1,353 deletions.
67 changes: 67 additions & 0 deletions boards.txt
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,73 @@ generic.menu.ResetMethod.nodemcu.upload.resetmethod=nodemcu
# generic.menu.FlashSize.16M.build.spiffs_end=0x1000000
# generic.menu.FlashSize.16M.build.spiffs_blocksize=8192

##############################################################
espduino.name=ESPDuino (ESP-13 Module)

espduino.upload.tool=esptool
espduino.upload.speed=115200
espduino.upload.resetmethod=ck
espduino.upload.maximum_size=1044464
espduino.upload.maximum_data_size=81920
espduino.upload.wait_for_upload_port=true
espduino.serial.disableDTR=true
espduino.serial.disableRTS=true

espduino.build.mcu=esp8266
espduino.build.f_cpu=80000000L
espduino.build.board=ESP8266_ESP13
espduino.build.core=esp8266
espduino.build.variant=espduino
espduino.build.flash_mode=dio
espduino.build.flash_size=4M
espduino.build.flash_freq=40

espduino.menu.CpuFrequency.80=80 MHz
espduino.menu.CpuFrequency.80.build.f_cpu=80000000L
espduino.menu.CpuFrequency.160=160 MHz
espduino.menu.CpuFrequency.160.build.f_cpu=160000000L

espduino.menu.UploadTool.esptool=Serial
espduino.menu.UploadTool.esptool.upload.tool=esptool
espduino.menu.UploadTool.esptool.upload.verbose=-vv
espduino.menu.UploadTool.espota=OTA
espduino.menu.UploadTool.espota.upload.tool=espota

espduino.menu.UploadSpeed.115200=115200
espduino.menu.UploadSpeed.115200.upload.speed=115200
espduino.menu.UploadSpeed.9600=9600
espduino.menu.UploadSpeed.9600.upload.speed=9600
espduino.menu.UploadSpeed.57600=57600
espduino.menu.UploadSpeed.57600.upload.speed=57600
espduino.menu.UploadSpeed.256000.windows=256000
espduino.menu.UploadSpeed.256000.upload.speed=256000
espduino.menu.UploadSpeed.230400.linux=230400
espduino.menu.UploadSpeed.230400.macosx=230400
espduino.menu.UploadSpeed.230400.macosx=230400
espduino.menu.UploadSpeed.230400.upload.speed=230400
espduino.menu.UploadSpeed.460800.linux=460800
espduino.menu.UploadSpeed.460800.macosx=460800
espduino.menu.UploadSpeed.460800.upload.speed=460800
espduino.menu.UploadSpeed.512000.windows=512000
espduino.menu.UploadSpeed.512000.upload.speed=512000
espduino.menu.UploadSpeed.921600=921600
espduino.menu.UploadSpeed.921600.upload.speed=921600

espduino.menu.FlashSize.4M3M=4M (3M SPIFFS)
espduino.menu.FlashSize.4M3M.build.flash_size=4M
espduino.menu.FlashSize.4M3M.build.flash_ld=eagle.flash.4m.ld
espduino.menu.FlashSize.4M3M.build.spiffs_start=0x100000
espduino.menu.FlashSize.4M3M.build.spiffs_end=0x3FB000
espduino.menu.FlashSize.4M3M.build.spiffs_blocksize=8192
espduino.menu.FlashSize.4M3M.build.spiffs_pagesize=256

espduino.menu.FlashSize.4M1M=4M (1M SPIFFS)
espduino.menu.FlashSize.4M1M.build.flash_size=4M
espduino.menu.FlashSize.4M1M.build.flash_ld=eagle.flash.4m1m.ld
espduino.menu.FlashSize.4M1M.build.spiffs_start=0x300000
espduino.menu.FlashSize.4M1M.build.spiffs_end=0x3FB000
espduino.menu.FlashSize.4M1M.build.spiffs_blocksize=8192
espduino.menu.FlashSize.4M1M.build.spiffs_pagesize=256
##############################################################
huzzah.name=Adafruit HUZZAH ESP8266

Expand Down
5 changes: 5 additions & 0 deletions cores/esp8266/Arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ extern "C" {
#include "binary.h"
#include "esp8266_peri.h"
#include "twi.h"
#include "core_esp8266_features.h"

#define HIGH 0x1
#define LOW 0x0
Expand Down Expand Up @@ -247,8 +248,12 @@ void optimistic_yield(uint32_t interval_us);
#include "Updater.h"
#include "debug.h"

#ifndef _GLIBCXX_VECTOR
// arduino is not compatible with std::vector
#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))
#endif

#define _min(a,b) ((a)<(b)?(a):(b))
#define _max(a,b) ((a)>(b)?(a):(b))

Expand Down
3 changes: 3 additions & 0 deletions cores/esp8266/IPAddress.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ class IPAddress: public Printable {
bool operator==(const IPAddress& addr) const {
return _address.dword == addr._address.dword;
}
bool operator==(uint32_t addr) const {
return _address.dword == addr;
}
bool operator==(const uint8_t* addr) const;

// Overloaded index operator to allow getting and setting individual octets of the address
Expand Down
2 changes: 2 additions & 0 deletions cores/esp8266/core_esp8266_features.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@
#define CORE_HAS_LIBB64
#define CORE_HAS_BASE64_CLASS

#define WIFI_HAS_EVENT_CALLBACK


#endif

1 change: 1 addition & 0 deletions doc/filesystem.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ Olimex MOD-WIFI-ESP8266(-DEV)| 2M | 1M
SparkFun Thing | 512k | 64k
SweetPea ESP-210 | 4M | 1M, 3M
WeMos D1 & D1 mini | 4M | 1M, 3M
ESPDuino | 4M | 1M, 3M

**Note:** to use any of file system functions in the sketch, add the following include to the sketch:

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
/*
* This sketch shows the WiFi event usage
*
*/

#include <ESP8266WiFi.h>

const char* ssid = "your-ssid";
const char* password = "your-password";


void WiFiEvent(WiFiEvent_t event) {
Serial.printf("[WiFi-event] event: %d\n", event);

switch(event) {
case WIFI_EVENT_STAMODE_GOT_IP:
Serial.println("WiFi connected");
Serial.println("IP address: ");
Serial.println(WiFi.localIP());
break;
case WIFI_EVENT_STAMODE_DISCONNECTED:
Serial.println("WiFi lost connection");
break;
}
}

void setup() {
Serial.begin(115200);

// delete old config
WiFi.disconnect(true);

delay(1000);

WiFi.onEvent(WiFiEvent);

WiFi.begin(ssid, password);

Serial.println();
Serial.println();
Serial.println("Wait for WiFi... ");
}


void loop() {
delay(1000);
}

Loading

0 comments on commit b8691b5

Please sign in to comment.