Skip to content

Commit cda7a83

Browse files
committed
Update all exxamples
Signed-off-by: Mikhail Grigorev <[email protected]>
1 parent 6e89468 commit cda7a83

File tree

140 files changed

+3860
-783
lines changed

Some content is hidden

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

140 files changed

+3860
-783
lines changed

Espressif/examples/ESP8266/1wire_ds18b20/Makefile

+50-7
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,56 @@
22
include ../settings.mk
33

44
# Individual project settings (Optional)
5-
#BOOT = new
6-
#APP = 1
7-
#SPI_SPEED = 40
8-
#SPI_MODE = QIO
9-
#SPI_SIZE_MAP = 2
10-
#ESPPORT = COM2
11-
#ESPBAUD = 256000
5+
6+
# Boot mode:
7+
# Valid values are none, old, new
8+
# none - non use bootloader
9+
# old - boot_v1.1
10+
# new - boot_v1.2+
11+
#BOOT = new
12+
13+
# Choose bin generate (0=eagle.flash.bin+eagle.irom0text.bin, 1=user1.bin, 2=user2.bin)
14+
#APP = 1
15+
16+
# Flash Frequency for ESP8266
17+
# Clock frequency for SPI flash interactions.
18+
# Valid values are 20, 26, 40, 80 (MHz).
19+
#SPI_SPEED = 40
20+
21+
# Flash Mode for ESP8266
22+
# These set Quad Flash I/O or Dual Flash I/O modes.
23+
# Valid values are QIO, QOUT, DIO, DOUT
24+
#SPI_MODE = QIO
25+
26+
# Flash Size for ESP8266
27+
# Size of the SPI flash, given in megabytes.
28+
# ESP-12, ESP-12E and ESP-12F modules (and boards that use them such as NodeMCU, HUZZAH, etc.) usually
29+
# have at least 4 megabyte / 4MB (sometimes labelled 32 megabit) flash.
30+
# If using OTA, some additional sizes & layouts for OTA "firmware slots" are available.
31+
# If not using OTA updates then you can ignore these extra sizes:
32+
#
33+
# Valid values vary by chip type: 1, 2, 3, 4, 5, 6, 7, 8, 9
34+
#
35+
#|SPI_SIZE_MAP|flash_size arg | Number of OTA slots | OTA Slot Size | Non-OTA Space |
36+
#|------------|---------------|---------------------|---------------|---------------|
37+
#|1 |256KB | 1 (no OTA) | 256KB | N/A |
38+
#|2 |512KB | 1 (no OTA) | 512KB | N/A |
39+
#|3 |1MB | 2 | 512KB | 0KB |
40+
#|4 |2MB | 2 | 512KB | 1024KB |
41+
#|5 |4MB | 2 | 512KB | 3072KB |
42+
#|6 |2MB-c1 | 2 | 1024KB | 0KB |
43+
#|7 |4MB-c1 | 2 | 1024KB | 2048KB |
44+
#|8 |8MB [^] | 2 | 1024KB | 6144KB |
45+
#|9 |16MB [^] | 2 | 1024KB | 14336KB |
46+
#
47+
# [^] Support for 8MB & 16MB flash size is not present in all ESP8266 SDKs. If your SDK doesn't support these flash sizes, use 4MB.
48+
#
49+
#SPI_SIZE_MAP = 2
50+
51+
# COM port settings.
52+
# COM port number and baud rate:
53+
#ESPPORT = COM2
54+
#ESPBAUD = 256000
1255

1356
# Basic project settings
1457
MODULES = driver user

Espressif/examples/ESP8266/1wire_ds18b20/user/user_main.c

+12-6
Original file line numberDiff line numberDiff line change
@@ -31,22 +31,22 @@ LOCAL void ICACHE_FLASH_ATTR ds18b20_cb(void *arg)
3131
* Description : SDK just reversed 4 sectors, used for rf init data and paramters.
3232
* We add this function to force users to set rf cal sector, since
3333
* we don't know which sector is free in user's application.
34-
* sector map for last several sectors : ABBBCDDD
34+
* sector map for last several sectors : ABCCC
3535
* A : rf cal
36-
* B : at parameters
37-
* C : rf init data
38-
* D : sdk parameters
36+
* B : rf init data
37+
* C : sdk parameters
3938
* Parameters : none
4039
* Returns : rf cal sector
4140
*******************************************************************************/
42-
uint32 ICACHE_FLASH_ATTR user_rf_cal_sector_set(void)
41+
uint32 ICACHE_FLASH_ATTR
42+
user_rf_cal_sector_set(void)
4343
{
4444
enum flash_size_map size_map = system_get_flash_size_map();
4545
uint32 rf_cal_sec = 0;
4646

4747
switch (size_map) {
4848
case FLASH_SIZE_4M_MAP_256_256:
49-
rf_cal_sec = 128 - 8;
49+
rf_cal_sec = 128 - 5;
5050
break;
5151

5252
case FLASH_SIZE_8M_MAP_512_512:
@@ -63,6 +63,12 @@ uint32 ICACHE_FLASH_ATTR user_rf_cal_sector_set(void)
6363
rf_cal_sec = 1024 - 5;
6464
break;
6565

66+
case FLASH_SIZE_64M_MAP_1024_1024:
67+
rf_cal_sec = 2048 - 5;
68+
break;
69+
case FLASH_SIZE_128M_MAP_1024_1024:
70+
rf_cal_sec = 4096 - 5;
71+
break;
6672
default:
6773
rf_cal_sec = 0;
6874
break;

Espressif/examples/ESP8266/EspLightNode/Makefile

+50-7
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,56 @@
22
include ../settings.mk
33

44
# Individual project settings (Optional)
5-
#BOOT = new
6-
#APP = 1
7-
#SPI_SPEED = 40
8-
#SPI_MODE = QIO
9-
#SPI_SIZE_MAP = 2
10-
#ESPPORT = COM2
11-
#ESPBAUD = 256000
5+
6+
# Boot mode:
7+
# Valid values are none, old, new
8+
# none - non use bootloader
9+
# old - boot_v1.1
10+
# new - boot_v1.2+
11+
#BOOT = new
12+
13+
# Choose bin generate (0=eagle.flash.bin+eagle.irom0text.bin, 1=user1.bin, 2=user2.bin)
14+
#APP = 1
15+
16+
# Flash Frequency for ESP8266
17+
# Clock frequency for SPI flash interactions.
18+
# Valid values are 20, 26, 40, 80 (MHz).
19+
#SPI_SPEED = 40
20+
21+
# Flash Mode for ESP8266
22+
# These set Quad Flash I/O or Dual Flash I/O modes.
23+
# Valid values are QIO, QOUT, DIO, DOUT
24+
#SPI_MODE = QIO
25+
26+
# Flash Size for ESP8266
27+
# Size of the SPI flash, given in megabytes.
28+
# ESP-12, ESP-12E and ESP-12F modules (and boards that use them such as NodeMCU, HUZZAH, etc.) usually
29+
# have at least 4 megabyte / 4MB (sometimes labelled 32 megabit) flash.
30+
# If using OTA, some additional sizes & layouts for OTA "firmware slots" are available.
31+
# If not using OTA updates then you can ignore these extra sizes:
32+
#
33+
# Valid values vary by chip type: 1, 2, 3, 4, 5, 6, 7, 8, 9
34+
#
35+
#|SPI_SIZE_MAP|flash_size arg | Number of OTA slots | OTA Slot Size | Non-OTA Space |
36+
#|------------|---------------|---------------------|---------------|---------------|
37+
#|1 |256KB | 1 (no OTA) | 256KB | N/A |
38+
#|2 |512KB | 1 (no OTA) | 512KB | N/A |
39+
#|3 |1MB | 2 | 512KB | 0KB |
40+
#|4 |2MB | 2 | 512KB | 1024KB |
41+
#|5 |4MB | 2 | 512KB | 3072KB |
42+
#|6 |2MB-c1 | 2 | 1024KB | 0KB |
43+
#|7 |4MB-c1 | 2 | 1024KB | 2048KB |
44+
#|8 |8MB [^] | 2 | 1024KB | 6144KB |
45+
#|9 |16MB [^] | 2 | 1024KB | 14336KB |
46+
#
47+
# [^] Support for 8MB & 16MB flash size is not present in all ESP8266 SDKs. If your SDK doesn't support these flash sizes, use 4MB.
48+
#
49+
#SPI_SIZE_MAP = 2
50+
51+
# COM port settings.
52+
# COM port number and baud rate:
53+
#ESPPORT = COM2
54+
#ESPBAUD = 256000
1255

1356
# Basic project settings
1457
MODULES = driver user

Espressif/examples/ESP8266/EspLightNode/user/user_main.c

+12-6
Original file line numberDiff line numberDiff line change
@@ -133,22 +133,22 @@ void ICACHE_FLASH_ATTR setup_wifi_st_mode(void)
133133
* Description : SDK just reversed 4 sectors, used for rf init data and paramters.
134134
* We add this function to force users to set rf cal sector, since
135135
* we don't know which sector is free in user's application.
136-
* sector map for last several sectors : ABBBCDDD
136+
* sector map for last several sectors : ABCCC
137137
* A : rf cal
138-
* B : at parameters
139-
* C : rf init data
140-
* D : sdk parameters
138+
* B : rf init data
139+
* C : sdk parameters
141140
* Parameters : none
142141
* Returns : rf cal sector
143142
*******************************************************************************/
144-
uint32 ICACHE_FLASH_ATTR user_rf_cal_sector_set(void)
143+
uint32 ICACHE_FLASH_ATTR
144+
user_rf_cal_sector_set(void)
145145
{
146146
enum flash_size_map size_map = system_get_flash_size_map();
147147
uint32 rf_cal_sec = 0;
148148

149149
switch (size_map) {
150150
case FLASH_SIZE_4M_MAP_256_256:
151-
rf_cal_sec = 128 - 8;
151+
rf_cal_sec = 128 - 5;
152152
break;
153153

154154
case FLASH_SIZE_8M_MAP_512_512:
@@ -165,6 +165,12 @@ uint32 ICACHE_FLASH_ATTR user_rf_cal_sector_set(void)
165165
rf_cal_sec = 1024 - 5;
166166
break;
167167

168+
case FLASH_SIZE_64M_MAP_1024_1024:
169+
rf_cal_sec = 2048 - 5;
170+
break;
171+
case FLASH_SIZE_128M_MAP_1024_1024:
172+
rf_cal_sec = 4096 - 5;
173+
break;
168174
default:
169175
rf_cal_sec = 0;
170176
break;

Espressif/examples/ESP8266/I2S_Demo/Makefile

+50-7
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,56 @@
22
include ../settings.mk
33

44
# Individual project settings (Optional)
5-
#BOOT = new
6-
#APP = 1
7-
#SPI_SPEED = 40
8-
#SPI_MODE = QIO
9-
#SPI_SIZE_MAP = 2
10-
#ESPPORT = COM2
11-
#ESPBAUD = 256000
5+
6+
# Boot mode:
7+
# Valid values are none, old, new
8+
# none - non use bootloader
9+
# old - boot_v1.1
10+
# new - boot_v1.2+
11+
#BOOT = new
12+
13+
# Choose bin generate (0=eagle.flash.bin+eagle.irom0text.bin, 1=user1.bin, 2=user2.bin)
14+
#APP = 1
15+
16+
# Flash Frequency for ESP8266
17+
# Clock frequency for SPI flash interactions.
18+
# Valid values are 20, 26, 40, 80 (MHz).
19+
#SPI_SPEED = 40
20+
21+
# Flash Mode for ESP8266
22+
# These set Quad Flash I/O or Dual Flash I/O modes.
23+
# Valid values are QIO, QOUT, DIO, DOUT
24+
#SPI_MODE = QIO
25+
26+
# Flash Size for ESP8266
27+
# Size of the SPI flash, given in megabytes.
28+
# ESP-12, ESP-12E and ESP-12F modules (and boards that use them such as NodeMCU, HUZZAH, etc.) usually
29+
# have at least 4 megabyte / 4MB (sometimes labelled 32 megabit) flash.
30+
# If using OTA, some additional sizes & layouts for OTA "firmware slots" are available.
31+
# If not using OTA updates then you can ignore these extra sizes:
32+
#
33+
# Valid values vary by chip type: 1, 2, 3, 4, 5, 6, 7, 8, 9
34+
#
35+
#|SPI_SIZE_MAP|flash_size arg | Number of OTA slots | OTA Slot Size | Non-OTA Space |
36+
#|------------|---------------|---------------------|---------------|---------------|
37+
#|1 |256KB | 1 (no OTA) | 256KB | N/A |
38+
#|2 |512KB | 1 (no OTA) | 512KB | N/A |
39+
#|3 |1MB | 2 | 512KB | 0KB |
40+
#|4 |2MB | 2 | 512KB | 1024KB |
41+
#|5 |4MB | 2 | 512KB | 3072KB |
42+
#|6 |2MB-c1 | 2 | 1024KB | 0KB |
43+
#|7 |4MB-c1 | 2 | 1024KB | 2048KB |
44+
#|8 |8MB [^] | 2 | 1024KB | 6144KB |
45+
#|9 |16MB [^] | 2 | 1024KB | 14336KB |
46+
#
47+
# [^] Support for 8MB & 16MB flash size is not present in all ESP8266 SDKs. If your SDK doesn't support these flash sizes, use 4MB.
48+
#
49+
#SPI_SIZE_MAP = 2
50+
51+
# COM port settings.
52+
# COM port number and baud rate:
53+
#ESPPORT = COM2
54+
#ESPBAUD = 256000
1255

1356
# Basic project settings
1457
MODULES = driver user

Espressif/examples/ESP8266/I2S_Demo/user/user_main.c

+12-6
Original file line numberDiff line numberDiff line change
@@ -18,22 +18,22 @@
1818
* Description : SDK just reversed 4 sectors, used for rf init data and paramters.
1919
* We add this function to force users to set rf cal sector, since
2020
* we don't know which sector is free in user's application.
21-
* sector map for last several sectors : ABBBCDDD
21+
* sector map for last several sectors : ABCCC
2222
* A : rf cal
23-
* B : at parameters
24-
* C : rf init data
25-
* D : sdk parameters
23+
* B : rf init data
24+
* C : sdk parameters
2625
* Parameters : none
2726
* Returns : rf cal sector
2827
*******************************************************************************/
29-
uint32 ICACHE_FLASH_ATTR user_rf_cal_sector_set(void)
28+
uint32 ICACHE_FLASH_ATTR
29+
user_rf_cal_sector_set(void)
3030
{
3131
enum flash_size_map size_map = system_get_flash_size_map();
3232
uint32 rf_cal_sec = 0;
3333

3434
switch (size_map) {
3535
case FLASH_SIZE_4M_MAP_256_256:
36-
rf_cal_sec = 128 - 8;
36+
rf_cal_sec = 128 - 5;
3737
break;
3838

3939
case FLASH_SIZE_8M_MAP_512_512:
@@ -50,6 +50,12 @@ uint32 ICACHE_FLASH_ATTR user_rf_cal_sector_set(void)
5050
rf_cal_sec = 1024 - 5;
5151
break;
5252

53+
case FLASH_SIZE_64M_MAP_1024_1024:
54+
rf_cal_sec = 2048 - 5;
55+
break;
56+
case FLASH_SIZE_128M_MAP_1024_1024:
57+
rf_cal_sec = 4096 - 5;
58+
break;
5359
default:
5460
rf_cal_sec = 0;
5561
break;

Espressif/examples/ESP8266/IoT_Demo/Makefile

+50-7
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,56 @@
22
include ../settings.mk
33

44
# Individual project settings (Optional)
5-
#BOOT = new
6-
#APP = 1
7-
#SPI_SPEED = 40
8-
#SPI_MODE = QIO
9-
#SPI_SIZE_MAP = 2
10-
#ESPPORT = COM2
11-
#ESPBAUD = 256000
5+
6+
# Boot mode:
7+
# Valid values are none, old, new
8+
# none - non use bootloader
9+
# old - boot_v1.1
10+
# new - boot_v1.2+
11+
#BOOT = new
12+
13+
# Choose bin generate (0=eagle.flash.bin+eagle.irom0text.bin, 1=user1.bin, 2=user2.bin)
14+
#APP = 1
15+
16+
# Flash Frequency for ESP8266
17+
# Clock frequency for SPI flash interactions.
18+
# Valid values are 20, 26, 40, 80 (MHz).
19+
#SPI_SPEED = 40
20+
21+
# Flash Mode for ESP8266
22+
# These set Quad Flash I/O or Dual Flash I/O modes.
23+
# Valid values are QIO, QOUT, DIO, DOUT
24+
#SPI_MODE = QIO
25+
26+
# Flash Size for ESP8266
27+
# Size of the SPI flash, given in megabytes.
28+
# ESP-12, ESP-12E and ESP-12F modules (and boards that use them such as NodeMCU, HUZZAH, etc.) usually
29+
# have at least 4 megabyte / 4MB (sometimes labelled 32 megabit) flash.
30+
# If using OTA, some additional sizes & layouts for OTA "firmware slots" are available.
31+
# If not using OTA updates then you can ignore these extra sizes:
32+
#
33+
# Valid values vary by chip type: 1, 2, 3, 4, 5, 6, 7, 8, 9
34+
#
35+
#|SPI_SIZE_MAP|flash_size arg | Number of OTA slots | OTA Slot Size | Non-OTA Space |
36+
#|------------|---------------|---------------------|---------------|---------------|
37+
#|1 |256KB | 1 (no OTA) | 256KB | N/A |
38+
#|2 |512KB | 1 (no OTA) | 512KB | N/A |
39+
#|3 |1MB | 2 | 512KB | 0KB |
40+
#|4 |2MB | 2 | 512KB | 1024KB |
41+
#|5 |4MB | 2 | 512KB | 3072KB |
42+
#|6 |2MB-c1 | 2 | 1024KB | 0KB |
43+
#|7 |4MB-c1 | 2 | 1024KB | 2048KB |
44+
#|8 |8MB [^] | 2 | 1024KB | 6144KB |
45+
#|9 |16MB [^] | 2 | 1024KB | 14336KB |
46+
#
47+
# [^] Support for 8MB & 16MB flash size is not present in all ESP8266 SDKs. If your SDK doesn't support these flash sizes, use 4MB.
48+
#
49+
#SPI_SIZE_MAP = 2
50+
51+
# COM port settings.
52+
# COM port number and baud rate:
53+
#ESPPORT = COM2
54+
#ESPBAUD = 256000
1255

1356
# Basic project settings
1457
MODULES = driver user

0 commit comments

Comments
 (0)