Skip to content

Commit da95c34

Browse files
authored
Merge branch 'master' into patch-6
2 parents dc10013 + 855f526 commit da95c34

File tree

9 files changed

+1476
-1159
lines changed

9 files changed

+1476
-1159
lines changed

Diff for: boards.txt

+1,344-1,144
Large diffs are not rendered by default.

Diff for: cores/esp32/HWCDC.cpp

+8-11
Original file line numberDiff line numberDiff line change
@@ -218,10 +218,10 @@ void HWCDC::setTxTimeoutMs(uint32_t timeout){
218218

219219
size_t HWCDC::setTxBufferSize(size_t tx_queue_len){
220220
if(tx_ring_buf){
221-
if(!tx_queue_len){
222-
vRingbufferDelete(tx_ring_buf);
223-
tx_ring_buf = NULL;
224-
}
221+
vRingbufferDelete(tx_ring_buf);
222+
tx_ring_buf = NULL;
223+
}
224+
if(!tx_queue_len){
225225
return 0;
226226
}
227227
tx_ring_buf = xRingbufferCreate(tx_queue_len, RINGBUF_TYPE_BYTEBUF);
@@ -319,19 +319,16 @@ void HWCDC::flush(void)
319319

320320
size_t HWCDC::setRxBufferSize(size_t rx_queue_len){
321321
if(rx_queue){
322-
if(!rx_queue_len){
323-
vQueueDelete(rx_queue);
324-
rx_queue = NULL;
325-
}
322+
vQueueDelete(rx_queue);
323+
rx_queue = NULL;
324+
}
325+
if(!rx_queue_len){
326326
return 0;
327327
}
328328
rx_queue = xQueueCreate(rx_queue_len, sizeof(uint8_t));
329329
if(!rx_queue){
330330
return 0;
331331
}
332-
if(!tx_ring_buf){
333-
tx_ring_buf = xRingbufferCreate(rx_queue_len, RINGBUF_TYPE_BYTEBUF);
334-
}
335332
return rx_queue_len;
336333
}
337334

Diff for: libraries/WebServer/src/WebServer.cpp

+3-4
Original file line numberDiff line numberDiff line change
@@ -285,17 +285,16 @@ void WebServer::serveStatic(const char* uri, FS& fs, const char* path, const cha
285285

286286
void WebServer::handleClient() {
287287
if (_currentStatus == HC_NONE) {
288-
WiFiClient client = _server.available();
289-
if (!client) {
288+
_currentClient = _server.available();
289+
if (!_currentClient) {
290290
if (_nullDelay) {
291291
delay(1);
292292
}
293293
return;
294294
}
295295

296-
log_v("New client: client.localIP()=%s", client.localIP().toString().c_str());
296+
log_v("New client: client.localIP()=%s", _currentClient.localIP().toString().c_str());
297297

298-
_currentClient = client;
299298
_currentStatus = HC_WAIT_READ;
300299
_statusChange = millis();
301300
}
21.7 KB
Binary file not shown.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# ESP-IDF Partition Table
2+
# Name, Type, SubType, Offset, Size, Flags
3+
# bootloader.bin,, 0x1000, 32K
4+
# partition table, 0x8000, 4K
5+
6+
nvs, data, nvs, 0x9000, 20K,
7+
otadata, data, ota, 0xe000, 8K,
8+
ota_0, app, ota_0, 0x10000, 1408K,
9+
ota_1, app, ota_1, 0x170000, 1408K,
10+
uf2, app, factory,0x2d0000, 256K,
11+
ffat, data, fat, 0x310000, 960K,

Diff for: variants/adafruit_qtpy_esp32s3_n4r2/pins_arduino.h

+64
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
#ifndef Pins_Arduino_h
2+
#define Pins_Arduino_h
3+
4+
#include <stdint.h>
5+
#include "soc/soc_caps.h"
6+
7+
#define USB_VID 0x239A
8+
#define USB_PID 0x8143
9+
#define USB_MANUFACTURER "Adafruit"
10+
#define USB_PRODUCT "QT Py ESP32-S3 (4MB Flash 2MB PSRAM)"
11+
#define USB_SERIAL "" // Empty string for MAC adddress
12+
13+
#define EXTERNAL_NUM_INTERRUPTS 46
14+
#define NUM_DIGITAL_PINS 48
15+
#define NUM_ANALOG_INPUTS 20
16+
17+
#define analogInputToDigitalPin(p) (((p)<20)?(analogChannelToDigitalPin(p)):-1)
18+
#define digitalPinToInterrupt(p) (((p)<48)?(p):-1)
19+
#define digitalPinHasPWM(p) (p < 46)
20+
21+
#define PIN_NEOPIXEL 39
22+
#define NEOPIXEL_NUM 1 // number of neopixels
23+
#define NEOPIXEL_POWER 38 // power pin
24+
#define NEOPIXEL_POWER_ON HIGH // power pin state when on
25+
26+
static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+PIN_NEOPIXEL;
27+
#define BUILTIN_LED LED_BUILTIN // backward compatibility
28+
#define LED_BUILTIN LED_BUILTIN
29+
#define RGB_BUILTIN LED_BUILTIN
30+
#define RGB_BRIGHTNESS 64
31+
32+
static const uint8_t TX = 5;
33+
static const uint8_t RX = 16;
34+
#define TX1 TX
35+
#define RX1 RX
36+
37+
static const uint8_t SDA = 7;
38+
static const uint8_t SCL = 6;
39+
40+
#define WIRE1_PIN_DEFINED 1 // See Wire.cpp at bool TwoWire::initPins(int sdaPin, int sclPin)
41+
static const uint8_t SDA1 = 41;
42+
static const uint8_t SCL1 = 40;
43+
44+
static const uint8_t SS = 42;
45+
static const uint8_t MOSI = 35;
46+
static const uint8_t SCK = 36;
47+
static const uint8_t MISO = 37;
48+
49+
static const uint8_t A0 = 18;
50+
static const uint8_t A1 = 17;
51+
static const uint8_t A2 = 9;
52+
static const uint8_t A3 = 8;
53+
static const uint8_t A4 = 7;
54+
static const uint8_t A5 = 6;
55+
static const uint8_t A6 = 5;
56+
static const uint8_t A7 = 16;
57+
58+
static const uint8_t T5 = 5;
59+
static const uint8_t T6 = 6;
60+
static const uint8_t T7 = 7;
61+
static const uint8_t T8 = 8;
62+
static const uint8_t T9 = 9;
63+
64+
#endif /* Pins_Arduino_h */

Diff for: variants/adafruit_qtpy_esp32s3_n4r2/tinyuf2.bin

170 KB
Binary file not shown.

Diff for: variants/adafruit_qtpy_esp32s3_n4r2/variant.cpp

+39
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
/*
2+
* The MIT License (MIT)
3+
*
4+
* Copyright (c) 2021 Ha Thach (tinyusb.org) for Adafruit Industries
5+
*
6+
* Permission is hereby granted, free of charge, to any person obtaining a copy
7+
* of this software and associated documentation files (the "Software"), to deal
8+
* in the Software without restriction, including without limitation the rights
9+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
10+
* copies of the Software, and to permit persons to whom the Software is
11+
* furnished to do so, subject to the following conditions:
12+
*
13+
* The above copyright notice and this permission notice shall be included in
14+
* all copies or substantial portions of the Software.
15+
*
16+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22+
* THE SOFTWARE.
23+
*/
24+
25+
26+
#include "esp32-hal-gpio.h"
27+
#include "pins_arduino.h"
28+
29+
extern "C" {
30+
31+
// Initialize variant/board, called before setup()
32+
void initVariant(void)
33+
{
34+
// This board has a power control pin, and we must set it to output and high
35+
// in order to enable the NeoPixels.
36+
pinMode(NEOPIXEL_POWER, OUTPUT);
37+
digitalWrite(NEOPIXEL_POWER, HIGH);
38+
}
39+
}

Diff for: variants/adafruit_qtpy_esp32s3_nopsram/pins_arduino.h

+7
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
#define Pins_Arduino_h
33

44
#include <stdint.h>
5+
#include "soc/soc_caps.h"
56

67
#define USB_VID 0x239A
78
#define USB_PID 0x8119
@@ -22,6 +23,12 @@
2223
#define NEOPIXEL_POWER 38 // power pin
2324
#define NEOPIXEL_POWER_ON HIGH // power pin state when on
2425

26+
static const uint8_t LED_BUILTIN = SOC_GPIO_PIN_COUNT+PIN_NEOPIXEL;
27+
#define BUILTIN_LED LED_BUILTIN // backward compatibility
28+
#define LED_BUILTIN LED_BUILTIN
29+
#define RGB_BUILTIN LED_BUILTIN
30+
#define RGB_BRIGHTNESS 64
31+
2532
static const uint8_t TX = 5;
2633
static const uint8_t RX = 16;
2734
#define TX1 TX

0 commit comments

Comments
 (0)