I noticed a strange problem with Streaming library mikalhart/Streaming@^1.0.0
on RPi2040. This snippet:
#include <Arduino.h>
#include <Streaming.h>
#include <iostream>
#include <chrono>
using namespace std;
using namespace std::chrono;
void setup()
{
pinMode(LED_BUILTIN, OUTPUT);
Serial.begin(115200);
}
void loop()
{
digitalWrite(LED_BUILTIN, HIGH);
delay(500);
digitalWrite(LED_BUILTIN, LOW);
auto t0 = high_resolution_clock::now();
delay(1000);
auto t1 = high_resolution_clock::now();
Serial << (t1-t0)/1us << endl;
}
compiles and runs fine on ESP32, but will not compile on RP2040, producing this error:
src/main.cpp:27:28: error: reference to 'endl' is ambiguous
27 | Serial << (t1-t0)/1us << endl;
| ^~~~
The last line has to be replaced with:
Serial << (t1-t0)/1us << "\n";
I’m not sure if I should discuss issues of this kind here, but I couldn’t find a github repo or another issues channel for this library.