From b1ebcb9acec5ad9cde5ddc6d893d94927ac9ede8 Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Tue, 15 Mar 2016 07:12:37 +0100 Subject: [PATCH] [VC++] Quick & dirty fix to avoid the gettimeofday function when _MSC_VER is defined --- radio/src/targets/simu/simpgmspace.cpp | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/radio/src/targets/simu/simpgmspace.cpp b/radio/src/targets/simu/simpgmspace.cpp index 9a7114179..e3d78477c 100644 --- a/radio/src/targets/simu/simpgmspace.cpp +++ b/radio/src/targets/simu/simpgmspace.cpp @@ -17,17 +17,17 @@ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. */ - #include "opentx.h" #include #include #include #include -#include -#if defined WIN32 || !defined __GNUC__ +#if defined(_MSC_VER) #include #define mkdir(s, f) _mkdir(s) +#else + #include #endif #if defined(SIMU_DISKIO) @@ -96,16 +96,24 @@ void toplcdOff() uint16_t getTmr16KHz() { +#if defined(_MSC_VER) + return get_tmr10ms() * 16; +#else struct timeval tv; gettimeofday(&tv, NULL); return tv.tv_usec * 2 / 125; +#endif } uint16_t getTmr2MHz() { +#if defined(_MSC_VER) + return get_tmr10ms() * 125; +#else struct timeval tv; gettimeofday(&tv, NULL); return tv.tv_usec * 2; +#endif } void simuInit()