Index: Components/AP/Includes/EcatDPM_Resources.h =================================================================== --- Components/AP/Includes/EcatDPM_Resources.h (revision 135838) +++ Components/AP/Includes/EcatDPM_Resources.h (revision 135839) @@ -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,6 +29,9 @@ #include "EcatDPM_Functionlist.h" #include "TcpipTcpTask_Public.h" +#if defined (__HARDWARESWITCH) +#include "EcatDPM_Switch.h" +#endif /*************************************************************************************/ /** @name Task Resource Structures @@ -230,12 +232,12 @@ TLR_BOOLEAN fStoreAliasToFlash; /* set if flashparmeters present */ TLR_BOOLEAN fExplicitDevIdRaceConditionError; - +#if defined (__HARDWARESWITCH) TLR_BOOLEAN fDeviceWithHardwareSwitchs; /* (rotary)switch resources */ ECAT_DPM_SWITCH_T tSwitch; TLR_HANDLE hSwitchTimer; - +#endif TLR_UINT16 usLocalStoredAliasInsteadFlashForNoFlashDevices; TLR_QUE_LINK_T tQueSiiWrite; Index: Components/AP/Sources/EcatDPM_Configuration.c =================================================================== --- Components/AP/Sources/EcatDPM_Configuration.c (revision 135838) +++ Components/AP/Sources/EcatDPM_Configuration.c (revision 135839) @@ -724,7 +724,7 @@ Task_EcatDPM_UpdateSyncConfig(ptRsc); } ptRsc->tLoc.fSetConfigValid = TLR_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 @@ -734,7 +734,7 @@ (void)EcatDPM_SendReceiveNewAddressSwitchValueToStack(ptRsc); } } - +#endif /* shall "bus on" be set ? TODO: replace ulDestId usage ? */ if(ptReqPck->ulDestId & 1) { @@ -897,7 +897,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 @@ -907,7 +907,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 135838) +++ Components/AP/Sources/EcatDPM_ConfigurationV4.c (revision 135839) @@ -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 135838) +++ Components/AP/Sources/EcatDPM_Resources.c (revision 135839) @@ -520,7 +520,7 @@ Drv_LedInitializeLed(ptRsc->tLeds.tErrorLed.hLed); } - /*Switch off the two unused LEDs so they don´t have the chance to glow*/ + /*Switch off the two unused LEDs so they don�t have the chance to glow*/ eRslt = Drv_LedIdentifyLed("COM0_RED", ptRsc->tLoc.uTskInst, &ptRsc->tLeds.tUnusedRunLed.hLed); if (TLR_S_OK != eRslt) { @@ -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 135838) +++ Components/AP/Sources/EcatDPM_Switch.c (revision 135839) @@ -4,8 +4,8 @@ * Created on: 11.05.2021 * Author: jkollmannsperger */ +#if defined (__HARDWARESWITCH) - #include "EcatDPM_Includes.h" #include "EcatDPM_Private.h" @@ -197,7 +197,7 @@ } } - /* we just send the packet and don´t care about the answer, because it will be deleted in packet handler*/ + /* we just send the packet and don�t care about the answer, because it will be deleted in packet handler*/ tResult = TLR_QUE_SENDPACKET_FIFO_INTERN(ptRsc->tRem.hQueEsm, ptRcxSetFirmwareParameterReq, TLR_INFINITE); if(TLR_S_OK != tResult) { @@ -209,3 +209,4 @@ return tResult; } +#endif Index: Components/AP/wscript =================================================================== --- Components/AP/wscript (revision 135838) +++ Components/AP/wscript (revision 135839) @@ -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 135838) +++ Targets/common/StackConf.c (revision 135839) @@ -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,8 @@ /*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 135838) +++ Targets/netX51/Sources/Config_netX51.c (revision 135839) @@ -55,7 +55,7 @@ #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" @@ -852,7 +852,7 @@ Drv_PioSetupLedOperations }, { - {"COM0_RED",RX_PERIPHERAL_TYPE_LED, 0}, //unused don´t delete + {"COM0_RED",RX_PERIPHERAL_TYPE_LED, 0}, //unused don�t delete {"SYSPIO", RX_PERIPHERAL_TYPE_PIO, 0}, {0}, {0}, @@ -870,7 +870,7 @@ Drv_PioSetupLedOperations }, { - {"COM1_GREEN",RX_PERIPHERAL_TYPE_LED, 0}, //unused don´t delete + {"COM1_GREEN",RX_PERIPHERAL_TYPE_LED, 0}, //unused don�t delete {"SYSPIO", RX_PERIPHERAL_TYPE_PIO, 0}, {0}, {0}, @@ -938,7 +938,7 @@ /* RAM disk configuration */ STATIC RX_VOLUME_SET_T atrXVol[] = { - {{"SYSVOLUME",RX_PERIPHERAL_TYPE_VOLUME,0}, /* Set Volume’s object header */ + {{"SYSVOLUME",RX_PERIPHERAL_TYPE_VOLUME,0}, /* Set Volume�s object header */ 1024 * 1024, /* Total number of bytes physically available in the media */ 0, /* Byte start address of FAT Partition in Drive */ 12345, /* Drive Volume serial Number */ @@ -959,7 +959,7 @@ STATIC RX_VOLUME_SET_T atrXVol[] = { - {{"SYSVOLUME",RX_PERIPHERAL_TYPE_VOLUME,0}, /* Set Volume’s object header */ + {{"SYSVOLUME",RX_PERIPHERAL_TYPE_VOLUME,0}, /* Set Volume�s object header */ 0x003F0000, /* Set the total capacity */ 0x00010000, /* Start right at byte 65.536 */ 12345, /* Serial Number of Volume */ Index: TestTargets/netX51_LWIP_SocketApi_debug/Sources/Config_netX51.c =================================================================== --- TestTargets/netX51_LWIP_SocketApi_debug/Sources/Config_netX51.c (revision 135838) +++ TestTargets/netX51_LWIP_SocketApi_debug/Sources/Config_netX51.c (revision 135839) @@ -57,7 +57,6 @@ #include "rcX_Toolbox_Public.h" #include "Lwip_Public.h" #include "Hil_Results.h" -#include "RotarySwitch_Includes.h" #define __USE_BOOTTOKEN_CUSTOM_MMIO_MAPPING__ @@ -861,7 +860,7 @@ Drv_PioSetupLedOperations }, { - {"COM0_RED",RX_PERIPHERAL_TYPE_LED, 0}, //unused don´t delete + {"COM0_RED",RX_PERIPHERAL_TYPE_LED, 0}, //unused don�t delete {"SYSPIO", RX_PERIPHERAL_TYPE_PIO, 0}, {0}, {0}, @@ -879,7 +878,7 @@ Drv_PioSetupLedOperations }, { - {"COM1_GREEN",RX_PERIPHERAL_TYPE_LED, 0}, //unused don´t delete + {"COM1_GREEN",RX_PERIPHERAL_TYPE_LED, 0}, //unused don�t delete {"SYSPIO", RX_PERIPHERAL_TYPE_PIO, 0}, {0}, {0}, @@ -947,7 +946,7 @@ /* RAM disk configuration */ STATIC RX_VOLUME_SET_T atrXVol[] = { - {{"SYSVOLUME",RX_PERIPHERAL_TYPE_VOLUME,0}, /* Set Volume’s object header */ + {{"SYSVOLUME",RX_PERIPHERAL_TYPE_VOLUME,0}, /* Set Volume�s object header */ 1024 * 1024, /* Total number of bytes physically available in the media */ 0, /* Byte start address of FAT Partition in Drive */ 12345, /* Drive Volume serial Number */ @@ -968,7 +967,7 @@ STATIC RX_VOLUME_SET_T atrXVol[] = { - {{"SYSVOLUME",RX_PERIPHERAL_TYPE_VOLUME,0}, /* Set Volume’s object header */ + {{"SYSVOLUME",RX_PERIPHERAL_TYPE_VOLUME,0}, /* Set Volume�s object header */ 0x003F0000, /* Set the total capacity */ 0x00010000, /* Start right at byte 65.536 */ 12345, /* Serial Number of Volume */ Index: TestTargets/netX52_hifsdram_debug/Sources/Config_netX52_hifsdram.c =================================================================== --- TestTargets/netX52_hifsdram_debug/Sources/Config_netX52_hifsdram.c (revision 135838) +++ TestTargets/netX52_hifsdram_debug/Sources/Config_netX52_hifsdram.c (revision 135839) @@ -56,7 +56,6 @@ #include "config_flash.h" #include "PS_Toolbox_Public.h" #include "rcX_Toolbox_Public.h" -#include "RotarySwitch_Includes.h" #define __USE_BOOTTOKEN_CUSTOM_MMIO_MAPPING__ @@ -784,7 +783,7 @@ Drv_PioSetupLedOperations }, { - {"COM0_RED",RX_PERIPHERAL_TYPE_LED, 0}, //unused don´t delete + {"COM0_RED",RX_PERIPHERAL_TYPE_LED, 0}, //unused don�t delete {"SYSPIO", RX_PERIPHERAL_TYPE_PIO, 0}, {0}, {0}, @@ -802,7 +801,7 @@ Drv_PioSetupLedOperations }, { - {"COM1_GREEN",RX_PERIPHERAL_TYPE_LED, 0}, //unused don´t delete + {"COM1_GREEN",RX_PERIPHERAL_TYPE_LED, 0}, //unused don�t delete {"SYSPIO", RX_PERIPHERAL_TYPE_PIO, 0}, {0}, {0}, @@ -873,7 +872,7 @@ /* RAM disk configuration */ STATIC RX_VOLUME_SET_T atrXVol[] = { - {{"SYSVOLUME",RX_PERIPHERAL_TYPE_VOLUME,0}, /* Set Volume’s object header */ + {{"SYSVOLUME",RX_PERIPHERAL_TYPE_VOLUME,0}, /* Set Volume�s object header */ 1024 * 1024, /* Total number of bytes physically available in the media */ 0, /* Byte start address of FAT Partition in Drive */ 12345, /* Drive Volume serial Number */ @@ -894,7 +893,7 @@ STATIC RX_VOLUME_SET_T atrXVol[] = { - {{"SYSVOLUME",RX_PERIPHERAL_TYPE_VOLUME,0}, /* Set Volume’s object header */ + {{"SYSVOLUME",RX_PERIPHERAL_TYPE_VOLUME,0}, /* Set Volume�s object header */ 0x003F0000, /* Set the total capacity */ 0x00010000, /* Start right at byte 65.536 */ 12345, /* Serial Number of Volume */ @@ -1045,7 +1044,7 @@ { /* For nxhx52 board the values in design-in guide are wrong - * following MMIO´s have to be changed for using on nxhx52-board: + * following MMIO�s have to be changed for using on nxhx52-board: * MMIO 8 with MMIO 3 * MMIO 9 with MMIO 2 * MMIO 10 with MMIO 1