Skip to content

Commit 7ae7b0e

Browse files
Merge branch 'auto-update'
2 parents 7f52e6c + 4e06d27 commit 7ae7b0e

Some content is hidden

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

57 files changed

+6897
-6123
lines changed

README.md

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,18 +9,6 @@
99
* Use the C API as described [here](http://libmapper.github.io/tutorials/c.html)
1010

1111
## Issues
12-
### Stack overflow in loopTask
13-
* https://github.com/mathiasbredholt/libmapper-arduino/issues/2
14-
* The stack size of the main loopTask in arduino-esp32 is 8192 bytes . It should be increased, but this can only be done locally at the moment.
15-
* It can be changed in `hardware/esp32/1.0.4/cores/esp32/main.cpp`. The following works for me:
16-
```
17-
extern "C" void app_main()
18-
{
19-
loopTaskWDTEnabled = false;
20-
initArduino();
21-
xTaskCreateUniversal(loopTask, "loopTask", 16384, NULL, 1, &loopTaskHandle, CONFIG_ARDUINO_RUNNING_CORE);
22-
}
23-
```
2412
### fatal error: ../../../lwip/src/include/lwip/inet.h: No such file or directory
2513
- https://github.com/mathiasbredholt/libmapper-arduino/issues/3
2614
- The file {Arduino hardware path}/esp32/1.0.6/tools/sdk/include/lwip/arpa/inet.h should be changed from
@@ -42,17 +30,5 @@ to
4230
#endif /* INET_H_ */
4331
```
4432
- This issue is fixed in newer versions of esp-idf and is fixed in arduino-esp32 v2.0.
45-
## Compile from source (does not work right now)
46-
* Clone repository
47-
```
48-
git clone --recursive https://github.com/mathiasbredholt/libmapper-arduino.git
49-
```
50-
* Until the issue in https://github.com/mathiasbredholt/libmapper-arduino/issues/3 gets fixed the file in `~/Library/Arduino15/packages/esp32/hardware/esp32/1.0.4/tools/sdk/include/lwip/arpa/inet.h` needs to be updated as described in the issue.
51-
* Run
52-
```
53-
mkdir build
54-
cd build
55-
cmake ..
56-
make
57-
```
58-
* The Arduino library will be compiled to build/Arduino/libmapper
33+
## Updating library
34+
- Run `update-library.sh`
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
#include <WiFi.h>
2+
#include <mapper_cpp.h>
3+
4+
#include <string>
5+
#include <vector>
6+
#include <algorithm>
7+
8+
using namespace mapper;
9+
10+
// For disabling power saving
11+
#include "esp_wifi.h"
12+
13+
const char* ssid = "WIFI_SSID";
14+
const char* password = "WIFI_PASSWORD";
15+
16+
const int NUM_SIGNALS = 32;
17+
18+
Device* dev;
19+
std::vector<Signal> signals;
20+
21+
void setup() {
22+
Serial.begin(115200);
23+
24+
// Begin WiFi before creating mapper device
25+
WiFi.begin(ssid, password);
26+
27+
// Disable WiFi power save (huge latency improvements)
28+
esp_wifi_set_ps(WIFI_PS_NONE);
29+
30+
// Wait for connection
31+
while (WiFi.status() != WL_CONNECTED) {
32+
delay(500);
33+
Serial.print(".");
34+
}
35+
36+
Serial.println("");
37+
Serial.println("WiFi connected");
38+
Serial.println("IP address: ");
39+
Serial.println(WiFi.localIP());
40+
41+
dev = new Device("ESP32");
42+
for (int i = 0; i < NUM_SIGNALS; ++i) {
43+
std::ostringstream sigName;
44+
sigName << "test" << i;
45+
float min = 0.0f;
46+
float max = 5.0f;
47+
signals.push_back(dev->add_signal(Direction::OUTGOING, sigName.str(), 1,
48+
Type::FLOAT, "V", &min, &max));
49+
}
50+
}
51+
52+
void loop() {
53+
dev->poll();
54+
for (int i = 0; i < NUM_SIGNALS; ++i) {
55+
signals[i].set_value(i);
56+
}
57+
}

gen-lib/CMakeLists.txt

Lines changed: 0 additions & 38 deletions
This file was deleted.

gen-lib/Makefile

Lines changed: 0 additions & 120 deletions
This file was deleted.

gen-lib/arduino-esp32.cmake

Lines changed: 0 additions & 22 deletions
This file was deleted.

gen-lib/genlib.sh

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)