Skip to content

Commit

Permalink
Merge branch 'master' into patch-2
Browse files Browse the repository at this point in the history
  • Loading branch information
lucasssvaz authored Aug 14, 2024
2 parents fd9953c + 4aab817 commit 02f857c
Show file tree
Hide file tree
Showing 17 changed files with 1,042 additions and 49 deletions.
559 changes: 559 additions & 0 deletions boards.txt

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion cores/esp32/esp32-hal-uart.c
Original file line number Diff line number Diff line change
Expand Up @@ -895,7 +895,8 @@ int log_printfv(const char *format, va_list arg) {
}
#endif
*/
#if CONFIG_IDF_TARGET_ESP32C3 || ((CONFIG_IDF_TARGET_ESP32H2 || CONFIG_IDF_TARGET_ESP32C6) && ARDUINO_USB_CDC_ON_BOOT)
#if (ARDUINO_USB_CDC_ON_BOOT == 1 && ARDUINO_USB_MODE == 0) || CONFIG_IDF_TARGET_ESP32C3 \
|| ((CONFIG_IDF_TARGET_ESP32H2 || CONFIG_IDF_TARGET_ESP32C6) && ARDUINO_USB_CDC_ON_BOOT == 1)
vsnprintf(temp, len + 1, format, arg);
ets_printf("%s", temp);
#else
Expand Down
4 changes: 2 additions & 2 deletions docs/en/api/adc.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ADC OneShot mode


The ADC OneShot mode API is fully compatible with Arduino's ``analogRead`` function.
When you call the ``analogRead`` or ``analogReadMillivolts`` function, it returns the result of a single conversion on the requested pin.
When you call the ``analogRead`` or ``analogReadMilliVolts`` function, it returns the result of a single conversion on the requested pin.

analogRead
^^^^^^^^^^
Expand All @@ -36,7 +36,7 @@ This function is used to get the ADC raw value for a given pin/ADC channel.

This function will return analog raw value (non-calibrated).

analogReadMillivolts
analogReadMilliVolts
^^^^^^^^^^^^^^^^^^^^

This function is used to get ADC raw value for a given pin/ADC channel and convert it to calibrated result in millivolts.
Expand Down
12 changes: 7 additions & 5 deletions docs/en/api/preferences.rst
Original file line number Diff line number Diff line change
Expand Up @@ -62,12 +62,12 @@ Preferences directly supports the following data types:
+-------------------+-------------------+---------------+
| ULong | uint32_t | 4 |
+-------------------+-------------------+---------------+
| Float | float_t | 4 |
+-------------------+-------------------+---------------+
| Long64 | int64_t | 8 |
+-------------------+-------------------+---------------+
| ULong64 | uint64_t | 8 |
+-------------------+-------------------+---------------+
| Float | float_t | 8 |
+-------------------+-------------------+---------------+
| Double | double_t | 8 |
+-------------------+-------------------+---------------+
| | const char* | variable |
Expand Down Expand Up @@ -258,6 +258,8 @@ Arduino-esp32 Preferences API
``putInt, putUInt``
********************
``putLong, putULong``
**********************
``putFloat``
**********************

Store a value against a given key in the currently open namespace.
Expand All @@ -268,6 +270,7 @@ Arduino-esp32 Preferences API
size_t putUInt(const char* key, uint32_t value)
size_t putLong(const char* key, int32_t value)
size_t putULong(const char* key, uint32_t value)
size_t putFloat(const char* key, float_t value)
..
Expand All @@ -288,16 +291,15 @@ Arduino-esp32 Preferences API

``putLong64, putULong64``
*************************
``putFloat, putDouble``
***********************
``putDouble``
*************************

Store a value against a given key in the currently open namespace.

