Skip to content

Commit f20db73

Browse files
authored
Merge branch 'master' into master
2 parents afd6fed + c1a4055 commit f20db73

File tree

13 files changed

+83
-43
lines changed

13 files changed

+83
-43
lines changed

Diff for: .github/workflows/build_py_tools.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
fetch-depth: 2
2323
ref: ${{ github.event.pull_request.head.ref }}
2424
- name: Verify Python Tools Changed
25-
uses: tj-actions/changed-files@v36
25+
uses: tj-actions/changed-files@v41
2626
id: verify-changed-files
2727
with:
2828
fetch_depth: '2'

Diff for: boards.txt

+14-31
Original file line numberDiff line numberDiff line change
@@ -29364,7 +29364,7 @@ esp32s3_powerfeather.build.variant=esp32s3_powerfeather
2936429364
esp32s3_powerfeather.build.board=ESP32S3_POWERFEATHER
2936529365

2936629366
esp32s3_powerfeather.build.usb_mode=1
29367-
esp32s3_powerfeather.build.cdc_on_boot=0
29367+
esp32s3_powerfeather.build.cdc_on_boot=1
2936829368
esp32s3_powerfeather.build.msc_on_boot=0
2936929369
esp32s3_powerfeather.build.dfu_on_boot=0
2937029370
esp32s3_powerfeather.build.f_cpu=240000000L
@@ -29377,8 +29377,9 @@ esp32s3_powerfeather.build.partitions=default_8MB
2937729377
esp32s3_powerfeather.build.defines=
2937829378
esp32s3_powerfeather.build.loop_core=
2937929379
esp32s3_powerfeather.build.event_core=
29380+
esp32s3_powerfeather.build.flash_type=qio
2938029381
esp32s3_powerfeather.build.psram_type=qspi
29381-
esp32s3_powerfeather.build.memory_type={build.boot}_{build.psram_type}
29382+
esp32s3_powerfeather.build.memory_type={build.flash_type}_{build.psram_type}
2938229383

2938329384
esp32s3_powerfeather.menu.PSRAM.disabled=Disabled
2938429385
esp32s3_powerfeather.menu.PSRAM.disabled.build.defines=
@@ -29418,10 +29419,10 @@ esp32s3_powerfeather.menu.USBMode.hwcdc.build.usb_mode=1
2941829419
esp32s3_powerfeather.menu.USBMode.default=USB-OTG (TinyUSB)
2941929420
esp32s3_powerfeather.menu.USBMode.default.build.usb_mode=0
2942029421

29421-
esp32s3_powerfeather.menu.CDCOnBoot.default=Disabled
29422-
esp32s3_powerfeather.menu.CDCOnBoot.default.build.cdc_on_boot=0
2942329422
esp32s3_powerfeather.menu.CDCOnBoot.cdc=Enabled
2942429423
esp32s3_powerfeather.menu.CDCOnBoot.cdc.build.cdc_on_boot=1
29424+
esp32s3_powerfeather.menu.CDCOnBoot.default=Disabled
29425+
esp32s3_powerfeather.menu.CDCOnBoot.default.build.cdc_on_boot=0
2942529426

2942629427
esp32s3_powerfeather.menu.MSCOnBoot.default=Disabled
2942729428
esp32s3_powerfeather.menu.MSCOnBoot.default.build.msc_on_boot=0
@@ -29440,39 +29441,21 @@ esp32s3_powerfeather.menu.UploadMode.cdc=USB-OTG CDC (TinyUSB)
2944029441
esp32s3_powerfeather.menu.UploadMode.cdc.upload.use_1200bps_touch=true
2944129442
esp32s3_powerfeather.menu.UploadMode.cdc.upload.wait_for_upload_port=true
2944229443

