Skip to content

Commit

Permalink
Merge pull request #1 from esp8266/esp8266
Browse files Browse the repository at this point in the history
pull upto date
  • Loading branch information
Makuna committed May 19, 2015
2 parents ed77f2d + c1c8c99 commit 98d5456
Show file tree
Hide file tree
Showing 109 changed files with 12,695 additions and 663 deletions.
22 changes: 18 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,32 +21,36 @@ build/windows/libastylej*
build/windows/arduino-*.zip
build/windows/dist/*.tar.gz
build/windows/dist/*.tar.bz2
build/windows/launch4j-*
build/windows/launch4j-*.tgz
build/windows/launch4j-*.zip
build/windows/launcher/launch4j
build/windows/WinAVR-*.zip
build/macosx/arduino-*.zip
build/macosx/dist/*.tar.gz
build/macosx/dist/*.tar.bz2
build/macosx/*.tar.bz2
build/macosx/libastylej*
build/macosx/appbundler*.jar
build/macosx/appbundler*.zip
build/macosx/appbundler
build/macosx/appbundler-1.0ea-arduino2
build/macosx/appbundler-1.0ea-upstream1
build/linux/work/
build/linux/dist/*.tar.gz
build/linux/dist/*.tar.bz2
build/linux/*.tgz
build/linux/*.tar.xz
build/linux/*.tar.bz2
build/linux/*.zip
build/linux/libastylej*
build/shared/reference*.zip
build/shared/Edison*.zip
build/shared/Galileo*.zip
test-bin
*.iml
.idea
.DS_Store
.directory
build/windows/launch4j-*
build/windows/launcher/launch4j
build/windows/WinAVR-*.zip
hardware/arduino/avr/libraries/Bridge/examples/XivelyClient/passwords.h
avr-toolchain-*.zip
/hardware/tools/esp8266/utils/
Expand All @@ -57,4 +61,14 @@ avr-toolchain-*.zip
/hardware/tools/bossac.exe
/hardware/tools/listComPorts.exe

/app/nbproject/private/
/arduino-core/nbproject/private/
/app/build/
/arduino-core/build/

manifest.mf
nbbuild.xml
nbproject
build/macosx/esptool-*-osx.zip

build/macosx/dist/osx-xtensa-lx106-elf.tgz
19 changes: 11 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,30 @@
Arduino-compatible IDE with ESP8266 support
===========================================

![Linux build status](http://img.shields.io/travis/igrr/Arduino.svg)

This project brings support for ESP8266 chip to the Arduino environment. ESP8266WiFi library bundled with this project has the same interface as the WiFi Shield library, making it easy to re-use existing code and libraries.

### Downloads ###
### Installing with Boards Manager ###

| OS | Build status | Latest release | Alpha Version |
| --- | ------------ | -------------- | --------------- |
| Linux | [![Linux build status](http://img.shields.io/travis/igrr/Arduino.svg)](https://travis-ci.org/igrr/Arduino) | [arduino-1.6.1-linux64.tar.xz](../../releases/download/1.6.1-esp8266-1/arduino-1.6.1-linux64.tar.xz) | |
| Windows | [![Windows build status](http://img.shields.io/appveyor/ci/igrr/Arduino.svg)](https://ci.appveyor.com/project/igrr/Arduino) | [arduino-1.6.1-p1-windows.zip](https://github.com/igrr/Arduino/releases/download/1.6.1-esp8266-1/arduino-1.6.1-p1-windows.zip) | [appveyor 64Bit Build](https://ci.appveyor.com/project/igrr/Arduino/build/artifacts) |
| OS X | | [arduino-1.6.1-macosx-java-latest-signed.zip](../../releases/download/1.6.1-esp8266-1/arduino-1.6.1-macosx-java-latest-signed.zip) | |
Starting with 1.6.4, Arduino allows installation of third-party platform packages using Boards Manager. We have packages available for Windows, Mac OS, and Linux (32 and 64 bit).

- Install Arduino 1.6.4 from the [Arduino website](http://www.arduino.cc/en/main/software).
- Start Arduino and open Perferences window.
- Enter ```http://arduino.esp8266.com/package_esp8266com_index.json``` into *Additional Board Manager URLs* field. You can add multiple URLs, separating them with commas.
- Open Boards Manager from Tools > Board menu and install *esp8266* platform (and don't forget to select your ESP8266 board from Tools > Board menu after installation).

### Building from source ###
### Building latest version from source ###
```
$ git clone https://github.com/esp8266/Arduino.git
$ cd Arduino/build
$ ant dist
```

### Supported boards ###
- [Wifio](http://wifio.cc)
- Generic esp8266 modules (without auto-reset support)
- NodeMCU
- Olimex MOD-WIFI-ESP8266

### Things that work ###

Expand Down
72 changes: 61 additions & 11 deletions boards.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
menu.UploadSpeed=Upload Speed
menu.CpuFrequency=CPU Frequency
menu.FlashSize=Flash size
menu.FlashSize=Flash Size
menu.FlashFreq=Flash Frequency

##############################################################
generic.name=Generic ESP8266 Module
Expand All @@ -21,6 +22,9 @@ generic.build.variant=generic
generic.build.flash_mode=qio
generic.build.flash_size=512K
generic.build.flash_freq=40
generic.build.flash_ld=eagle.flash.512k.ld
generic.build.spiffs_start=0x6B000
generic.build.spiffs_end=0x7B000

generic.menu.CpuFrequency.80=80 MHz
generic.menu.CpuFrequency.80.build.f_cpu=80000000L
Expand All @@ -46,16 +50,56 @@ generic.menu.UploadSpeed.512000.upload.speed=512000
generic.menu.UploadSpeed.921600=921600
generic.menu.UploadSpeed.921600.upload.speed=921600

generic.menu.FlashSize.512K=512K
generic.menu.FlashSize.512K=512K (64K SPIFFS)
generic.menu.FlashSize.512K.build.flash_size=512K
generic.menu.FlashSize.256K=256K
generic.menu.FlashSize.256K.build.flash_size=256K
generic.menu.FlashSize.1M=1M
generic.menu.FlashSize.1M.build.flash_size=1M
generic.menu.FlashSize.2M=2M
generic.menu.FlashSize.512K.build.flash_ld=eagle.flash.512k.ld
generic.menu.FlashSize.512K.build.spiffs_start=0x6B000
generic.menu.FlashSize.512K.build.spiffs_end=0x7B000
generic.menu.FlashSize.1M512=1M (512K SPIFFS)
generic.menu.FlashSize.1M512.build.flash_size=1M
generic.menu.FlashSize.1M512.build.flash_ld=eagle.flash.1m512.ld
generic.menu.FlashSize.1M512.build.spiffs_start=0x6B000
generic.menu.FlashSize.1M512.build.spiffs_end=0xFB000
generic.menu.FlashSize.1M256=1M (256K SPIFFS)
generic.menu.FlashSize.1M256.build.flash_size=1M
generic.menu.FlashSize.1M256.build.flash_ld=eagle.flash.1m256.ld
generic.menu.FlashSize.1M256.build.spiffs_start=0xAB000
generic.menu.FlashSize.1M256.build.spiffs_end=0xFB000
generic.menu.FlashSize.1M128=1M (128K SPIFFS)
generic.menu.FlashSize.1M128.build.flash_size=1M
generic.menu.FlashSize.1M128.build.flash_ld=eagle.flash.1m128.ld
generic.menu.FlashSize.1M128.build.spiffs_start=0xCB000
generic.menu.FlashSize.1M128.build.spiffs_end=0xFB000
generic.menu.FlashSize.1M64=1M (64K SPIFFS)
generic.menu.FlashSize.1M64.build.flash_size=1M
generic.menu.FlashSize.1M64.build.flash_ld=eagle.flash.1m64.ld
generic.menu.FlashSize.1M64.build.spiffs_start=0xEB000
generic.menu.FlashSize.1M64.build.spiffs_end=0xFB000
generic.menu.FlashSize.2M=2M (1M SPIFFS)
generic.menu.FlashSize.2M.build.flash_size=2M
generic.menu.FlashSize.4M=4M
generic.menu.FlashSize.2M.build.flash_ld=eagle.flash.2m.ld
generic.menu.FlashSize.2M.build.spiffs_start=0x100000
generic.menu.FlashSize.2M.build.spiffs_end=0x1FB000
generic.menu.FlashSize.4M=4M (3M SPIFFS)
generic.menu.FlashSize.4M.build.flash_size=4M
generic.menu.FlashSize.4M.build.flash_ld=eagle.flash.4m.ld
generic.menu.FlashSize.4M.build.spiffs_start=0x100000
generic.menu.FlashSize.4M.build.spiffs_end=0x3FB000
generic.menu.FlashSize.8M=8M (7M SPIFFS)
generic.menu.FlashSize.8M.build.flash_size=1M
generic.menu.FlashSize.8M.build.flash_ld=eagle.flash.8m.ld
generic.menu.FlashSize.8M.build.spiffs_start=0x100000
generic.menu.FlashSize.8M.build.spiffs_end=0x800000
generic.menu.FlashSize.16M=16M (15M SPIFFS)
generic.menu.FlashSize.16M.build.flash_size=1M
generic.menu.FlashSize.16M.build.flash_ld=eagle.flash.16m.ld
generic.menu.FlashSize.16M.build.spiffs_start=0x100000
generic.menu.FlashSize.16M.build.spiffs_end=0x1000000

# generic.menu.FlashFreq.40=40MHz
# generic.menu.FlashFreq.40.build.flash_freq=40
# generic.menu.FlashFreq.80=80MHz
# generic.menu.FlashFreq.80.build.flash_freq=80

##############################################################
modwifi.name=Olimex MOD-WIFI-ESP8266(-DEV)
Expand All @@ -77,6 +121,9 @@ modwifi.build.variant=generic
modwifi.build.flash_mode=qio
modwifi.build.flash_size=2M
modwifi.build.flash_freq=40
modwifi.build.flash_ld=eagle.flash.2m.ld
modwifi.build.spiffs_start=0x100000
modwifi.build.spiffs_end=0x1FB000

modwifi.menu.CpuFrequency.80=80 MHz
modwifi.menu.CpuFrequency.80.build.f_cpu=80000000L
Expand Down Expand Up @@ -122,6 +169,9 @@ nodemcu.build.variant=nodemcu
nodemcu.build.flash_mode=qio
nodemcu.build.flash_size=4M
nodemcu.build.flash_freq=40
nodemcu.build.flash_ld=eagle.flash.4m.ld
nodemcu.build.spiffs_start=0x100000
nodemcu.build.spiffs_end=0x3FB000

nodemcu.menu.CpuFrequency.80=80 MHz
nodemcu.menu.CpuFrequency.80.build.f_cpu=80000000L
Expand All @@ -148,9 +198,6 @@ nodemcu.menu.UploadSpeed.512000.upload.speed=512000
nodemcu.menu.UploadSpeed.921600=921600
nodemcu.menu.UploadSpeed.921600.upload.speed=921600

nodemcu.menu.FlashSize.4M=4M
nodemcu.menu.FlashSize.4M.build.flash_size=4M

##############################################################
# wifio.name=Wifio
#
Expand All @@ -168,6 +215,9 @@ nodemcu.menu.FlashSize.4M.build.flash_size=4M
# wifio.build.flash_mode=qio
# wifio.build.flash_size=512K
# wifio.build.flash_freq=40
# wifio.build.flash_ld=eagle.flash.512k.ld
# wifio.build.spiffs_start=0x6B000
# wifio.build.spiffs_end=0x7B000
#
# wifio.menu.CpuFrequency.80=80MHz
# wifio.menu.CpuFrequency.80.build.f_cpu=80000000L
Expand Down
10 changes: 7 additions & 3 deletions cores/esp8266/Arduino.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,6 @@ void timer1_write(uint32_t ticks); //maximum ticks 8388607
#undef abs
#endif

#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))
#define abs(x) ((x)>0?(x):-(x))
#define constrain(amt,low,high) ((amt)<(low)?(low):((amt)>(high)?(high):(amt)))
#define round(x) ((x)>=0?(long)((x)+0.5):(long)((x)-0.5))
Expand All @@ -134,7 +132,7 @@ void ets_intr_unlock();
extern uint32_t interruptsState;

#define interrupts() xt_enable_interrupts(interruptsState)
#define noInterrupts() xt_disable_interrupts(interruptsState, 15)
#define noInterrupts() __asm__ __volatile__("rsil %0,15; esync; isync; dsync" : "=a" (interruptsState))

#define clockCyclesPerMicrosecond() ( F_CPU / 1000000L )
#define clockCyclesToMicroseconds(a) ( (a) / clockCyclesPerMicrosecond() )
Expand Down Expand Up @@ -211,7 +209,12 @@ void loop(void);
#include "WString.h"

#include "HardwareSerial.h"
#include "FileSystem.h"
#include "Esp.h"
#include "debug.h"

#define min(a,b) ((a)<(b)?(a):(b))
#define max(a,b) ((a)>(b)?(a):(b))

uint16_t makeWord(uint16_t w);
uint16_t makeWord(byte h, byte l);
Expand All @@ -229,6 +232,7 @@ long random(long, long);
void randomSeed(unsigned int);
long map(long, long, long, long, long);


#endif

#include "pins_arduino.h"
Expand Down
11 changes: 11 additions & 0 deletions cores/esp8266/Esp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,11 @@ uint32_t EspClass::getFlashChipId(void)
return spi_flash_get_id();
}

uint32_t EspClass::getFlashChipRealSize(void)
{
return (1 << ((spi_flash_get_id() >> 16) & 0xFF));
}

uint32_t EspClass::getFlashChipSize(void)
{
uint32_t data;
Expand All @@ -175,6 +180,12 @@ uint32_t EspClass::getFlashChipSize(void)
return (2_MB);
case 0x4: // 32 MBit (4MB)
return (4_MB);
case 0x5: // 64 MBit (8MB)
return (8_MB);
case 0x6: // 128 MBit (16MB)
return (16_MB);
case 0x7: // 256 MBit (32MB)
return (32_MB);
default: // fail?
return 0;
}
Expand Down
3 changes: 3 additions & 0 deletions cores/esp8266/Esp.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,9 @@ class EspClass {
uint8_t getCpuFreqMHz(void);

uint32_t getFlashChipId(void);
//gets the actual chip size based on the flash id
uint32_t getFlashChipRealSize(void);
//gets the size of the flash as set by the compiler
uint32_t getFlashChipSize(void);
uint32_t getFlashChipSpeed(void);
FlashMode_t getFlashChipMode(void);
Expand Down
Loading

0 comments on commit 98d5456

Please sign in to comment.