.. code-block:: arduino
size_t putLong64(const char* key, int64_t value)
size_t putULong64(const char* key, uint64_t value)
size_t putFloat(const char* key, float_t value)
size_t putDouble(const char* key, double_t value)
..
Expand Down
12 changes: 6 additions & 6 deletions docs/en/tutorials/preferences.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,16 @@ Preferences directly supports the following data types:
+-------------------+-------------------+---------------+
| ULong | uint32_t | 4 |
+-------------------+-------------------+---------------+
| Float | float_t | 4 |
+-------------------+-------------------+---------------+
| Long64 | int64_t | 8 |
+-------------------+-------------------+---------------+
| ULong64 | uint64_t | 8 |
+-------------------+-------------------+---------------+
| Float | float_t | 8 |
+-------------------+-------------------+---------------+
| Double | double_t | 8 |
+-------------------+-------------------+---------------+
| | const char* | |
| String +-------------------+ variable |
| | const char* | variable |
| String +-------------------+ |
| | String | |
+-------------------+-------------------+---------------+
| Bytes | uint8_t | variable |
Expand Down Expand Up @@ -233,9 +233,9 @@ Like so:

.. code-block:: arduino
float myFloat = myPreferences.getFloat("pi");
float_t myFloat = myPreferences.getFloat("pi");
This will retrieve the float value from the namespace key ``"pi"`` and assign it to the float type variable ``myFloat``.
This will retrieve the float_t value from the namespace key ``"pi"`` and assign it to the float_t type variable ``myFloat``.


Summary
Expand Down
12 changes: 12 additions & 0 deletions libraries/RainMaker/src/RMaker.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <esp_rmaker_schedule.h>
#include <esp_rmaker_utils.h>
#include <esp_rmaker_scenes.h>
#include <esp_rmaker_common_events.h>
bool wifiLowLevelInit(bool persistent);
static esp_err_t err;

Expand All @@ -20,6 +21,16 @@ static void event_handler(void *arg, esp_event_base_t event_base, int32_t event_
case RMAKER_EVENT_CLAIM_FAILED: log_i("RainMaker Claim Failed."); break;
default: log_i("Unhandled RainMaker Event:");
}
} else if (event_base == RMAKER_COMMON_EVENT) {
switch (event_id) {
case RMAKER_EVENT_REBOOT: log_i("Rebooting in %d seconds.", *((uint8_t *)event_data)); break;
case RMAKER_EVENT_WIFI_RESET: log_i("Wi-Fi credentials reset."); break;
case RMAKER_EVENT_FACTORY_RESET: log_i("Node reset to factory defaults."); break;
case RMAKER_MQTT_EVENT_CONNECTED: log_i("MQTT Connected."); break;
case RMAKER_MQTT_EVENT_DISCONNECTED: log_i("MQTT Disconnected."); break;
case RMAKER_MQTT_EVENT_PUBLISHED: log_i("MQTT Published. Msg id: %d.", *((int *)event_data)); break;
default: log_w("Unhandled RainMaker Common Event: %" PRIi32, event_id);
}
} else if (event_base == RMAKER_OTA_EVENT) {
if (event_data == NULL) {
event_data = (void *)"";
Expand All @@ -46,6 +57,7 @@ Node RMakerClass::initNode(const char *name, const char *type) {
esp_rmaker_node_t *rnode = NULL;
esp_event_handler_register(RMAKER_EVENT, ESP_EVENT_ANY_ID, &event_handler, NULL);
esp_event_handler_register(RMAKER_OTA_EVENT, ESP_EVENT_ANY_ID, &event_handler, NULL);
esp_event_handler_register(RMAKER_COMMON_EVENT, ESP_EVENT_ANY_ID, &event_handler, NULL);
rnode = esp_rmaker_node_init(&rainmaker_cfg, name, type);
if (!rnode) {
log_e("Node init failed");
Expand Down
6 changes: 4 additions & 2 deletions libraries/SD/src/sd_diskio.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -671,8 +671,10 @@ uint8_t sdcard_uninit(uint8_t pdrv) {
if (pdrv >= FF_VOLUMES || card == NULL) {
return 1;
}
AcquireSPI lock(card);
sdTransaction(pdrv, GO_IDLE_STATE, 0, NULL);
{
AcquireSPI lock(card);
sdTransaction(pdrv, GO_IDLE_STATE, 0, NULL);
} // lock is destructed here
ff_diskio_register(pdrv, NULL);
s_cards[pdrv] = NULL;
esp_err_t err = ESP_OK;
Expand Down
27 changes: 20 additions & 7 deletions libraries/WebServer/examples/WebServer/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ This example shows different techniques on how to use and extend the WebServer f

It is a small project in it's own and has some files to use on the web server to show how to use simple REST based services.

This example requires some space for a filesystem and runs fine boards with 4 MByte flash using the following options:
This example requires some space for a filesystem and runs fine on supported SoCs with 4 MByte or more flash by selecting the proper partition table:

* For using SPIFFS(LittleFS): Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS)
* For using FATFS: Default 4MB with ffat (1.2MB APP/1.5MB FATFS)

* Board: ESP32 Dev Module
* Partition Scheme: Default 4MB with spiffs (1.2MB APP/1.5MB SPIFFS)
but LittleFS will be used in the partition (not SPIFFS)

It features

Expand All @@ -28,9 +28,9 @@ It features

Currently, this example supports the following targets.

| Supported Targets | ESP32 | ESP32-S2 | ESP32-C3 |
| ----------------- | ----- | -------- | -------- |
| | yes | yes | yes |
| Supported Targets | ESP32 | ESP32-S2 | ESP32-S3 | ESP32-C3 | ESP32-C6 |
| ----------------- | ----- | -------- | -------- | -------- | -------- |
| | yes | yes | yes | yes | yes |

## Use the Example

Expand Down Expand Up @@ -200,6 +200,7 @@ This class has to implements several functions and works in a more detailed way:
* The `canUpload()`and `upload()` methods work similar while the `upload()` method is called multiple times to create, append data and close the new file.
## File upload
By opening <http://webserver/$upload.htm> you can easily upload files by dragging them over the drop area.
Expand Down Expand Up @@ -238,6 +239,7 @@ You can see on the Serial output that one filesystem write error is reported.
Please be patient and wait for the upload ending even when writing to the filesystem is disabled
it maybe take more than a minute.
## Registering a special handler for "file not found"
Any other incoming request that was not handled by the registered plug-ins above can be detected by registering
Expand All @@ -253,6 +255,7 @@ Any other incoming request that was not handled by the registered plug-ins above
This allows sending back an "friendly" result for the browser. Here a simple html page is created from a static string.
You can easily change the html code in the file `builtinfiles.h`.
## customizations
You may like to change the hostname and the timezone in the lines:
Expand All @@ -262,10 +265,18 @@ You may like to change the hostname and the timezone in the lines:
> #define TIMEZONE "CET-1CEST,M3.5.0,M10.5.0/3"
> ```
## Troubleshooting
Have a look in the Serial output for some additional runtime information.
## Changes
* 2024-08-02 -- Fixing for board implementation 3.0.4 ff.
* 2024-08-02 -- Support for FAT
## Contribute
To know how to contribute to this project, see [How to contribute.](https://github.com/espressif/arduino-esp32/blob/master/CONTRIBUTING.rst)
Expand All @@ -274,11 +285,13 @@ If you have any **feedback** or **issue** to report on this example/library, ple
Before creating a new issue, be sure to try Troubleshooting and check if the same issue was already created by someone else.
## Resources
* Official ESP32 Forum: [Link](https://esp32.com)
* Arduino-ESP32 Official Repository: [espressif/arduino-esp32](https://github.com/espressif/arduino-esp32)
* ESP32 Datasheet: [Link to datasheet](https://www.espressif.com/sites/default/files/documentation/esp32_datasheet_en.pdf)
* ESP32-S2 Datasheet: [Link to datasheet](https://www.espressif.com/sites/default/files/documentation/esp32-s2_datasheet_en.pdf)
* ESP32-S3 Datasheet: [Link to datasheet](https://www.espressif.com/sites/default/files/documentation/esp32-s3_datasheet_en.pdf)
* ESP32-C3 Datasheet: [Link to datasheet](https://www.espressif.com/sites/default/files/documentation/esp32-c3_datasheet_en.pdf)
* Official ESP-IDF documentation: [ESP-IDF](https://idf.espressif.com)
Loading

0 comments on commit 02f857c

Please sign in to comment.