Skip to content

Commit ecf9c64

Browse files
committed
Revert "Next 1.5.4.1 master drop (#1627)"
This reverts commit 04ce0ad.
1 parent ec265a6 commit ecf9c64

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

67 files changed

+1407
-4325
lines changed

CONTRIBUTING.md

Lines changed: 3 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -4,22 +4,16 @@
44

55
The following is a set of guidelines for contributing to NodeMCU on GitHub. These are just guidelines, not rules, use your best judgment and feel free to propose changes to this document in a pull request.
66

7-
It is appreciated if you raise an issue _before_ you start changing NodeMCU, discussing the proposed change; emphasing that the you are proposing to develop the patch yourself, and outlining the strategy for implementation. This type of discussion is what we should be doing on the issues list and it is better to do this before or in parallel to developing the patch rather than having "you should have done it this way" type of feedback on the PR itself.
7+
It is appreciated but optional if you raise an issue _before_ you start changing NodeMCU, discussing the proposed change; emphasing that the you are proposing to develop the patch yourself, and outlining the strategy for implementation. This type of discussion is what we should be doing on the issues list and it is better to do this before or in parallel to developing the patch rather than having "you should have done it this way" type of feedback on the PR itself.
88

99
### Table Of Contents
10-
* [General remarks](#general-remarks)
10+
1111
* [Development environment setup](#development-environment-setup)
1212
* [Writing Documentation](#writing-documentation)
1313
* [Working with Git and GitHub](#working-with-git-and-github)
1414
* [General flow](#general-flow)
1515
* [Keeping your fork in sync](#keeping-your-fork-in-sync)
1616
* [Commit messages](#commit-messages)
17-
* [For collaborators](#for-collaborators)
18-
* [Handling releases](#handling-release)
19-
20-
## General remarks
21-
We are a friendly and welcoming community and look forward to your contributions. Once your contribution is integrated into this repository we feel responsible for it. Therefore, be prepared for constructive feedback. Before we merge anything we need to ensure that it fits in and is consistent with the rest of NodeMCU.
22-
If you made something really cool but won't spend time to integrate it into this upstream project please still share it in your fork on GitHub. If you mention it in an issues we'll take a look at it anyway.
2317

2418
## Development environment setup
2519
Use the platform and tools you feel most comfortable with. There are no constraints imposed by this project. You have (at least) two options to set up the toolchain to build the NodeMCU firmware:
@@ -58,7 +52,7 @@ Avoid intermediate merge commits. [Rebase](https://www.atlassian.com/git/tutoria
5852
1. `git checkout <branch-name>`
5953
1. Make changes to the code base and commit them using e.g. `git commit -a -m 'Look ma, I did it'`
6054
1. When you're done:
61-
1. Think about [squashing (some of) your commits](http://www.andrewconnell.com/blog/squash-multiple-git-commits-into-one). There are [several ways](http://stackoverflow.com/a/5201642/131929) to do this. There's no need to squash everything into a single commit as GitHub offers to do this when we merge your changes. However, you might want to trim your commit history to relevant chunks.
55+
1. [Squash your commits](http://www.andrewconnell.com/blog/squash-multiple-git-commits-into-one). There are [several ways](http://stackoverflow.com/a/5201642/131929) of doing this.
6256
1. Bring your fork up-to-date with the NodeMCU upstream repo ([see below](#keeping-your-fork-in-sync)). Then rebase your branch on `dev` running `git rebase dev`.
6357
1. `git push`
6458
1. [Create a pull request](https://help.github.com/articles/creating-a-pull-request/) (PR) on GitHub.
@@ -96,15 +90,3 @@ Further paragraphs come after blank lines.
9690
Don't forget to [reference affected issues](https://help.github.com/articles/closing-issues-via-commit-messages/) in the commit message to have them closed automatically on GitHub.
9791

9892
[Amend](https://help.github.com/articles/changing-a-commit-message/) your commit messages if necessary to make sure what the world sees on GitHub is as expressive and meaningful as possible.
99-
100-
## For collaborators
101-
102-
### Handling releases
103-
- Create a [milestone](https://github.com/nodemcu/nodemcu-firmware/milestones) right after you cut a new release. Give it a meaningful name if you already have an idea what the scope of the upcoming release is going to be. Also set the due date to ~2 months in the future.
104-
- Add this milestone to every PR before you merge it. Also add the milestone to PRs you want to see land in this milestone.
105-
- Add notes to the description of the milestone in the course of the ~2 months it lives.
106-
- Be careful and reluctant to merge PRs once we're past the 6-weeks mark of a milestone. Ideally we don't merge anything in the last 2 weeks.
107-
- Cutting a release
108-
- Create an annotated tag like so: `git tag -a <SDK-version>-master_<yyyyMMdd> -m ""`, `git push --tags`
109-
- Create a new [release](https://github.com/nodemcu/nodemcu-firmware/releases) based on the tag you just pushed. The version name is the same as the tag name.
110-
- Write release notes. Mention breaking changes explicitly. Since every PR that went into this release is linked to from the milestone it should be fairly easy to include important changes in the release notes.

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -207,14 +207,14 @@ sdk_patched: sdk_extracted $(TOP_DIR)/sdk/.patched-$(SDK_VER)
207207

208208
$(TOP_DIR)/sdk/.extracted-$(SDK_BASE_VER): $(TOP_DIR)/cache/esp_iot_sdk_v$(SDK_FILE_VER).zip
209209
mkdir -p "$(dir $@)"
210-
(cd "$(dir $@)" && rm -fr esp_iot_sdk_v$(SDK_VER) ESP8266_NONOS_SDK && unzip $(TOP_DIR)/cache/esp_iot_sdk_v$(SDK_FILE_VER).zip ESP8266_NONOS_SDK/lib/* ESP8266_NONOS_SDK/ld/eagle.rom.addr.v6.ld ESP8266_NONOS_SDK/include/* ESP8266_NONOS_SDK/bin/esp_init_data_default.bin)
210+
(cd "$(dir $@)" && rm -fr esp_iot_sdk_v$(SDK_VER) ESP8266_NONOS_SDK && unzip $(TOP_DIR)/cache/esp_iot_sdk_v$(SDK_FILE_VER).zip ESP8266_NONOS_SDK/lib/* ESP8266_NONOS_SDK/ld/eagle.rom.addr.v6.ld ESP8266_NONOS_SDK/include/* )
211211
mv $(dir $@)/ESP8266_NONOS_SDK $(dir $@)/esp_iot_sdk_v$(SDK_VER)
212212
rm -f $(SDK_DIR)/lib/liblwip.a
213213
touch $@
214214

215215
$(TOP_DIR)/sdk/.patched-$(SDK_VER): $(TOP_DIR)/cache/esp_iot_sdk_v$(SDK_PATCH_VER).zip
216216
mkdir -p "$(dir $@)/patch"
217-
(cd "$(dir $@)/patch" && unzip $(TOP_DIR)/cache/esp_iot_sdk_v$(SDK_PATCH_VER)*.zip *.a esp_init_data_default.bin && mv *.a $(SDK_DIR)/lib/ && mv esp_init_data_default.bin $(SDK_DIR)/bin/)
217+
(cd "$(dir $@)/patch" && unzip $(TOP_DIR)/cache/esp_iot_sdk_v$(SDK_PATCH_VER)*.zip *.a && mv *.a $(SDK_DIR)/lib/)
218218
rmdir $(dir $@)/patch
219219
rm -f $(SDK_DIR)/lib/liblwip.a
220220
touch $@

app/driver/i2c_master.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,6 @@ LOCAL uint8 pinSCL = 15;
3333
LOCAL void ICACHE_FLASH_ATTR
3434
i2c_master_setDC(uint8 SDA, uint8 SCL)
3535
{
36-
uint8 sclLevel;
37-
3836
SDA &= 0x01;
3937
SCL &= 0x01;
4038
m_nLastSDA = SDA;
@@ -49,11 +47,6 @@ i2c_master_setDC(uint8 SDA, uint8 SCL)
4947
} else {
5048
I2C_MASTER_SDA_HIGH_SCL_HIGH();
5149
}
52-
if(1 == SCL) {
53-
do {
54-
sclLevel = GPIO_INPUT_GET(GPIO_ID_PIN(I2C_MASTER_SCL_GPIO));
55-
} while(sclLevel == 0);
56-
}
5750
}
5851

5952
/******************************************************************************

app/driver/uart.c

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@
3030

3131
// For event signalling
3232
static task_handle_t sig = 0;
33-
static uint8 *sig_flag;
34-
static uint8 isr_flag = 0;
3533

3634
// UartDev is defined and initialized in rom code.
3735
extern UartDevice UartDev;
@@ -279,12 +277,8 @@ uart0_rx_intr_handler(void *para)
279277
got_input = true;
280278
}
281279

282-
if (got_input && sig) {
283-
if (isr_flag == *sig_flag) {
284-
isr_flag ^= 0x01;
285-
task_post_low (sig, 0x8000 | isr_flag << 14 | false);
286-
}
287-
}
280+
if (got_input && sig)
281+
task_post_low (sig, false);
288282
}
289283

290284
static void
@@ -322,21 +316,21 @@ uart_stop_autobaud()
322316
* Description : user interface for init uart
323317
* Parameters : UartBautRate uart0_br - uart0 bautrate
324318
* UartBautRate uart1_br - uart1 bautrate
319+
* uint8 task_prio - task priority to signal on input
325320
* os_signal_t sig_input - signal to post
326-
* uint8 *flag_input - flag of consumer task
327321
* Returns : NONE
328322
*******************************************************************************/
329323
void ICACHE_FLASH_ATTR
330-
uart_init(UartBautRate uart0_br, UartBautRate uart1_br, os_signal_t sig_input, uint8 *flag_input)
324+
uart_init(UartBautRate uart0_br, UartBautRate uart1_br, os_signal_t sig_input)
331325
{
332326
sig = sig_input;
333-
sig_flag = flag_input;
334327

335328
// rom use 74880 baut_rate, here reinitialize
336329
UartDev.baut_rate = uart0_br;
337330
uart_config(UART0);
338331
UartDev.baut_rate = uart1_br;
339332
uart_config(UART1);
333+
ETS_UART_INTR_ENABLE();
340334
#ifdef BIT_RATE_AUTOBAUD
341335
uart_init_autobaud(0);
342336
#endif

app/http/httpclient.c

Lines changed: 36 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
*/
1414

1515
#include "osapi.h"
16-
#include "../libc/c_stdio.h"
1716
#include "user_interface.h"
1817
#include "espconn.h"
1918
#include "mem.h"
@@ -95,7 +94,7 @@ static int ICACHE_FLASH_ATTR http_chunked_decode( const char * chunked, char * d
9594
char * endstr;
9695
/* [chunk-size] */
9796
i = strtoul( str + j, NULL, 16 );
98-
HTTPCLIENT_DEBUG( "Chunk Size:%d", i );
97+
HTTPCLIENT_DEBUG( "Chunk Size:%d\r\n", i );
9998
if ( i <= 0 )
10099
break;
101100
/* [chunk-size-end-ptr] */
@@ -138,7 +137,7 @@ static void ICACHE_FLASH_ATTR http_receive_callback( void * arg, char * buf, uns
138137
char * new_buffer;
139138
if ( new_size > BUFFER_SIZE_MAX || NULL == (new_buffer = (char *) os_malloc( new_size ) ) )
140139
{
141-
HTTPCLIENT_ERR( "Response too long (%d)", new_size );
140+
HTTPCLIENT_DEBUG( "Response too long (%d)\n", new_size );
142141
req->buffer[0] = '\0'; /* Discard the buffer to avoid using an incomplete response. */
143142
if ( req->secure )
144143
espconn_secure_disconnect( conn );
@@ -164,12 +163,12 @@ static void ICACHE_FLASH_ATTR http_send_callback( void * arg )
164163

165164
if ( req->post_data == NULL )
166165
{
167-
HTTPCLIENT_DEBUG( "All sent" );
166+
HTTPCLIENT_DEBUG( "All sent\n" );
168167
}
169168
else
170169
{
171170
/* The headers were sent, now send the contents. */
172-
HTTPCLIENT_DEBUG( "Sending request body" );
171+
HTTPCLIENT_DEBUG( "Sending request body\n" );
173172
if ( req->secure )
174173
espconn_secure_send( conn, (uint8_t *) req->post_data, strlen( req->post_data ) );
175174
else
@@ -182,7 +181,7 @@ static void ICACHE_FLASH_ATTR http_send_callback( void * arg )
182181

183182
static void ICACHE_FLASH_ATTR http_connect_callback( void * arg )
184183
{
185-
HTTPCLIENT_DEBUG( "Connected" );
184+
HTTPCLIENT_DEBUG( "Connected\n" );
186185
struct espconn * conn = (struct espconn *) arg;
187186
request_args_t * req = (request_args_t *) conn->reverse;
188187
espconn_regist_recvcb( conn, http_receive_callback );
@@ -251,7 +250,7 @@ static void ICACHE_FLASH_ATTR http_connect_callback( void * arg )
251250
}
252251

253252
req->headers = NULL;
254-
HTTPCLIENT_DEBUG( "Sending request header" );
253+
HTTPCLIENT_DEBUG( "Sending request header\n" );
255254
}
256255

257256
static void http_free_req( request_args_t * req)
@@ -273,7 +272,7 @@ static void http_free_req( request_args_t * req)
273272

274273
static void ICACHE_FLASH_ATTR http_disconnect_callback( void * arg )
275274
{
276-
HTTPCLIENT_DEBUG( "Disconnected" );
275+
HTTPCLIENT_DEBUG( "Disconnected\n" );
277276
struct espconn *conn = (struct espconn *) arg;
278277

279278
if ( conn == NULL )
@@ -296,7 +295,7 @@ static void ICACHE_FLASH_ATTR http_disconnect_callback( void * arg )
296295

297296
if ( req->buffer == NULL )
298297
{
299-
HTTPCLIENT_DEBUG( "Buffer probably shouldn't be NULL" );
298+
HTTPCLIENT_DEBUG( "Buffer probably shouldn't be NULL\n" );
300299
}
301300
else if ( req->buffer[0] != '\0' )
302301
{
@@ -306,7 +305,7 @@ static void ICACHE_FLASH_ATTR http_disconnect_callback( void * arg )
306305
if (( os_strncmp( req->buffer, version_1_0, strlen( version_1_0 ) ) != 0 ) &&
307306
( os_strncmp( req->buffer, version_1_1, strlen( version_1_1 ) ) != 0 ))
308307
{
309-
HTTPCLIENT_ERR( "Invalid version in %s", req->buffer );
308+
HTTPCLIENT_DEBUG( "Invalid version in %s\n", req->buffer );
310309
}
311310
else
312311
{
@@ -327,7 +326,7 @@ static void ICACHE_FLASH_ATTR http_disconnect_callback( void * arg )
327326

328327
char *locationOffsetEnd = (char *) os_strstr(locationOffset, "\r\n");
329328
if ( locationOffsetEnd == NULL ) {
330-
HTTPCLIENT_ERR( "Found Location header but was incomplete" );
329+
HTTPCLIENT_DEBUG( "Found Location header but was incomplete\n" );
331330
http_status = -1;
332331
} else {
333332
*locationOffsetEnd = '\0';
@@ -372,15 +371,15 @@ static void ICACHE_FLASH_ATTR http_disconnect_callback( void * arg )
372371
return;
373372
}
374373
} else {
375-
HTTPCLIENT_ERR("Too many redirections");
374+
HTTPCLIENT_DEBUG("Too many redirections\n");
376375
http_status = -1;
377376
}
378377
} else {
379378
body = (char *) os_strstr(req->buffer, "\r\n\r\n");
380379

381380
if (NULL == body) {
382381
/* Find missing body */
383-
HTTPCLIENT_ERR("Body shouldn't be NULL");
382+
HTTPCLIENT_DEBUG("Body shouldn't be NULL\n");
384383
/* To avoid NULL body */
385384
body = "";
386385
} else {
@@ -412,9 +411,16 @@ static void ICACHE_FLASH_ATTR http_disconnect_callback( void * arg )
412411
}
413412

414413

414+
static void ICACHE_FLASH_ATTR http_error_callback( void *arg, sint8 errType )
415+
{
416+
HTTPCLIENT_DEBUG( "Disconnected with error\n" );
417+
http_disconnect_callback( arg );
418+
}
419+
420+
415421
static void ICACHE_FLASH_ATTR http_timeout_callback( void *arg )
416422
{
417-
HTTPCLIENT_ERR( "Connection timeout" );
423+
HTTPCLIENT_DEBUG( "Connection timeout\n" );
418424
struct espconn * conn = (struct espconn *) arg;
419425
if ( conn == NULL )
420426
{
@@ -433,20 +439,13 @@ static void ICACHE_FLASH_ATTR http_timeout_callback( void *arg )
433439
}
434440

435441

436-
static void ICACHE_FLASH_ATTR http_error_callback( void *arg, sint8 errType )
437-
{
438-
HTTPCLIENT_ERR( "Disconnected with error: %d", errType );
439-
http_timeout_callback( arg );
440-
}
441-
442-
443442
static void ICACHE_FLASH_ATTR http_dns_callback( const char * hostname, ip_addr_t * addr, void * arg )
444443
{
445444
request_args_t * req = (request_args_t *) arg;
446445

447446
if ( addr == NULL )
448447
{
449-
HTTPCLIENT_ERR( "DNS failed for %s", hostname );
448+
HTTPCLIENT_DEBUG( "DNS failed for %s\n", hostname );
450449
if ( req->callback_handle != NULL )
451450
{
452451
req->callback_handle( "", -1, "" );
@@ -455,7 +454,7 @@ static void ICACHE_FLASH_ATTR http_dns_callback( const char * hostname, ip_addr_
455454
}
456455
else
457456
{
458-
HTTPCLIENT_DEBUG( "DNS found %s " IPSTR, hostname, IP2STR( addr ) );
457+
HTTPCLIENT_DEBUG( "DNS found %s " IPSTR "\n", hostname, IP2STR( addr ) );
459458

460459
struct espconn * conn = (struct espconn *) os_zalloc( sizeof(struct espconn) );
461460
conn->type = ESPCONN_TCP;
@@ -490,7 +489,7 @@ static void ICACHE_FLASH_ATTR http_dns_callback( const char * hostname, ip_addr_
490489

491490
void ICACHE_FLASH_ATTR http_raw_request( const char * hostname, int port, bool secure, const char * method, const char * path, const char * headers, const char * post_data, http_callback_t callback_handle, int redirect_follow_count )
492491
{
493-
HTTPCLIENT_DEBUG( "DNS request" );
492+
HTTPCLIENT_DEBUG( "DNS request\n" );
494493

495494
request_args_t * req = (request_args_t *) os_zalloc( sizeof(request_args_t) );
496495
req->hostname = esp_strdup( hostname );
@@ -513,7 +512,7 @@ void ICACHE_FLASH_ATTR http_raw_request( const char * hostname, int port, bool s
513512

514513
if ( error == ESPCONN_INPROGRESS )
515514
{
516-
HTTPCLIENT_DEBUG( "DNS pending" );
515+
HTTPCLIENT_DEBUG( "DNS pending\n" );
517516
}
518517
else if ( error == ESPCONN_OK )
519518
{
@@ -524,9 +523,9 @@ void ICACHE_FLASH_ATTR http_raw_request( const char * hostname, int port, bool s
524523
{
525524
if ( error == ESPCONN_ARG )
526525
{
527-
HTTPCLIENT_ERR( "DNS arg error %s", hostname );
526+
HTTPCLIENT_DEBUG( "DNS arg error %s\n", hostname );
528527
}else {
529-
HTTPCLIENT_ERR( "DNS error code %d", error );
528+
HTTPCLIENT_DEBUG( "DNS error code %d\n", error );
530529
}
531530
http_dns_callback( hostname, NULL, req ); /* Handle all DNS errors the same way. */
532531
}
@@ -562,7 +561,7 @@ void ICACHE_FLASH_ATTR http_request( const char * url, const char * method, cons
562561
}
563562
else
564563
{
565-
HTTPCLIENT_ERR( "URL is not HTTP or HTTPS %s", url );
564+
HTTPCLIENT_DEBUG( "URL is not HTTP or HTTPS %s\n", url );
566565
return;
567566
}
568567

@@ -579,7 +578,7 @@ void ICACHE_FLASH_ATTR http_request( const char * url, const char * method, cons
579578
}
580579

581580
if (path - url >= sizeof(hostname)) {
582-
HTTPCLIENT_ERR( "hostname is too long %s", url );
581+
HTTPCLIENT_DEBUG( "hostname is too long %s\n", url );
583582
return;
584583
}
585584

@@ -593,7 +592,7 @@ void ICACHE_FLASH_ATTR http_request( const char * url, const char * method, cons
593592
port = atoi( colon + 1 );
594593
if ( port == 0 )
595594
{
596-
HTTPCLIENT_ERR( "Port error %s", url );
595+
HTTPCLIENT_DEBUG( "Port error %s\n", url );
597596
return;
598597
}
599598

@@ -607,10 +606,10 @@ void ICACHE_FLASH_ATTR http_request( const char * url, const char * method, cons
607606
path = "/";
608607
}
609608

610-
HTTPCLIENT_DEBUG( "hostname=%s", hostname );
611-
HTTPCLIENT_DEBUG( "port=%d", port );
612-
HTTPCLIENT_DEBUG( "method=%s", method );
613-
HTTPCLIENT_DEBUG( "path=%s", path );
609+
HTTPCLIENT_DEBUG( "hostname=%s\n", hostname );
610+
HTTPCLIENT_DEBUG( "port=%d\n", port );
611+
HTTPCLIENT_DEBUG( "method=%s\n", method );
612+
HTTPCLIENT_DEBUG( "path=%s\n", path );
614613
http_raw_request( hostname, port, secure, method, path, headers, post_data, callback_handle, redirect_follow_count);
615614
}
616615

@@ -646,11 +645,10 @@ void ICACHE_FLASH_ATTR http_put( const char * url, const char * headers, const c
646645

647646
void ICACHE_FLASH_ATTR http_callback_example( char * response, int http_status, char * full_response )
648647
{
649-
dbg_printf( "http_status=%d\n", http_status );
648+
os_printf( "http_status=%d\n", http_status );
650649
if ( http_status != HTTP_STATUS_GENERIC_ERROR )
651650
{
652-
dbg_printf( "strlen(full_response)=%d\n", strlen( full_response ) );
653-
dbg_printf( "response=%s<EOF>\n", response );
651+
os_printf( "strlen(full_response)=%d\n", strlen( full_response ) );
652+
os_printf( "response=%s<EOF>\n", response );
654653
}
655654
}
656-

0 commit comments

Comments
 (0)