Skip to content

Commit f799ede

Browse files
author
Me No Dev
committed
Merge remote-tracking branch 'esp8266/master'
2 parents 3dba795 + d28c551 commit f799ede

File tree

8 files changed

+84
-37
lines changed

8 files changed

+84
-37
lines changed

README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -34,12 +34,12 @@ If you find this forum or the ESP8266 Boards Manager package useful, please cons
3434
##### Stable version ![](http://arduino.esp8266.com/stable/badge.svg)
3535
Boards manager link: `http://arduino.esp8266.com/stable/package_esp8266com_index.json`
3636

37-
Documentation: [http://esp8266.github.io/Arduino/versions/2.2.0/](http://esp8266.github.io/Arduino/versions/2.2.0/)
37+
Documentation: [http://esp8266.github.io/Arduino/versions/2.3.0/](http://esp8266.github.io/Arduino/versions/2.3.0/)
3838

3939
##### Staging version ![](http://arduino.esp8266.com/staging/badge.svg)
4040
Boards manager link: `http://arduino.esp8266.com/staging/package_esp8266com_index.json`
4141

42-
Documentation: [http://esp8266.github.io/Arduino/versions/2.2.0-rc1/](http://esp8266.github.io/Arduino/versions/2.2.0-rc1/)
42+
Documentation: [http://esp8266.github.io/Arduino/versions/2.3.0-rc2/](http://esp8266.github.io/Arduino/versions/2.3.0-rc2/)
4343

4444
### Using git version
4545
[![Linux build status](https://travis-ci.org/esp8266/Arduino.svg)](https://travis-ci.org/esp8266/Arduino) [![codecov.io](https://codecov.io/github/esp8266/Arduino/coverage.svg?branch=master)](https://codecov.io/github/esp8266/Arduino?branch=master)

cores/esp8266/Esp.cpp

+32-1
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@
2323
#include "eboot_command.h"
2424
#include <memory>
2525
#include "interrupts.h"
26+
#include "MD5Builder.h"
2627

2728
extern "C" {
2829
#include "user_interface.h"
@@ -443,7 +444,7 @@ uint32_t EspClass::getSketchSize() {
443444
DEBUG_SERIAL.printf("section=%u size=%u pos=%u\r\n", section_index, section_header.size, pos);
444445
#endif
445446
}
446-
result = pos;
447+
result = (pos + 16) & ~15;
447448
return result;
448449
}
449450

@@ -519,3 +520,33 @@ bool EspClass::flashRead(uint32_t offset, uint32_t *data, size_t size) {
519520
ets_isr_unmask(FLASH_INT_MASK);
520521
return rc == 0;
521522
}
523+
524+
String EspClass::getSketchMD5()
525+
{
526+
static String result;
527+
if (result.length()) {
528+
return result;
529+
}
530+
uint32_t lengthLeft = getSketchSize();
531+
const size_t bufSize = 512;
532+
std::unique_ptr<uint8_t[]> buf(new uint8_t[bufSize]);
533+
uint32_t offset = 0;
534+
if(!buf.get()) {
535+
return String();
536+
}
537+
MD5Builder md5;
538+
md5.begin();
539+
while( lengthLeft > 0) {
540+
size_t readBytes = (lengthLeft < bufSize) ? lengthLeft : bufSize;
541+
if (!flashRead(offset, reinterpret_cast<uint32_t*>(buf.get()), (readBytes + 3) & ~3)) {
542+
return String();
543+
}
544+
md5.add(buf.get(), readBytes);
545+
lengthLeft -= readBytes;
546+
offset += readBytes;
547+
}
548+
md5.calculate();
549+
result = md5.toString();
550+
return result;
551+
}
552+

cores/esp8266/Esp.h

+1
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,7 @@ class EspClass {
133133
bool flashRead(uint32_t offset, uint32_t *data, size_t size);
134134

135135
uint32_t getSketchSize();
136+
String getSketchMD5();
136137
uint32_t getFreeSketchSpace();
137138
bool updateSketch(Stream& in, uint32_t size, bool restartOnFail = false, bool restartOnSuccess = true);
138139

cores/esp8266/pgmspace.h

+3
Original file line numberDiff line numberDiff line change
@@ -111,14 +111,17 @@ int vsnprintf_P(char *str, size_t strSize, PGM_P formatP, va_list ap) __attribut
111111

112112
#define pgm_read_dword(addr) (*reinterpret_cast<const uint32_t*>(addr))
113113
#define pgm_read_float(addr) (*reinterpret_cast<const float*>(addr))
114+
#define pgm_read_ptr(addr) (*reinterpret_cast<const void* const *>(addr))
114115

115116
#define pgm_read_byte_near(addr) pgm_read_byte(addr)
116117
#define pgm_read_word_near(addr) pgm_read_word(addr)
117118
#define pgm_read_dword_near(addr) pgm_read_dword(addr)
118119
#define pgm_read_float_near(addr) pgm_read_float(addr)
120+
#define pgm_read_ptr_near(addr) pgm_read_ptr(addr)
119121
#define pgm_read_byte_far(addr) pgm_read_byte(addr)
120122
#define pgm_read_word_far(addr) pgm_read_word(addr)
121123
#define pgm_read_dword_far(addr) pgm_read_dword(addr)
122124
#define pgm_read_float_far(addr) pgm_read_float(addr)
125+
#define pgm_read_ptr_far(addr) pgm_read_ptr(addr)
123126

124127
#endif //__PGMSPACE_H_

cores/esp8266/spiffs_api.cpp

+5-1
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,15 @@ extern "C" uint32_t _SPIFFS_block;
120120
#define SPIFFS_PHYS_PAGE ((uint32_t) &_SPIFFS_page)
121121
#define SPIFFS_PHYS_BLOCK ((uint32_t) &_SPIFFS_block)
122122

123+
#ifndef SPIFFS_MAX_OPEN_FILES
124+
#define SPIFFS_MAX_OPEN_FILES 5
125+
#endif
126+
123127
FS SPIFFS = FS(FSImplPtr(new SPIFFSImpl(
124128
SPIFFS_PHYS_ADDR,
125129
SPIFFS_PHYS_SIZE,
126130
SPIFFS_PHYS_PAGE,
127131
SPIFFS_PHYS_BLOCK,
128-
5)));
132+
SPIFFS_MAX_OPEN_FILES)));
129133

130134
#endif

cores/esp8266/uart.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -162,19 +162,19 @@ uart_t* uart_init(int uart_nr, int baudrate, int config, int mode, int tx_pin)
162162
uart->rx_enabled = (mode != UART_TX_ONLY);
163163
uart->tx_enabled = (mode != UART_RX_ONLY);
164164
uart->rx_pin = (uart->rx_enabled)?3:255;
165-
if(uart->rx_enabled) {
165+
if(uart->tx_enabled) {
166166
if (tx_pin == 2) {
167167
uart->tx_pin = 2;
168-
pinMode(uart->rx_pin, FUNCTION_4);
168+
pinMode(uart->tx_pin, FUNCTION_4);
169169
} else {
170170
uart->tx_pin = 1;
171-
pinMode(uart->rx_pin, SPECIAL);
171+
pinMode(uart->tx_pin, FUNCTION_0);
172172
}
173173
} else {
174174
uart->tx_pin = 255;
175175
}
176-
if(uart->tx_enabled) {
177-
pinMode(uart->tx_pin, SPECIAL);
176+
if(uart->rx_enabled) {
177+
pinMode(uart->rx_pin, SPECIAL);
178178
}
179179
IOSWAP &= ~(1 << IOSWAPU0);
180180
break;

doc/changes.md

+10-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@
22
title: Change Log
33
---
44

5-
## Current version
5+
## 2.3.0
6+
June 23, 2016
7+
8+
Package link: `http://arduino.esp8266.com/versions/2.3.0/package_esp8266com_index.json`.
69

710
### Core
811
- Fix NMI interrupt handler alignment
@@ -29,6 +32,11 @@ title: Change Log
2932
- MD5Builder::addStream: fixed falsy calculated hash for len > filelength (#2126)
3033
- Fix SPIFFS.openDir("") (#2143)
3134
- Bring back old semantics to random and randomSeed, add secureRandom (#1710) (#2142)
35+
- Add missing pgm_read_ptr{_near/_far} macros (#2160)
36+
- Add macro for maximum open SPIFFS files, settings it to 1 saves about 1k heap. (#2167)
37+
- Fix UART pins setting (#2098)
38+
- Fix ESP.getSketchSize, add ESP.getSketchMD5 (#2158)
39+
- Add Serial.baudRate() to get current baud rate (#2079)
3240

3341
### Libraries
3442

@@ -70,7 +78,7 @@ title: Change Log
7078
- Python 3 compatibility for get.py
7179
- Device side test library and test runner
7280
- Fix ARM toolchain files permissions (#2004)
73-
81+
- Update esptool to 0.4.9
7482

7583
## 2.2.0
7684
April 18, 2016

package/package_esp8266com_index.template.json

+26-26
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@
7878
{
7979
"packager": "esp8266",
8080
"name": "esptool",
81-
"version": "0.4.8"
81+
"version": "0.4.9"
8282
},
8383
{
8484
"packager": "esp8266",
@@ -96,49 +96,49 @@
9696
"tools": [
9797
{
9898
"name": "esptool",
99-
"version": "0.4.8",
99+
"version": "0.4.9",
100100
"systems": [
101101
{
102102
"host": "i686-mingw32",
103-
"url": "https://github.com/igrr/esptool-ck/releases/download/0.4.8/esptool-0.4.8-win32.zip",
104-
"archiveFileName": "esptool-0.4.8-win32.zip",
105-
"checksum": "SHA-256:8d09cb0df6234c2a0562389ceedd11482b44a3f538695f9a4df80f9f10411ece",
106-
"size": "32192"
103+
"url": "https://github.com/igrr/esptool-ck/releases/download/0.4.9/esptool-0.4.9-win32.zip",
104+
"archiveFileName": "esptool-0.4.9-win32.zip",
105+
"checksum": "SHA-256:9c4162cedf05fcb09fd829bfb90e34ae12458365980d79525a072ff5ca44751c",
106+
"size": "32436"
107107
},
108108
{
109109
"host": "x86_64-apple-darwin",
110-
"url": "https://github.com/igrr/esptool-ck/releases/download/0.4.8/esptool-0.4.8-osx.tar.gz",
111-
"archiveFileName": "esptool-0.4.8-osx.tar.gz",
112-
"checksum": "SHA-256:2bcbf19934543fb06c505b2a595b68a76e4cab8e3d8968a4d1802195c87126cf",
113-
"size": "28798"
110+
"url": "https://github.com/igrr/esptool-ck/releases/download/0.4.9/esptool-0.4.9-osx.tar.gz",
111+
"archiveFileName": "esptool-0.4.9-osx.tar.gz",
112+
"checksum": "SHA-256:57938b473765723a7e6602d55973017b7719bda69bdcff4250b24fcbf7a399f5",
113+
"size": "29310"
114114
},
115115
{
116116
"host": "i386-apple-darwin",
117-
"url": "https://github.com/igrr/esptool-ck/releases/download/0.4.8/esptool-0.4.8-osx.tar.gz",
118-
"archiveFileName": "esptool-0.4.8-osx.tar.gz",
119-
"checksum": "SHA-256:2bcbf19934543fb06c505b2a595b68a76e4cab8e3d8968a4d1802195c87126cf",
120-
"size": "28798"
117+
"url": "https://github.com/igrr/esptool-ck/releases/download/0.4.9/esptool-0.4.9-osx.tar.gz",
118+
"archiveFileName": "esptool-0.4.9-osx.tar.gz",
119+
"checksum": "SHA-256:57938b473765723a7e6602d55973017b7719bda69bdcff4250b24fcbf7a399f5",
120+
"size": "29310"
121121
},
122122
{
123123
"host": "x86_64-pc-linux-gnu",
124-
"url": "https://github.com/igrr/esptool-ck/releases/download/0.4.8/esptool-0.4.8-linux64.tar.gz",
125-
"archiveFileName": "esptool-0.4.8-linux64.tar.gz",
126-
"checksum": "SHA-256:1cd9a6014bbbc37ba6dc249f4fc027f0ca9bbc6dd0e203ebc7d146dfd78a6e78",
127-
"size": "15479"
124+
"url": "https://github.com/igrr/esptool-ck/releases/download/0.4.9/esptool-0.4.9-linux64.tar.gz",
125+
"archiveFileName": "esptool-0.4.9-linux64.tar.gz",
126+
"checksum": "SHA-256:fab9d1be8a648bea6728ad5c9d18ce972508187700cf90baf1897ac9cdf4db15",
127+
"size": "15564"
128128
},
129129
{
130130
"host": "i686-pc-linux-gnu",
131-
"url": "https://github.com/igrr/esptool-ck/releases/download/0.4.8/esptool-0.4.8-linux32.tar.gz",
132-
"archiveFileName": "esptool-0.4.8-linux32.tar.gz",
133-
"checksum": "SHA-256:b0d6e71e6f41d4ed7e167bb4b3f4f0b1b3e49d69af50ab7fbe952cbfed83f164",
134-
"size": "15444"
131+
"url": "https://github.com/igrr/esptool-ck/releases/download/0.4.9/esptool-0.4.9-linux32.tar.gz",
132+
"archiveFileName": "esptool-0.4.9-linux32.tar.gz",
133+
"checksum": "SHA-256:bc4444d73d59be74608be5e1431353a0a9ae9e308e99c76a271d68a6ae145b7b",
134+
"size": "15984"
135135
},
136136
{
137137
"host": "arm-linux-gnueabihf",
138-
"url": "https://github.com/igrr/esptool-ck/releases/download/0.4.8/esptool-0.4.8-linux-armhf.tar.gz",
139-
"archiveFileName": "esptool-0.4.8-linux-armhf.tar.gz",
140-
"checksum": "SHA-256:e9c4dfb81781610556a6af0377c8efc7cde359e0e2cda2fd48e0a32bae10f506",
141-
"size": "13630"
138+
"url": "https://github.com/igrr/esptool-ck/releases/download/0.4.9/esptool-0.4.9-linux-armhf.tar.gz",
139+
"archiveFileName": "esptool-0.4.9-linux-armhf.tar.gz",
140+
"checksum": "SHA-256:d0364492599d90b8305125f8212de5be05397e4efde2fc7d0ed3676bb7018164",
141+
"size": "13763"
142142
}
143143
]
144144
},

0 commit comments

Comments
 (0)