installable cmake package with stub classes to allow basic teensy code and libraries to be compiled and debugged on your x86/x64 architecture
sd | audio | st7735 | midi | bounce2 | encoder
- to initialize the arduino timing library so that millis() will return the duration in milliseconds since the test app has been runnning
initialize_mock_arduino()
- To test teensy code accessing an SD card file, you'll need to install teensy-x86-sd-stubs
char *buffer = "blah blah blah blah blah";
SD.setSDCardFileData(buffer, strlen(buffer));
#include <Arduino.h>
#include <SD.h>
using namespace std;
int main(int argc, char **argv){
std::cout << "starting app...\n";
initialize_mock_arduino();
char *buffer = "blah blah blah blah blah";
SD.setSDCardFileData(buffer, strlen(buffer));
File f = SD.open("abcdefg.123");
char *output = new char[1000];
int bytesRead = f.read(output, 1000);
std::cout << bytesRead << " bytes read: \n" << output;
}
starting app...
24 bytes read:
blah blah blah blah blah
project(thing C CXX)
find_package(teensy_x86_stubs)
include_directories(${teensy_x86_stubs_INCLUDE_DIR})
add_executable(thing main.cpp)
target_link_libraries(thing ${teensy_x86_stubs_LIBS})
git clone https://github.com/newdigate/teensy-x86-stubs.git
cd teensy-x86-stubs
mkdir cmake-build-debug
cd cmake-build-debug
cmake ..
sudo make install
sudo make uninstall
- simial to maniacbug/ncore
- Don't Run Unit Tests on the Arduino Device or Emulator
- stackoverflow 11437456
- includes code from IronSavior/dsm2_tx
- cmake uninstaller
Unless specified in source code file, all code is MIT license.