mirror of
https://github.com/EEVengers/ThunderScope.git
synced 2025-04-22 17:43:44 +00:00
Make thunderscopehwtest build on windows
This commit is contained in:
parent
80b9919706
commit
fba65f20fe
Software/libthunderscopehw
@ -17,13 +17,6 @@ PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/thunderscopehw_pll.c
|
||||
)
|
||||
|
||||
include(CheckLibraryExists)
|
||||
check_library_exists(m pow "" LIBM)
|
||||
if(LIBM)
|
||||
target_link_libraries(thunderscopehwlib
|
||||
m)
|
||||
endif()
|
||||
|
||||
|
||||
target_include_directories(thunderscopehwlib
|
||||
PUBLIC ../include)
|
||||
@ -46,8 +39,15 @@ PRIVATE
|
||||
${CMAKE_CURRENT_SOURCE_DIR}/thunderscopehw_simulator.c
|
||||
)
|
||||
|
||||
target_link_libraries(thunderscopehwtestlib
|
||||
m)
|
||||
include(CheckLibraryExists)
|
||||
check_library_exists(m pow "" LIBM)
|
||||
if(LIBM)
|
||||
target_link_libraries(thunderscopehwlib
|
||||
m)
|
||||
target_link_libraries(thunderscopehwtestlib
|
||||
m)
|
||||
endif()
|
||||
|
||||
|
||||
target_include_directories(thunderscopehwtestlib
|
||||
PUBLIC ../include)
|
||||
|
@ -1,7 +1,5 @@
|
||||
#include "thunderscopehw.h"
|
||||
|
||||
#include <unistd.h>
|
||||
#include <getopt.h>
|
||||
#include <stdio.h>
|
||||
#include <stdlib.h>
|
||||
#include <inttypes.h>
|
||||
@ -14,6 +12,10 @@ int main(int argc, char** argv) {
|
||||
thunderscopehw_enable_channel(ts, 0);
|
||||
thunderscopehw_start(ts);
|
||||
uint8_t* buffer;
|
||||
#ifdef _WIN32
|
||||
buffer = _aligned_malloc(1 << 20, 4096);
|
||||
#else
|
||||
posix_memalign((void**)&buffer, 4096, 1 << 20);
|
||||
#endif
|
||||
thunderscopehw_read(ts, buffer, 1 << 20);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user