Skip to content

Commit 107ca03

Browse files
authored
Revert "RMT refactor"
1 parent c2c02cf commit 107ca03

File tree

89 files changed

+954
-570
lines changed

Some content is hidden

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

89 files changed

+954
-570
lines changed

cores/esp32/esp32-hal-rmt.c

Lines changed: 754 additions & 306 deletions
Large diffs are not rendered by default.

cores/esp32/esp32-hal-rmt.h

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,6 @@ extern "C" {
2525
#define RMT_FLAG_ERROR (4)
2626
#define RMT_FLAGS_ALL (RMT_FLAG_TX_DONE | RMT_FLAG_RX_DONE | RMT_FLAG_ERROR)
2727

28-
#define RMT_TX_MODE true
29-
#define RMT_RX_MODE false
30-
3128
struct rmt_obj_s;
3229

3330
typedef enum {
@@ -57,13 +54,6 @@ typedef struct {
5754
};
5855
} rmt_data_t;
5956

60-
61-
/**
62-
* Prints object information
63-
*
64-
*/
65-
void _rmtDumpStatus(rmt_obj_t* rmt);
66-
6757
/**
6858
* Initialize the object
6959
*
@@ -79,17 +69,10 @@ float rmtSetTick(rmt_obj_t* rmt, float tick);
7969
/**
8070
* Sending data in one-go mode or continual mode
8171
* (more data being send while updating buffers in interrupts)
82-
* Non-Blocking mode - returns right after executing
72+
*
8373
*/
8474
bool rmtWrite(rmt_obj_t* rmt, rmt_data_t* data, size_t size);
8575

86-
/**
87-
* Sending data in one-go mode or continual mode
88-
* (more data being send while updating buffers in interrupts)
89-
* Blocking mode - only returns when data has been sent
90-
*/
91-
bool rmtWriteBlocking(rmt_obj_t* rmt, rmt_data_t* data, size_t size);
92-
9376
/**
9477
* Loop data up to the reserved memsize continuously
9578
*

libraries/ESP32/examples/RMT/RMTCallback/RMTCallback.ino

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class MyProcessor {
1212

1313
public:
1414
MyProcessor(uint8_t pin, float nanoTicks) {
15-
assert((rmt_recv = rmtInit(21, RMT_RX_MODE, RMT_MEM_192)));
15+
assert((rmt_recv = rmtInit(21, false, RMT_MEM_192)));
1616

1717
realNanoTick = rmtSetTick(rmt_recv, nanoTicks);
1818
};
@@ -61,4 +61,4 @@ void loop()
6161
{
6262
Serial.printf("GPIO 4: %08x 5: %08x 6: %08x\n", mp1.val(), mp2.val(), mp3.val());
6363
delay(500);
64-
}
64+
}

libraries/ESP32/examples/RMT/RMTLoopback/RMTLoopback.ino

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,6 @@
55

66
#include "esp32-hal.h"
77

8-
#if CONFIG_IDF_TARGET_ESP32C3
9-
// ESP32 C3 has only 2 channels for RX and 2 for TX, thus MAX RMT_MEM is 128
10-
#define RMT_TX_PIN 4
11-
#define RMT_RX_PIN 5
12-
#define RMT_MEM_RX RMT_MEM_128
13-
#else
14-
#define RMT_TX_PIN 18
15-
#define RMT_RX_PIN 21
16-
#define RMT_MEM_RX RMT_MEM_192
17-
#endif
18-
198
rmt_data_t my_data[256];
209
rmt_data_t data[256];
2110

@@ -29,19 +18,18 @@ void setup()
2918
Serial.begin(115200);
3019
events = xEventGroupCreate();
3120

32-
if ((rmt_send = rmtInit(RMT_TX_PIN, RMT_TX_MODE, RMT_MEM_64)) == NULL)
21+
if ((rmt_send = rmtInit(18, true, RMT_MEM_64)) == NULL)
3322
{
3423
Serial.println("init sender failed\n");
3524
}
36-
if ((rmt_recv = rmtInit(RMT_RX_PIN, RMT_RX_MODE, RMT_MEM_RX)) == NULL)
25+
if ((rmt_recv = rmtInit(21, false, RMT_MEM_192)) == NULL)
3726
{
3827
Serial.println("init receiver failed\n");
3928
}
4029

4130
float realTick = rmtSetTick(rmt_send, 100);
4231
printf("real tick set to: %fns\n", realTick);
43-
// both will keep same tick
44-
realTick = rmtSetTick(rmt_recv, 100);
32+
4533
}
4634

4735
void loop()

libraries/ESP32/examples/RMT/RMTReadXJT/RMTReadXJT.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ void setup()
182182
Serial.begin(115200);
183183

184184
// Initialize the channel to capture up to 192 items
185-
if ((rmt_recv = rmtInit(21, RMT_RX_MODE, RMT_MEM_192)) == NULL)
185+
if ((rmt_recv = rmtInit(21, false, RMT_MEM_192)) == NULL)
186186
{
187187
Serial.println("init receiver failed\n");
188188
}

libraries/ESP32/examples/RMT/RMTWriteNeoPixel/RMTWriteNeoPixel.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ void setup()
4141
{
4242
Serial.begin(115200);
4343

44-
if ((rmt_send = rmtInit(18, RMT_TX_MODE, RMT_MEM_64)) == NULL)
44+
if ((rmt_send = rmtInit(18, true, RMT_MEM_64)) == NULL)
4545
{
4646
Serial.println("init sender failed\n");
4747
}

libraries/README.md

Lines changed: 1 addition & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -40,9 +40,6 @@ arduino-esp32 includes libraries for Arduino compatibility along with some objec
4040
### ESPmDNS
4141
mDNS service advertising
4242

43-
### Ethernet
44-
Ethernet networking
45-
4643
### FFat
4744
FAT indexed filesystem on SPI flash
4845

@@ -55,12 +52,6 @@ arduino-esp32 includes libraries for Arduino compatibility along with some objec
5552
### HTTPUpdate
5653
Download a firmware update from HTTPd and apply it using Update
5754

58-
### HTTPUpdateServer
59-
Upload a firmware for the update from HTTPd
60-
61-
### LittleFS
62-
LittleFS (File System)
63-
6455
### NetBIOS
6556
NetBIOS name advertiser
6657

@@ -88,9 +79,6 @@ arduino-esp32 includes libraries for Arduino compatibility along with some objec
8879
### Update
8980
Sketch Update using ESP32 OTA functionality
9081

91-
### USB
92-
Universal Serial Bus driver (device only)
93-
9482
### WebServer
9583
A simple HTTP daemon
9684

@@ -101,4 +89,4 @@ arduino-esp32 includes libraries for Arduino compatibility along with some objec
10189
Arduino compatible WiFi client object using embedded encryption
10290

10391
### Wire
104-
Arduino compatible I2C driver
92+
Arduino compatible I2C driver (master only)

platform.txt

Lines changed: 3 additions & 3 deletions
Large diffs are not rendered by default.

tools/platformio-build-esp32.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@
303303
"UNITY_INCLUDE_CONFIG_H",
304304
"WITH_POSIX",
305305
"_GNU_SOURCE",
306-
("IDF_VER", '\\"v4.4-beta1-189-ga79dc75f0a\\"'),
306+
("IDF_VER", '\\"v4.4-beta1-183-gf23dcd3555\\"'),
307307
"ESP_PLATFORM",
308308
"_POSIX_READER_WRITER_LOCKS",
309309
"ARDUINO_ARCH_ESP32",

tools/platformio-build-esp32c3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@
293293
"UNITY_INCLUDE_CONFIG_H",
294294
"WITH_POSIX",
295295
"_GNU_SOURCE",
296-
("IDF_VER", '\\"v4.4-beta1-189-ga79dc75f0a\\"'),
296+
("IDF_VER", '\\"v4.4-beta1-183-gf23dcd3555\\"'),
297297
"ESP_PLATFORM",
298298
"_POSIX_READER_WRITER_LOCKS",
299299
"ARDUINO_ARCH_ESP32",

tools/platformio-build-esp32s2.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -290,7 +290,7 @@
290290
"UNITY_INCLUDE_CONFIG_H",
291291
"WITH_POSIX",
292292
"_GNU_SOURCE",
293-
("IDF_VER", '\\"v4.4-beta1-189-ga79dc75f0a\\"'),
293+
("IDF_VER", '\\"v4.4-beta1-183-gf23dcd3555\\"'),
294294
"ESP_PLATFORM",
295295
"_POSIX_READER_WRITER_LOCKS",
296296
"ARDUINO_ARCH_ESP32",

tools/sdk/esp32/include/config/sdkconfig.h

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -406,9 +406,7 @@
406406
#define CONFIG_LWIP_IPV6_ND6_NUM_NEIGHBORS 5
407407
#define CONFIG_LWIP_ICMP 1
408408
#define CONFIG_LWIP_MAX_RAW_PCBS 16
409-
#define CONFIG_LWIP_SNTP_MAX_SERVERS 3
410-
#define CONFIG_LWIP_DHCP_GET_NTP_SRV 1
411-
#define CONFIG_LWIP_DHCP_MAX_NTP_SERVERS 1
409+
#define CONFIG_LWIP_SNTP_MAX_SERVERS 1
412410
#define CONFIG_LWIP_SNTP_UPDATE_DELAY 3600000
413411
#define CONFIG_LWIP_ESP_LWIP_ASSERT 1
414412
#define CONFIG_LWIP_HOOK_TCP_ISN_DEFAULT 1
@@ -679,5 +677,5 @@
679677
#define CONFIG_ULP_COPROC_RESERVE_MEM CONFIG_ESP32_ULP_COPROC_RESERVE_MEM
680678
#define CONFIG_WARN_WRITE_STRINGS CONFIG_COMPILER_WARN_WRITE_STRINGS
681679
#define CONFIG_WIFI_LWIP_ALLOCATION_FROM_SPIRAM_FIRST CONFIG_SPIRAM_TRY_ALLOCATE_WIFI_LWIP
682-
#define CONFIG_ARDUINO_IDF_COMMIT "a79dc75f0a"
680+
#define CONFIG_ARDUINO_IDF_COMMIT "f23dcd3555"
683681
#define CONFIG_ARDUINO_IDF_BRANCH "release/v4.4"

tools/sdk/esp32/include/esp-face/include/layer/dl_layer_expand_dims.hpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,18 +66,19 @@ namespace dl
6666
this->output_exponent = input.exponent;
6767
if (!this->inplace)
6868
{
69-
if (this->output == NULL)
69+
if (this->output != NULL)
7070
{
7171
this->output = new Tensor<feature_t>;
7272
}
7373
this->output->set_exponent(this->output_exponent);
74-
this->output->set_shape(input.shape);
74+
this->output->set_shape(this->output_shape);
7575
this->output->expand_dims(this->axis);
7676
this->output->free_element();
7777
}
7878
else
7979
{
8080
this->output = &input;
81+
this->output->set_shape(this->output_shape);
8182
this->output->expand_dims(this->axis);
8283
}
8384
this->output_shape = this->output->shape;

tools/sdk/esp32/include/esp-face/include/layer/dl_layer_flatten.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ namespace dl
5959
this->output_shape = {input.get_size()};
6060
if (!this->inplace)
6161
{
62-
if (this->output == NULL)
62+
if (this->output != NULL)
6363
{
6464
this->output = new Tensor<feature_t>;
6565
}

tools/sdk/esp32/include/esp-face/include/layer/dl_layer_leakyrelu.hpp

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ namespace dl
1010
namespace layer
1111
{
1212
/**
13-
* @brief LeakyRelu(input).
13+
* @brief LeakyReLU(input).
1414
*
1515
* @tparam feature_t supports int16_t and int8_t,
1616
* - int16_t: stands for operation in int16_t quantize
1717
* - int8_t: stands for operation in int8_t quantize
1818
*/
1919
template <typename feature_t>
20-
class LeakyRelu : public Layer
20+
class LeakyReLU : public Layer
2121
{
2222
private:
2323
feature_t activation_alpha; /*<! quantized alpha >*/
@@ -28,26 +28,26 @@ namespace dl
2828
std::vector<int> output_shape; /*<! output shape of leakyrelu >*/
2929
public:
3030
/**
31-
* @brief Construct a new LeakyRelu object
31+
* @brief Construct a new LeakyReLU object
3232
*
3333
* @param activation_alpha quantized alpha
3434
* @param activation_exponent exponent of quantized alpha
3535
* @param name name of leakyrelu
3636
* @param inplace true: the output will store to input0
3737
* false: the output will store to a separate memory
3838
*/
39-
LeakyRelu(const int activation_alpha, const int activation_exponent, const char *name = "LeakyRelu", bool inplace = false) : Layer(name), output(NULL), output_shape({})
39+
LeakyReLU(const int activation_alpha, const int activation_exponent, const char *name = "LeakyReLU", bool inplace = false) : Layer(name), output(NULL), output_shape({})
4040
{
4141
this->activation_alpha = activation_alpha;
4242
this->activation_exponent = activation_exponent;
4343
this->inplace = inplace;
4444
}
4545

4646
/**
47-
* @brief Destroy the LeakyRelu object
47+
* @brief Destroy the LeakyReLU object
4848
*
4949
*/
50-
~LeakyRelu()
50+
~LeakyReLU()
5151
{
5252
if ((!this->inplace) && (this->output != NULL))
5353
{
@@ -66,7 +66,7 @@ namespace dl
6666
this->output_shape = input.shape;
6767
if (!this->inplace)
6868
{
69-
if (this->output == NULL)
69+
if (this->output != NULL)
7070
{
7171
this->output = new Tensor<feature_t>;
7272
}
@@ -90,19 +90,19 @@ namespace dl
9090
/**
9191
* @brief Get the output
9292
*
93-
* @return Tensor<feature_t>& LeakyRelu result
93+
* @return Tensor<feature_t>& LeakyReLU result
9494
*/
9595
Tensor<feature_t> &get_output()
9696
{
9797
return *this->output;
9898
}
9999

100100
/**
101-
* @brief Call LeakyRelu operation.
101+
* @brief Call LeakyReLU operation.
102102
*
103103
* @param input as an input
104104
* @param assign_core not effective yet
105-
* @return LeakyRelu result
105+
* @return LeakyReLU result
106106
*/
107107
Tensor<feature_t> &call(Tensor<feature_t> &input, const std::vector<int> &assign_core = CONFIG_DEFAULT_ASSIGN_CORE)
108108
{
@@ -130,7 +130,7 @@ namespace dl
130130
{
131131
this->output->set_shape(this->output_shape);
132132
}
133-
nn::leakyrelu(*this->output, input, this->activation_alpha, this->activation_exponent, assign_core);
133+
nn::leakyrelu<true>(*this->output, input, this->activation_alpha, this->activation_exponent, assign_core);
134134
DL_LOG_LAYER_LATENCY_END(this->name, "leakyrelu");
135135
}
136136

tools/sdk/esp32/include/esp-face/include/layer/dl_layer_max2d.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ namespace dl
6868

6969
if (!this->inplace)
7070
{
71-
if (this->output == NULL)
71+
if (this->output != NULL)
7272
{
7373
this->output = new Tensor<feature_t>;
7474
}
@@ -132,7 +132,7 @@ namespace dl
132132
{
133133
this->output->set_shape(this->output_shape);
134134
}
135-
nn::max2d(*this->output, input0, input1, assign_core);
135+
nn::max2d<true>(*this->output, input0, input1, assign_core);
136136
DL_LOG_LAYER_LATENCY_END(this->name, "max2d");
137137
}
138138

tools/sdk/esp32/include/esp-face/include/layer/dl_layer_min2d.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ namespace dl
6868

6969
if (!this->inplace)
7070
{
71-
if (this->output == NULL)
71+
if (this->output != NULL)
7272
{
7373
this->output = new Tensor<feature_t>;
7474
}
@@ -132,7 +132,7 @@ namespace dl
132132
{
133133
this->output->set_shape(this->output_shape);
134134
}
135-
nn::min2d(*this->output, input0, input1, assign_core);
135+
nn::min2d<true>(*this->output, input0, input1, assign_core);
136136
DL_LOG_LAYER_LATENCY_END(this->name, "min2d");
137137
}
138138

tools/sdk/esp32/include/esp-face/include/layer/dl_layer_mul2d.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ namespace dl
7575

7676
if (!this->inplace)
7777
{
78-
if (this->output == NULL)
78+
if (this->output != NULL)
7979
{
8080
this->output = new Tensor<feature_t>;
8181
}
@@ -140,7 +140,7 @@ namespace dl
140140
{
141141
this->output->set_shape(this->output_shape);
142142
}
143-
nn::mul2d(*this->output, input0, input1, this->activation, assign_core);
143+
nn::mul2d<true>(*this->output, input0, input1, this->activation, assign_core);
144144
DL_LOG_LAYER_LATENCY_END(this->name, "mul2d");
145145
}
146146

0 commit comments

Comments
 (0)