-
-
Notifications
You must be signed in to change notification settings - Fork 795
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Serial doesn't work for mbed framework #122
Comments
Fix mbed framework // Resolve #122
I should note that I only I came here searching for Here's the source code: // project/src/main.cpp
#include <Arduino.h>
#include <functional>
void method(std::function<int (int)>reader){
reader(3);// read pin 3
}
void setup(){}
void loop(){
method(touchRead);
} Here's the platformio configuration: # project/project.ini
[env:teensylc]
platform = teensy
framework = arduino
board = teensylc Here's the error:
|
Hi @hoosierEE ! |
Hi @valeros no, it complains that it can't find |
Hmm, could you please add these stubs to your code? Does it work? extern "C"{
int _getpid(){ return -1;}
int _kill(int pid, int sig){ return -1; }
int _write(){return -1;}
} |
Hi @valeros it does work when I add those stubs, thanks! Here is my modified example: // project/src/main.cpp
#include <Arduino.h>
#include <functional>
extern "C"{
int _getpid(){ return -1;}
int _kill(int pid, int sig){ return -1; }
int _write(){return -1;}
}
void method(std::function<int (int)>reader){
reader(3);// read pin 3
}
void setup(){}
void loop(){
method(touchRead);
} |
Example
The text was updated successfully, but these errors were encountered: