I'm having a dumb problem, probably with a dumb cause, but I haven't been able to figure it out.
I'm working on UART emulation code in C, so I can emulate the USB adapter from the Cheapocabra devkit. I was planning to post it once I get it tested and cleaned up, but for now I'm kinda stuck, so hopefully someone can help spot the problem. The code in async.c is isn't really in a usable state, it's kinda hard to get it working when I can't properly test it though..
Normally I only work with C, so maybe it's C++ related? What I've got is some code that works every time when I compile and run it by itself with a very simple main() function. Now I'm trying to add it into Nintendulator for testing, and it fails every time. serial_open() in serial_windows.c is where it fails. Works every time in a stand-alone test (C compiler), fails every time built with Nintendulator (C++). Checking GetLastError() returns code 2, which is "file not found". Stepping through it with a debugger hasn't been very enlightening, just windows kernal stuff viewed as a disassembly.. yeah.. not sure where to go from there.
Is there some reason why this would fail when being used in Nintendulator, but works fine in my own little "main.c" file?
-header files are wrapped in extern C{}
-using visual studio 2017
-I'm calling async_open() from Nintendulator.cpp, just before it enters the main loop
-serial.h, serial_windows.c, serial_linux.c is not my code, they're some simple libraries I've been using and modifying
I'm working on UART emulation code in C, so I can emulate the USB adapter from the Cheapocabra devkit. I was planning to post it once I get it tested and cleaned up, but for now I'm kinda stuck, so hopefully someone can help spot the problem. The code in async.c is isn't really in a usable state, it's kinda hard to get it working when I can't properly test it though..
Normally I only work with C, so maybe it's C++ related? What I've got is some code that works every time when I compile and run it by itself with a very simple main() function. Now I'm trying to add it into Nintendulator for testing, and it fails every time. serial_open() in serial_windows.c is where it fails. Works every time in a stand-alone test (C compiler), fails every time built with Nintendulator (C++). Checking GetLastError() returns code 2, which is "file not found". Stepping through it with a debugger hasn't been very enlightening, just windows kernal stuff viewed as a disassembly.. yeah.. not sure where to go from there.
Is there some reason why this would fail when being used in Nintendulator, but works fine in my own little "main.c" file?
-header files are wrapped in extern C{}
-using visual studio 2017
-I'm calling async_open() from Nintendulator.cpp, just before it enters the main loop
-serial.h, serial_windows.c, serial_linux.c is not my code, they're some simple libraries I've been using and modifying