Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- diff -uNpr V86DUDE-master.orig/dmpcfg.h V86DUDE-master/dmpcfg.h
- --- V86DUDE-master.orig/dmpcfg.h Mon Dec 30 12:32:54 2013
- +++ V86DUDE-master/dmpcfg.h Tue Mar 11 05:21:02 2014
- @@ -36,8 +36,8 @@
- #define DMP_DOS_WATCOM
- #endif
- -#if defined(linux) && defined(__GNUC__)
- - #define DMP_LINUX
- +#if defined(__linux__) || defined(__APPLE__) || defined(__OpenBSD__)
- + #define DMP_PCUNIX_GCC
- #endif
- #if defined(_MSC_VER) //&& defined(_M_IX86)
- @@ -73,7 +73,7 @@
- #elif defined(DMP_DOS_DJGPP)
- //#define __dmp_inline(rtype) static __INLINE__ rtype
- #define __dmp_inline(rtype) static __inline__ rtype
- -#elif defined(DMP_LINUX_GCC)
- +#elif defined(DMP_PCUNIX_GCC)
- // note: GCC would always do inline-expansion for "static inline"
- #define __dmp_inline(rtype) static __inline__ rtype
- #elif defined(DMP_WINCE_MSVC) || defined(DMP_WIN32_MSVC)
- diff -uNpr V86DUDE-master.orig/openbsd/Makefile V86DUDE-master/openbsd/Makefile
- --- V86DUDE-master.orig/openbsd/Makefile Thu Jan 1 09:00:00 1970
- +++ V86DUDE-master/openbsd/Makefile Tue Mar 11 05:01:37 2014
- @@ -0,0 +1,8 @@
- +v86dude.exe : v86dude.o
- + gcc -o v86dude.exe v86dude.o -lstdc++
- +v86dude.o : ../v86dude.cpp
- + gcc -c ../v86dude.cpp -I../
- +
- +.PHONY : clean
- +clean :
- + -rm v86dude.o v86dude.exe
- diff -uNpr V86DUDE-master.orig/openbsd/readme.md V86DUDE-master/openbsd/readme.md
- --- V86DUDE-master.orig/openbsd/readme.md Thu Jan 1 09:00:00 1970
- +++ V86DUDE-master/openbsd/readme.md Tue Mar 11 05:32:22 2014
- @@ -0,0 +1,4 @@
- +OpenBSD
- +---------
- +
- +Simply use "make" to compile this program.
- diff -uNpr V86DUDE-master.orig/v86dude.cpp V86DUDE-master/v86dude.cpp
- --- V86DUDE-master.orig/v86dude.cpp Mon Dec 30 12:32:54 2013
- +++ V86DUDE-master/v86dude.cpp Tue Mar 11 05:25:19 2014
- @@ -8,7 +8,7 @@
- #define UART_INACTIVE (0x02)
- #define COM_TIMEOUT (8000L) // timeout = 8s
- -#if defined (DMP_LINUX) || defined (__APPLE__)
- +#if defined (DMP_PCUNIX_GCC)
- #include <unistd.h>
- #include <termios.h>
- #include <fcntl.h>
- @@ -36,7 +36,7 @@ typedef struct usbcom {
- unsigned long timer_nowtime(void) { //in ms
- #if defined(DMP_WIN32_MSVC) || defined(DMP_WINCE_MSVC)
- return GetTickCount();
- -#elif defined(DMP_LINUX) || defined (__APPLE__)
- +#elif defined (DMP_PCUNIX_GCC)
- static bool usetimer = false;
- static unsigned long long inittime;
- struct tms cputime;
- @@ -63,7 +63,7 @@ void wait_uart_state(USBCOM_t* com, int state) {
- {
- if(timer_nowtime() > now) {printf("Wait COM port to timeout\n"); free((void*)com); exit(1);}
- -#if defined (DMP_LINUX) || defined (__APPLE__)
- +#if defined (DMP_PCUNIX_GCC)
- com->fp = open(com->port, O_RDWR | O_NOCTTY | O_NONBLOCK);
- if(state == UART_INACTIVE)
- {if(com->fp < 0) break; else close(com->fp);}
- @@ -87,7 +87,7 @@ void wait_uart_state(USBCOM_t* com, int state) {
- USBCOM_t* Init_UART(USBCOM_t* com) {
- wait_uart_state(com, UART_ACTIVE);
- -#if defined (DMP_LINUX) || defined (__APPLE__)
- +#if defined (DMP_PCUNIX_GCC)
- if (tcgetattr(com->fp, &(com->oldstate)) < 0)
- printf("fail to get termios settings\n");
- @@ -150,7 +150,7 @@ USBCOM_t* Init_UART(USBCOM_t* com) {
- void Close_UART(USBCOM_t* com) {
- if(com == NULL) return;
- -#if defined (DMP_LINUX) || defined (__APPLE__)
- +#if defined (DMP_PCUNIX_GCC)
- //tcsetattr(com->fp, TCSANOW, &(com->oldstate));
- close(com->fp);
- #elif defined (DMP_WIN32_MSVC)
- @@ -160,7 +160,7 @@ void Close_UART(USBCOM_t* com) {
- static void softreset_86duino(USBCOM_t* com) {
- if(com == NULL) return;
- -#if defined (DMP_LINUX) || defined (__APPLE__)
- +#if defined (DMP_PCUNIX_GCC)
- //tcsetattr(com->fp, TCSANOW, &(com->oldstate));
- cfsetospeed(&(com->newstate), B1200);
- cfsetispeed(&(com->newstate), B1200);
- @@ -226,7 +226,7 @@ static bool send_package(USBCOM_t* com, unsigned char*
- for (nowtime = timer_nowtime(); bsize2 > 0; buf += numbytes, bsize2 -= numbytes, bsize -= numbytes)
- {
- -#if defined (DMP_LINUX) || defined (__APPLE__)
- +#if defined (DMP_PCUNIX_GCC)
- if((numbytes = write(com->fp, buf, bsize2)) == -1) numbytes = 0;
- #elif defined (DMP_WIN32_MSVC)
- WriteFile(com->ur, buf, bsize2, (LPDWORD)&numbytes, NULL);
- @@ -246,7 +246,7 @@ static bool send_package(USBCOM_t* com, unsigned char*
- }
- }
- -#if defined (DMP_LINUX) || defined (__APPLE__)
- +#if defined (DMP_PCUNIX_GCC)
- if(tcdrain(com->fp) < 0)
- {
- printf("tcdrain() fails\n");
- @@ -266,7 +266,7 @@ static bool send_package(USBCOM_t* com, unsigned char*
- static bool receive_package(USBCOM_t* com, unsigned char* buf, int bsize) {
- int numbytes = 0;
- -#if defined (DMP_LINUX) || defined (__APPLE__)
- +#if defined (DMP_PCUNIX_GCC)
- unsigned long nowtime = timer_nowtime();
- while(bsize > 0)
- {
- @@ -619,7 +619,7 @@ int main(int argc, char* argv[]) {
- Serial = (USBCOM_t*) malloc(sizeof(USBCOM_t));
- if(Serial == NULL) return 1;
- -#if defined (DMP_LINUX) || defined (__APPLE__)
- +#if defined (DMP_PCUNIX_GCC)
- Serial->port = argv[1];
- #elif defined (DMP_WIN32_MSVC)
- win_port[0] = '\\'; win_port[1] = '\\'; win_port[2] = '.'; win_port[3] = '\\';
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement