mirror of
https://github.com/0xFEEDC0DE64/arduino-esp32.git
synced 2025-07-29 10:17:15 +02:00
DOCUMENTATION: Moved installation instructions to separate page (#561)
* DOCUMENTATION: Moved installation instructions to separate page * Added Fedora to contents table * Added Issue/Bug Report section to README * Some minor improvements * DOCUMENTATION: Rename directory doc to docs * Also move ISSUE_TEMPLATE.md to docs directory * DOCUMENTATION: Use current repo's files * This makes it consistent instead of having few local and few pointing to espressif/arduino-esp32 by all linking to local files * DOCUMENTATION: Fix hyperlink to issue/bug template in contents * DOCUMENTATION: contents: supress platform specific installation instruction
This commit is contained in:
committed by
Me No Dev
parent
3a8e28dc87
commit
e6ba0f6281
55
docs/esp-idf_component.md
Normal file
55
docs/esp-idf_component.md
Normal file
@ -0,0 +1,55 @@
|
||||
To use as a component of ESP-IDF
|
||||
=================================================
|
||||
|
||||
- Download and install [esp-idf](https://github.com/espressif/esp-idf)
|
||||
- Create blank idf project (from one of the examples)
|
||||
- in the project folder, create a folder called components and clone this repository inside
|
||||
|
||||
```bash
|
||||
mkdir -p components && \
|
||||
cd components && \
|
||||
git clone https://github.com/espressif/arduino-esp32.git arduino && \
|
||||
cd .. && \
|
||||
make menuconfig
|
||||
```
|
||||
- ```make menuconfig``` has some Arduino options
|
||||
- "Autostart Arduino setup and loop on boot"
|
||||
- If you enable this options, your main.cpp should be formated like any other sketch
|
||||
|
||||
```arduino
|
||||
//file: main.cpp
|
||||
#include "Arduino.h"
|
||||
|
||||
void setup(){
|
||||
Serial.begin(115200);
|
||||
}
|
||||
|
||||
void loop(){
|
||||
Serial.println("loop");
|
||||
delay(1000);
|
||||
}
|
||||
```
|
||||
|
||||
- Else you need to implement ```app_main()``` and call ```initArduino();``` in it.
|
||||
|
||||
Keep in mind that setup() and loop() will not be called in this case.
|
||||
If you plan to base your code on examples provided in [esp-idf](https://github.com/espressif/esp-idf/tree/master/examples), please make sure move the app_main() function in main.cpp from the files in the example.
|
||||
|
||||
```arduino
|
||||
//file: main.cpp
|
||||
#include "Arduino.h"
|
||||
|
||||
extern "C" void app_main()
|
||||
{
|
||||
initArduino();
|
||||
pinMode(4, OUTPUT);
|
||||
digitalWrite(4, HIGH);
|
||||
//do your own thing
|
||||
}
|
||||
```
|
||||
- "Disable mutex locks for HAL"
|
||||
- If enabled, there will be no protection on the drivers from concurently accessing them from another thread/interrupt/core
|
||||
- "Autoconnect WiFi on boot"
|
||||
- If enabled, WiFi will start with the last known configuration
|
||||
- Else it will wait for WiFi.begin
|
||||
- ```make flash monitor``` will build, upload and open serial monitor to your board
|
Reference in New Issue
Block a user