Index: Components/AP/Includes/EcatDPM_Resources.h =================================================================== --- Components/AP/Includes/EcatDPM_Resources.h (revision 123451) +++ Components/AP/Includes/EcatDPM_Resources.h (revision 123452) @@ -23,7 +23,6 @@ #ifndef __ECAT_DPM_RESOURCES_H #define __ECAT_DPM_RESOURCES_H -#include "EcatDPM_Switch.h" #include "rcX_User.h" #include "TLR_Watchdog.h" #include "EcsV4_Legacy.h" @@ -30,8 +29,10 @@ #include "EcatDPM_Functionlist.h" #include "TcpipTcpTask_Public.h" +#if defined (__HARDWARESWITCH) +#include "EcatDPM_Switch.h" +#endif - /*************************************************************************************/ /** @name Task Resource Structures * @@ -231,12 +232,12 @@ bool fStoreAliasToFlash; /* set if flashparmeters present */ bool fExplicitDevIdRaceConditionError; - +#if defined (__HARDWARESWITCH) bool fDeviceWithHardwareSwitchs; /* (rotary)switch resources */ ECAT_DPM_SWITCH_T tSwitch; void* hSwitchTimer; - +#endif uint16_t usLocalStoredAliasInsteadFlashForNoFlashDevices; TLR_QUE_LINK_T tQueSiiWrite; Index: Components/AP/Sources/EcatDPM_Configuration.c =================================================================== --- Components/AP/Sources/EcatDPM_Configuration.c (revision 123451) +++ Components/AP/Sources/EcatDPM_Configuration.c (revision 123452) @@ -727,7 +727,7 @@ Task_EcatDPM_UpdateSyncConfig(ptRsc); } ptRsc->tLoc.fSetConfigValid = false; - +#if defined (__HARDWARESWITCH) if(ptRsc->tLoc.fDeviceWithHardwareSwitchs) { /* Even if we have added the address value to the set config we have to send a Rcx Set FW Parameter Req @@ -737,7 +737,7 @@ (void)EcatDPM_SendReceiveNewAddressSwitchValueToStack(ptRsc); } } - +#endif /* shall "bus on" be set ? TODO: replace ulDestId usage ? */ if(ptReqPck->ulDestId & 1) { @@ -900,7 +900,7 @@ /* Override SyncPdi value (reg151) to allways activate the sync interrupts which are needed for sync monitoring * (Of course interrupts are only active when master side switches sync on with reg 980)*/ ptPck->tSetParametersRev4Req.tData.bSyncPdiConfig |= 0x88; // bits 3 + 7 - +#if defined (__HARDWARESWITCH) if(ptRsc->tLoc.fDeviceWithHardwareSwitchs) { /* Override activate parameter for devices with rotaryswitches @@ -910,7 +910,7 @@ ptPck->tSetConfigV4Req.tData.tComponentsCfg.tUidCfg.usDeviceIdentificationValue = ptRsc->tLoc.tSwitch.usAddressSwitchValue; } } - +#endif if(ulPckLen > sizeof(ptPck->tSetParametersRev4Req.tData)) { ptPck->tHead.ulSta = TLR_E_INVALID_PACKET_LEN; Index: Components/AP/Sources/EcatDPM_ConfigurationV4.c =================================================================== --- Components/AP/Sources/EcatDPM_ConfigurationV4.c (revision 123451) +++ Components/AP/Sources/EcatDPM_ConfigurationV4.c (revision 123452) @@ -92,7 +92,7 @@ { ptPck->tSetConfigV4Req.tData.tComponentsCfg.tSyncPdiCfg.bSyncPdiConfig |= 0x88; // bits 3 + 7 } - +#if defined (__HARDWARESWITCH) if(ptRsc->tLoc.fDeviceWithHardwareSwitchs) { /* Override activate parameter for devices with rotaryswitches @@ -103,7 +103,7 @@ ptPck->tSetConfigV4Req.tData.tComponentsCfg.tUidCfg.usDeviceIdentificationValue = ptRsc->tLoc.tSwitch.usAddressSwitchValue; } } - +#endif if(ptPck->tSetConfigV4Req.tData.tBasicCfg.ulComponentInitialization & ECAT_SET_CONFIG_SYNCMODES) { /* validate given sync sources */ Index: Components/AP/Sources/EcatDPM_Resources.c =================================================================== --- Components/AP/Sources/EcatDPM_Resources.c (revision 123451) +++ Components/AP/Sources/EcatDPM_Resources.c (revision 123452) @@ -558,7 +558,7 @@ ptRsc->tLeds.hTimer = NULL; } } - +#if defined (__HARDWARESWITCH) if(NULL != ptInitParam->pfncInitAddressSwitchFunc) { /* Init Rotary Switches*/ @@ -606,7 +606,7 @@ } } } - +#endif if (ptRsc->tLoc.fStoreAliasToFlash) { /*restore station alias*/ @@ -673,12 +673,12 @@ { TLR_TIM_DELETE(ptRsc->tLeds.hTimer); } - +#if defined (__HARDWARESWITCH) if(NULL != ptRsc->tLoc.hSwitchTimer) { TLR_TIM_DELETE(ptRsc->tLoc.hSwitchTimer); } - +#endif if(ptRsc->tLoc.fDpmWatchdogInitialized) { (void) Tlr_Watchdog_Deinitialize(&ptRsc->tLoc.tDpmWatchdog); Index: Components/AP/Sources/EcatDPM_Switch.c =================================================================== --- Components/AP/Sources/EcatDPM_Switch.c (revision 123451) +++ Components/AP/Sources/EcatDPM_Switch.c (revision 123452) @@ -4,6 +4,7 @@ * Created on: 11.05.2021 * Author: jkollmannsperger */ +#if defined (__HARDWARESWITCH) #include "EcatDPM_Includes.h" @@ -209,3 +210,4 @@ return tResult; } +#endif Index: Components/AP/wscript =================================================================== --- Components/AP/wscript (revision 123451) +++ Components/AP/wscript (revision 123452) @@ -102,11 +102,12 @@ lib_path + "/rcx_sdk", lib_path + "/rcx_" + chip + "_sdk", "Hil_Definition_netXFirmware_sdk", - "rotaryswitch_sdk", ] + if '__HARDWARESWITCH' in build_info: + use_additional = ["rotaryswitch_sdk",] + else: + use_additional = [] - - bld.stlib(target=lib_name, name=lib_path + "/" + lib_name, toolchain=rcx_toolchains[lib_path], @@ -131,7 +132,7 @@ # "-Wcast-align", "-Werror" ], - use=use_ap, + use= use_ap + use_additional, features=["buildstamp", ], ) Index: Targets/common/StackConf.c =================================================================== --- Targets/common/StackConf.c (revision 123451) +++ Targets/common/StackConf.c (revision 123452) @@ -16,7 +16,9 @@ #include "EscRcX_Public_netx100.h" #endif #ifndef __NO_ECS_DPM_TASK__ +#if defined(__HARDWARESWITCH) #include "RotarySwitch_Includes.h" +#endif #include "EcatDPM_Functionlist.h" #endif #include "EcsV4_Functionlist.h" @@ -343,7 +345,7 @@ /*we don?t need DPM task startupparameters for NXIO100 and NXO targets */ #ifndef __NO_ECS_DPM_TASK__ -#if defined(__COMX51) && defined(__HARDWARESWITCH) +#if defined(__HARDWARESWITCH) extern ECAT_DPM_ROTARYSWITCH_CONFIG_PARAMETER_T g_atAddressSwitchParam[]; #define INIT_SWITCH_FNC RotarySwitch_InitMmio Index: Targets/netX51/Sources/Config_netX51.c =================================================================== --- Targets/netX51/Sources/Config_netX51.c (revision 123451) +++ Targets/netX51/Sources/Config_netX51.c (revision 123452) @@ -55,7 +55,6 @@ #include "config_flash.h" #include "PS_Toolbox_Public.h" #include "rcX_Toolbox_Public.h" -#include "RotarySwitch_Includes.h" #include "TcpipTcpTask_Public.h" #include "TcpipTcpTask_Functionlist.h" #include "netX_Toolbox_Public.h" Index: TestTargets/netX51_LWIP_SocketApi_debug/Sources/Config_netX51.c =================================================================== --- TestTargets/netX51_LWIP_SocketApi_debug/Sources/Config_netX51.c (revision 123451) +++ TestTargets/netX51_LWIP_SocketApi_debug/Sources/Config_netX51.c (revision 123452) @@ -57,7 +57,6 @@ #include "rcX_Toolbox_Public.h" #include "Lwip_Public.h" #include "Hil_Results.h" -#include "RotarySwitch_Includes.h" #include "netX_Toolbox_Public.h" #define __USE_BOOTTOKEN_CUSTOM_MMIO_MAPPING__ Index: TestTargets/netX52_hifsdram_debug/Sources/Config_netX52_hifsdram.c =================================================================== --- TestTargets/netX52_hifsdram_debug/Sources/Config_netX52_hifsdram.c (revision 123451) +++ TestTargets/netX52_hifsdram_debug/Sources/Config_netX52_hifsdram.c (revision 123452) @@ -56,7 +56,6 @@ #include "config_flash.h" #include "PS_Toolbox_Public.h" #include "rcX_Toolbox_Public.h" -#include "RotarySwitch_Includes.h" #include "netX_Toolbox_Public.h" #define __USE_BOOTTOKEN_CUSTOM_MMIO_MAPPING__