29443-
esp32s3_powerfeather.menu.PartitionScheme.default=Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS)
29444-
esp32s3_powerfeather.menu.PartitionScheme.default.build.partitions=default
29445-
esp32s3_powerfeather.menu.PartitionScheme.defaultffat=Default 4MB with ffat (1.2MB APP/1.5MB FATFS)
29446-
esp32s3_powerfeather.menu.PartitionScheme.defaultffat.build.partitions=default_ffat
2944729444
esp32s3_powerfeather.menu.PartitionScheme.default_8MB=8M with spiffs (3MB APP/1.5MB SPIFFS)
2944829445
esp32s3_powerfeather.menu.PartitionScheme.default_8MB.build.partitions=default_8MB
2944929446
esp32s3_powerfeather.menu.PartitionScheme.default_8MB.upload.maximum_size=3342336
29450-
esp32s3_powerfeather.menu.PartitionScheme.minimal=Minimal (1.3MB APP/700KB SPIFFS)
29451-
esp32s3_powerfeather.menu.PartitionScheme.minimal.build.partitions=minimal
29452-
esp32s3_powerfeather.menu.PartitionScheme.no_ota=No OTA (2MB APP/2MB SPIFFS)
29453-
esp32s3_powerfeather.menu.PartitionScheme.no_ota.build.partitions=no_ota
29454-
esp32s3_powerfeather.menu.PartitionScheme.no_ota.upload.maximum_size=2097152
29455-
esp32s3_powerfeather.menu.PartitionScheme.noota_3g=No OTA (1MB APP/3MB SPIFFS)
29456-
esp32s3_powerfeather.menu.PartitionScheme.noota_3g.build.partitions=noota_3g
29457-
esp32s3_powerfeather.menu.PartitionScheme.noota_3g.upload.maximum_size=1048576
29458-
esp32s3_powerfeather.menu.PartitionScheme.noota_ffat=No OTA (2MB APP/2MB FATFS)
29459-
esp32s3_powerfeather.menu.PartitionScheme.noota_ffat.build.partitions=noota_ffat
29460-
esp32s3_powerfeather.menu.PartitionScheme.noota_ffat.upload.maximum_size=2097152
29461-
esp32s3_powerfeather.menu.PartitionScheme.noota_3gffat=No OTA (1MB APP/3MB FATFS)
29462-
esp32s3_powerfeather.menu.PartitionScheme.noota_3gffat.build.partitions=noota_3gffat
29463-
esp32s3_powerfeather.menu.PartitionScheme.noota_3gffat.upload.maximum_size=1048576
29464-
esp32s3_powerfeather.menu.PartitionScheme.huge_app=Huge APP (3MB No OTA/1MB SPIFFS)
29465-
esp32s3_powerfeather.menu.PartitionScheme.huge_app.build.partitions=huge_app
29466-
esp32s3_powerfeather.menu.PartitionScheme.huge_app.upload.maximum_size=3145728
29467-
esp32s3_powerfeather.menu.PartitionScheme.min_spiffs=Minimal SPIFFS (1.9MB APP with OTA/190KB SPIFFS)
29468-
esp32s3_powerfeather.menu.PartitionScheme.min_spiffs.build.partitions=min_spiffs
29469-
esp32s3_powerfeather.menu.PartitionScheme.min_spiffs.upload.maximum_size=1966080
29447+
esp32s3_powerfeather.menu.PartitionScheme.default_ffat_8MB=8M with ffat (3MB APP/1.5MB FATFS)
29448+
esp32s3_powerfeather.menu.PartitionScheme.default_ffat_8MB.build.partitions=default_ffat_8MB
29449+
esp32s3_powerfeather.menu.PartitionScheme.default_ffat_8MB.upload.maximum_size=3342336
29450+
esp32s3_powerfeather.menu.PartitionScheme.large_spiffs_8MB=Large SPIFFS (1.2MB APP/5.3MB SPIFFS)
29451+
esp32s3_powerfeather.menu.PartitionScheme.large_spiffs_8MB.build.partitions=large_spiffs_8MB
29452+
esp32s3_powerfeather.menu.PartitionScheme.large_spiffs_8MB.upload.maximum_size=1310720
29453+
esp32s3_powerfeather.menu.PartitionScheme.large_ffat_8MB=Large FFAT (1.2MB APP/5.3MB FATFS)
29454+
esp32s3_powerfeather.menu.PartitionScheme.large_ffat_8MB.build.partitions=large_ffat_8MB
29455+
esp32s3_powerfeather.menu.PartitionScheme.large_ffat_8MB.upload.maximum_size=1310720
2947029456
esp32s3_powerfeather.menu.PartitionScheme.max_app_8MB=Maximum APP (7.9MB APP No OTA/No FS)
2947129457
esp32s3_powerfeather.menu.PartitionScheme.max_app_8MB.build.partitions=max_app_8MB
2947229458
esp32s3_powerfeather.menu.PartitionScheme.max_app_8MB.upload.maximum_size=8257536
29473-
esp32s3_powerfeather.menu.PartitionScheme.rainmaker=RainMaker
29474-
esp32s3_powerfeather.menu.PartitionScheme.rainmaker.build.partitions=rainmaker
29475-
esp32s3_powerfeather.menu.PartitionScheme.rainmaker.upload.maximum_size=3145728
2947629459

2947729460
esp32s3_powerfeather.menu.CPUFreq.240=240MHz (WiFi)
2947829461
esp32s3_powerfeather.menu.CPUFreq.240.build.f_cpu=240000000L

