Skip to content

Commit

Permalink
Merge pull request OpenEtherCATsociety#164 from zchen24/fix/cmake-win…
Browse files Browse the repository at this point in the history
…64-path

Fixed windows x64 link path
  • Loading branch information
nakarlsson authored Mar 4, 2018
2 parents c12de66 + 462464e commit 0398b6b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,11 @@ set(SOEM_LIB_INSTALL_DIR lib)
if(WIN32)
set(OS "win32")
include_directories(oshw/win32/wpcap/Include)
link_directories(${CMAKE_SOURCE_DIR}/oshw/win32/wpcap/Lib)
if(CMAKE_SIZEOF_VOID_P EQUAL 8)
link_directories(${CMAKE_SOURCE_DIR}/oshw/win32/wpcap/Lib/x64)
elseif(CMAKE_SIZEOF_VOID_P EQUAL 4)
link_directories(${CMAKE_SOURCE_DIR}/oshw/win32/wpcap/Lib)
endif()
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /D _CRT_SECURE_NO_WARNINGS")
set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /WX")
set(OS_LIBS wpcap.lib Packet.lib Ws2_32.lib Winmm.lib)
Expand Down
6 changes: 3 additions & 3 deletions soem/ethercatconfig.c
Original file line number Diff line number Diff line change
Expand Up @@ -763,7 +763,7 @@ static int ecx_map_sm(ecx_contextt *context, uint16 slave)
context->slavelist[slave].SM[nSM].SMflags =
htoel( etohl(context->slavelist[slave].SM[nSM].SMflags) & EC_SMENABLEMASK);
}
ecx_FPWR(context->port, configadr, ECT_REG_SM0 + (nSM * sizeof(ec_smt)),
ecx_FPWR(context->port, configadr, (uint16)(ECT_REG_SM0 + (nSM * sizeof(ec_smt))),
sizeof(ec_smt), &context->slavelist[slave].SM[nSM], EC_TIMEOUTRET3);
EC_PRINT(" SM%d Type:%d StartAddr:%4.4x Flags:%8.8x\n", nSM,
context->slavelist[slave].SMtype[nSM],
Expand Down Expand Up @@ -1507,7 +1507,7 @@ int ecx_reconfig_slave(ecx_contextt *context, uint16 slave, int timeout)
{
if (context->slavelist[slave].SM[nSM].StartAddr)
{
ecx_FPWR(context->port, configadr, ECT_REG_SM0 + (nSM * sizeof(ec_smt)),
ecx_FPWR(context->port, configadr, (uint16)(ECT_REG_SM0 + (nSM * sizeof(ec_smt))),
sizeof(ec_smt), &context->slavelist[slave].SM[nSM], timeout);
}
}
Expand All @@ -1525,7 +1525,7 @@ int ecx_reconfig_slave(ecx_contextt *context, uint16 slave, int timeout)
/* program configured FMMU */
for( FMMUc = 0 ; FMMUc < context->slavelist[slave].FMMUunused ; FMMUc++ )
{
ecx_FPWR(context->port, configadr, ECT_REG_FMMU0 + (sizeof(ec_fmmut) * FMMUc),
ecx_FPWR(context->port, configadr, (uint16)(ECT_REG_FMMU0 + (sizeof(ec_fmmut) * FMMUc)),
sizeof(ec_fmmut), &context->slavelist[slave].FMMU[FMMUc], timeout);
}
}
Expand Down

0 comments on commit 0398b6b

Please sign in to comment.