Diff for: cores/esp32/Esp.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,7 @@ unsigned long long operator"" _GB(unsigned long long x)
131131

132132
EspClass ESP;
133133

134-
void EspClass::deepSleep(uint32_t time_us)
134+
void EspClass::deepSleep(uint64_t time_us)
135135
{
136136
esp_deep_sleep(time_us);
137137
}

Diff for: cores/esp32/Esp.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ class EspClass
8686
const char * getSdkVersion(); //version of ESP-IDF
8787
const char * getCoreVersion();//version of this core
8888

89-
void deepSleep(uint32_t time_us);
89+
void deepSleep(uint64_t time_us);
9090

9191
uint32_t getFlashChipSize();
9292
uint32_t getFlashChipSpeed();

Diff for: cores/esp32/Tone.cpp

+1
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,7 @@ void noTone(uint8_t pin){
9595
.frequency = 0, // Ignored
9696
.duration = 0, // Ignored
9797
};
98+
xQueueReset(_tone_queue); // clear queue
9899
xQueueSend(_tone_queue, &tone_msg, portMAX_DELAY);
99100
}
100101
}

Diff for: cores/esp32/esp32-hal-ledc.c

+17-5
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,11 @@ static bool ledcDetachBus(void * bus){
5656
return true;
5757
}
5858

59-
bool ledcAttach(uint8_t pin, uint32_t freq, uint8_t resolution)
59+
bool ledcAttachChannel(uint8_t pin, uint32_t freq, uint8_t resolution, uint8_t channel)
6060
{
61-
int free_channel = ~ledc_handle.used_channels & (ledc_handle.used_channels+1);
62-
if (free_channel == 0 || resolution > LEDC_MAX_BIT_WIDTH)
61+
if (channel >= LEDC_CHANNELS || resolution > LEDC_MAX_BIT_WIDTH)
6362
{
64-
log_e("No more LEDC channels available! (maximum %u) or bit width too big (maximum %u)", LEDC_CHANNELS, LEDC_MAX_BIT_WIDTH);
63+
log_e("Channel %u is not available! (maximum %u) or bit width too big (maximum %u)", channel, LEDC_CHANNELS, LEDC_MAX_BIT_WIDTH);
6564
return false;
6665
}
6766

@@ -71,7 +70,6 @@ bool ledcAttach(uint8_t pin, uint32_t freq, uint8_t resolution)
7170
return false;
7271
}
7372

74-
int channel = log2(free_channel & -free_channel);
7573
uint8_t group=(channel/8), timer=((channel/2)%4);
7674

7775
ledc_timer_config_t ledc_timer = {
@@ -115,8 +113,22 @@ bool ledcAttach(uint8_t pin, uint32_t freq, uint8_t resolution)
115113
return false;
116114
}
117115

116+
log_i("LEDC attached to pin %u (channel %u, resolution %u)", pin, channel, resolution);
118117
return true;
119118
}
119+
120+
bool ledcAttach(uint8_t pin, uint32_t freq, uint8_t resolution)
121+
{
122+
uint8_t free_channel = ~ledc_handle.used_channels & (ledc_handle.used_channels+1);
123+
if (free_channel == 0 || resolution > LEDC_MAX_BIT_WIDTH){
124+
log_e("No more LEDC channels available! (maximum %u) or bit width too big (maximum %u)", LEDC_CHANNELS, LEDC_MAX_BIT_WIDTH);
125+
return false;
126+
}
127+
int channel = log2(free_channel & -free_channel);
128+
129+
return ledcAttachChannel(pin, freq, resolution, channel);
130+
}
131+
120132
bool ledcWrite(uint8_t pin, uint32_t duty)
121133
{
122134
ledc_channel_handle_t *bus = (ledc_channel_handle_t*)perimanGetPinBus(pin, ESP32_BUS_TYPE_LEDC);

Diff for: cores/esp32/esp32-hal-ledc.h

+1
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@ typedef struct {
4545

4646
//channel 0-15 resolution 1-16bits freq limits depend on resolution
4747
bool ledcAttach(uint8_t pin, uint32_t freq, uint8_t resolution);
48+
bool ledcAttachChannel(uint8_t pin, uint32_t freq, uint8_t resolution, uint8_t channel);
4849
bool ledcWrite(uint8_t pin, uint32_t duty);
4950
uint32_t ledcWriteTone(uint8_t pin, uint32_t freq);
5051
uint32_t ledcWriteNote(uint8_t pin, note_t note, uint8_t octave);

Diff for: docs/source/api/ledc.rst

+20
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ ledcAttach
2727
**********
2828

2929
This function is used to setup LEDC pin with given frequency and resolution.
30+
LEDC channel will be selected automatically.
3031

3132
.. code-block:: arduino
3233
@@ -41,6 +42,25 @@ This function is used to setup LEDC pin with given frequency and resolution.
4142
This function will return ``true`` if configuration is successful.
4243
If ``false`` is returned, error occurs and LEDC channel was not configured.
4344

45+
ledcAttachChannel
46+
*****************
47+
48+
This function is used to setup LEDC pin with given frequency, resolution and channel.
49+
50+
.. code-block:: arduino
51+
52+
bool ledcAttachChannel(uint8_t pin, uint32_t freq, uint8_t resolution, uint8_t channel);
53+
54+
* ``pin`` select LEDC pin.
55+
* ``freq`` select frequency of pwm.
56+
* ``resolution`` select resolution for LEDC channel.
57+
* ``channel`` select LEDC channel.
58+
59+
* range is 1-14 bits (1-20 bits for ESP32).
60+
61+
This function will return ``true`` if configuration is successful.
62+
If ``false`` is returned, error occurs and LEDC channel was not configured.
63+
4464
ledcWrite
4565
*********
4666

Diff for: libraries/SD/src/sd_diskio.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,7 @@ char sdWriteBytes(uint8_t pdrv, const char* buffer, char token)
233233
ardu_sdcard_t * card = s_cards[pdrv];
234234
unsigned short crc = (card->supports_crc)?CRC16(buffer, 512):0xFFFF;
235235
if (!sdWait(pdrv, 500)) {
236-
return false;
236+
return 0;
237237
}
238238

239239
card->spi->write(token);
@@ -424,7 +424,7 @@ unsigned long sdGetSectorsCount(uint8_t pdrv)
424424
{
425425
for (int f = 0; f < 3; f++) {
426426
if(!sdSelectCard(pdrv)) {
427-
return false;
427+
return 0;
428428
}
429429

430430
if (!sdCommand(pdrv, SEND_CSD, 0, NULL)) {

Diff for: tools/partitions/default_ffat_8MB.csv

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Name, Type, SubType, Offset, Size, Flags
2+
nvs, data, nvs, 0x9000, 0x5000,
3+
otadata, data, ota, 0xe000, 0x2000,
4+
app0, app, ota_0, 0x10000, 0x330000,
5+
app1, app, ota_1, 0x340000,0x330000,
6+
ffat, data, fat, 0x670000,0x180000,
7+
coredump, data, coredump,0x7F0000,0x10000,

Diff for: tools/partitions/large_ffat_8MB.csv

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Name, Type, SubType, Offset, Size, Flags
2+
nvs, data, nvs, 0x9000, 0x5000,
3+
otadata, data, ota, 0xe000, 0x2000,
4+
app0, app, ota_0, 0x10000, 0x140000,
5+
app1, app, ota_1, 0x150000,0x140000,
6+
ffat, data, fat, 0x290000,0x560000,
7+
coredump, data, coredump,0x7F0000,0x10000,

Diff for: tools/partitions/large_spiffs_8MB.csv

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
# Name, Type, SubType, Offset, Size, Flags
2+
nvs, data, nvs, 0x9000, 0x5000,
3+
otadata, data, ota, 0xe000, 0x2000,
4+
app0, app, ota_0, 0x10000, 0x140000,
5+
app1, app, ota_1, 0x150000,0x140000,
6+
spiffs, data, spiffs, 0x290000,0x560000,
7+
coredump, data, coredump,0x7F0000,0x10000,

Diff for: variants/esp32s3_powerfeather/pins_arduino.h

+4-2
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@
99
#define USB_PRODUCT "ESP32-S3 PowerFeather"
1010
#define USB_SERIAL ""
1111

12-
static const uint8_t ALARM = 7;
12+
static const uint8_t ALARM = 21;
1313
static const uint8_t INT = 5;
1414

1515
static const uint8_t LED = 46;
1616
static const uint8_t BTN = 0;
17-
static const uint8_t EN = 13;
17+
static const uint8_t EN = 7;
1818

1919
static const uint8_t TX = 44;
2020
static const uint8_t RX = 42;
@@ -37,6 +37,8 @@ static const uint8_t A5 = 1;
3737

3838
static const uint8_t D5 = 15;
3939
static const uint8_t D6 = 16;
40+
static const uint8_t D7 = 37;
41+
static const uint8_t D8 = 6;
4042
static const uint8_t D9 = 17;
4143
static const uint8_t D10 = 18;
4244
static const uint8_t D11 = 45;

0 commit comments

Comments
 (0)