Эх сурвалжийг харах

Closes #40 Removes LM3S8962 support

capxilinx 10 жил өмнө
parent
commit
83547763d9

+ 1 - 1
source/CMakeLists.txt

@@ -21,7 +21,7 @@ INCLUDE( ${OpENer_BUILDSUPPORT_DIR}/OpENer.cmake )
 #######################################
 # Platform switches                   #
 #######################################
-set( OpENer_KNOWN_PLATFORMS "POSIX" "WIN32" "LM3S8962" )
+set( OpENer_KNOWN_PLATFORMS "POSIX" "WIN32" )
 
 set( OpENer_PLATFORM CACHE STRINGS "Platform OpENer will be built for" )
 set_property(CACHE OpENer_PLATFORM PROPERTY STRINGS ${OpENer_KNOWN_PLATFORMS} )

+ 0 - 17
source/buildsupport/LM3S8962/OpENer_PLATFORM_INCLUDES.cmake

@@ -1,17 +0,0 @@
-macro(opener_platform_spec)
-  set( LM3S8962_CONTRIB_DIR "" CACHE PATH "Contrib folder of the used LM3S0862 board")
-  include_directories(${PORTS_SRC_DIR}/${OpENer_PLATFORM} 
-			${PORTS_SRC_DIR}/${OpENer_PLATFORM}/sample_application 
-			${LM3S8962_CONTRIB_DIR}
-			${LM3S8962_CONTRIB_DIR}/utils 
-			${LM3S8962_CONTRIB_DIR}/boards/rdk-bldc/qs-bldc/
-			${LM3S8962_CONTRIB_DIR}/boards/ek-lm3s8962
-			${LM3S8962_CONTRIB_DIR}/boards/ek-lm3s8962/enet_lwip/
-			${LM3S8962_CONTRIB_DIR}/third_party/lwip-1.3.2/src/include
-			${LM3S8962_CONTRIB_DIR}/third_party/lwip-1.3.2/ports/stellaris/include/
-			${LM3S8962_CONTRIB_DIR}/third_party/lwip-1.3.2/src/include/ipv4/
-			${LM3S8962_CONTRIB_DIR}/inc/)
-  set( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -ansi -std=c99 -mfpu=fpv4-sp-d16 -DGCC_ARMCM3_LM3S102 -Dgcc -DEIP_DEBUG=0" )
-  set( PLATFORM_LINKER_FLAGS "-Wl,--no-gc-sections -nostartfiles" )
-endmacro(opener_platform_spec)
-

+ 0 - 41
source/src/ports/LM3S8962/CMakeLists.txt

@@ -1,41 +0,0 @@
-add_subdirectory(sample_application)
-
-#######################################
-# Platform specific options           #
-#######################################
-set( USE_STATIC_IP OFF CACHE BOOL "Use the static IP defined in main.c" )
-
-if( USE_STATIC_IP )
-  add_definitions( -DuseStaticIP=1 )
-else( USE_STATIC_IP )
-  add_definitions( -DuseStaticIP=0 )
-endif( USE_STATIC_IP )
-
-set( NEWLIB_SRC "" CACHE PATH "Path to NewLib source directory" )
-
-set( PLATFORM_SPEC_SRC networkhandler.c basiccip.c flashmgr.c stubs.c startup_gcc.c )
-set( SBRK_SRC ${NEWLIB_SRC}/libgloss/libnosys/sbrk.c)
-
-add_library(sbrk ${SBRK_SRC} )
-
-#######################################
-# Add common includes                 #
-#######################################
-opener_common_includes()
-
-#######################################
-# Add platform-specific includes      #
-#######################################
-opener_platform_support("INCLUDES")
-
-include_directories(${CIP_ELECTRICAL_ENERGY_INCLUDE})
-set (PLATFORMLIBNAME ${OpENer_PLATFORM}PLATFORM)
-
-link_directories( ${LM3S8962_CONTRIB_DIR}/driverlib/gcc-cm3 )
-
-add_library( ${PLATFORMLIBNAME} ${PLATFORM_SPEC_SRC} )
-
-add_executable( OpENer ${LM3S8962_CONTRIB_DIR}/utils/lwiplib.c )
-
-target_link_libraries( OpENer SAMPLE_APP CIP ENET_ENCAP Utils ${PLATFORMLIBNAME} ${PLATFORM_SPEC_LIBS} )
-target_link_libraries( OpENer ${OpENer_ADD_CIP_OBJECTS} ${PLATFORM_LINKER_FLAGS} driver-cm3 m gcc c sbrk "-T ${CMAKE_CURRENT_SOURCE_DIR}/stellaris.ld")

+ 0 - 69
source/src/ports/LM3S8962/README

@@ -1,69 +0,0 @@
-README for the usage of OpENer with a LM3S8962 kit:
-
-Depending on which eval kit you may have please install the kit
-
-For example the eval kits for the Luminary/Texas Instruments(R)
-LM3S8962 eval kit (display board or brushless DC boards) can 
-be found here:
-	http://www.ti.com/tool/sw-ek-lm3s8962
-	http://www.ti.com/tool/sw-rdk-bldc
-
-This port uses the MentorGraphics(R) Code Sourcery Lite ARM-NONE-EABI toolchain
- which can be found here: 
-http://www.mentor.com/embedded-software/sourcery-tools/sourcery-codebench/overview
-
-On Debian 7+ you need to install ia32-libs before you can install the
-MentorGraphics(R) Code Sourcery Lite ARM-NONE-EABI toolchain. This manual can 
-also be found at the MentorGraphics(R) website:
-
-To install the ia32-libs enter the following commands, which must be executed
-as root:
-
-  dpkg --add-architecture i386
-  apt-get update
-  apt-get install ia32-libs ia32-libs-gtk
-
-This part was also stated in the manual at MentorGraphics(R) but didn't work
-for me, but I was able to install the toolchain anyhow
-
-  wget https://sourcery.mentor.com/GNUToolchain/kbattach150/getlibs-all.deb
-  sudo dpkg -i getlibs-all.deb
-  sudo getlibs -p xulrunner-1.9.2
-  export MOZILLA_FIVE_HOME=/usr/lib32/xulrunner-1.9.2.X
-
-In addition the _sbrk function must be provided. An _sbrk implementation can
-be found in newlib/libgloss/libnosys. The CMake script allows to enter the path
-to the newlib source. The newlib source can be found at:
-  https://sourceware.org/newlib/
-
-If you are using newlib you have to add a user heap section to your linker 
-script like the one provided here:
-
-	/* User_heap_stack section, used to check that there is enough RAM 
-	left */
-	  ._user_heap_stack :
-	  {
-	    . = ALIGN(4);
-	    PROVIDE ( end = . );
-	    PROVIDE ( _end = . );
-	    _heap_start_ = .;
-	    . = . + _Min_Heap_Size;
-	    _heap_end_ = .;
-	    _stack_start_ = .;
-	    . = . + _Min_Stack_Size;
-	    _stack_end_ = .;
-	    . = ALIGN(4);
-	  } > SRAM 
-
-Alternatively, the myLib provided on the CD of the board can be used 
-instead of the newLib and the add-on to the linker script.
-
-Unfortunatly, the myLib isn't provided in the offical download (at the time I 
-was looking it up it was SW-EK-LM3S8962-10636) of the evaluation kit at the 
-Texas Instruments(R) homepage.
-
-Last, but not least, you place the your startup_gcc.c and linker script in the 
-opener/source/src/ports/LM3S8962 directory.
-
-If something in this README isn't clear please put your question here:
-  https://github.com/EIPStackGroup/OpENer

+ 0 - 33
source/src/ports/LM3S8962/archnw.h

@@ -1,33 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, Rockwell Automation, Inc.
- * All rights reserved.
- *
- ******************************************************************************/
-
-#ifndef ARCHNW_H_
-#define ARCHNW_H_
-
-#include "lwiplib.h"
-
-extern void *mycalloc(unsigned);
-#define cip_calloc(x,y) mycalloc((unsigned)((x)*(y)))
-
-#define INLINE inline
-
-#define SOCKET_ERROR -1
-
-#define TIMERTICK 10 /* time between calls of manageConnections() in Milliseconds */
-
-// define the socket address structure -- it is different between Berkley sockets and LWIP
-
-typedef unsigned short int sa_family_t;
-typedef unsigned short int in_port_t;
-typedef unsigned int in_addr_t;
-
-#define PF_INET         2					// protocol family
-#define AF_INET         PF_INET					// address family
-#define SOCK_DGRAM	2
-#define SHUT_RDWR	2
-#define INADDR_ANY	0
-
-#endif /*ARCHNW_H_*/

+ 0 - 137
source/src/ports/LM3S8962/basiccip.c

@@ -1,137 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, Rockwell Automation, Inc.
- * All rights reserved. 
- *
- ******************************************************************************/
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-
-#include "networkhandler.h"
-#include "opener_api.h"
-#include "cipcommon.h"
-#include "trace.h"
-
-#define DEMO_APP_INPUT_ASSEMBLY_NUM                0x301
-#define DEMO_APP_OUTPUT_ASSEMBLY_NUM               0x302
-#define DEMO_APP_CONFIG_ASSEMBLY_NUM               0x303
-#define DEMO_APP_HEARBEAT_INPUT_ONLY_ASSEMBLY_NUM  0x304
-#define DEMO_APP_HEARBEAT_LISTEN_ONLY_ASSEMBLY_NUM 0x305
-#define DEMO_APP_EXPLICT_ASSEMBLY_NUM              0x306
-
-/* global variables for demo application (4 assembly data fields) */
-EipUint8 g_assemblydata301[32]; /* Input */
-EipUint8 g_assemblydata302[32]; /* Output */
-EipUint8 g_assemblydata303[10]; /* Config */
-EipUint8 g_assemblydata306[32]; /* Explicit */
-
-extern int newfd;
-
-EipStatus ApplicationInitialization(void) {
-//  CIP_Motion_Init();
-
-  /* create 3 assembly object instances*/
-  /*INPUT*/
-  CreateAssemblyObject(DEMO_APP_INPUT_ASSEMBLY_NUM, &g_assemblydata301[0],
-                       sizeof(g_assemblydata301));
-
-  /*OUTPUT*/
-  CreateAssemblyObject(DEMO_APP_OUTPUT_ASSEMBLY_NUM, &g_assemblydata302[0],
-                       sizeof(g_assemblydata302));
-
-  /*CONFIG*/
-  CreateAssemblyObject(DEMO_APP_CONFIG_ASSEMBLY_NUM, &g_assemblydata303[0],
-                       sizeof(g_assemblydata303));
-
-  /*Heart-beat output assembly for Input only connections */
-  CreateAssemblyObject(DEMO_APP_HEARBEAT_INPUT_ONLY_ASSEMBLY_NUM, 0, 0);
-
-  /*Heart-beat output assembly for Listen only connections */
-  CreateAssemblyObject(DEMO_APP_HEARBEAT_LISTEN_ONLY_ASSEMBLY_NUM, 0, 0);
-
-  /* assembly for explicit messaging */
-  CreateAssemblyObject(DEMO_APP_EXPLICT_ASSEMBLY_NUM, &g_assemblydata306[0],
-                       sizeof(g_assemblydata306));
-
-  ConfigureExclusiveOwnerConnectionPoint(0, DEMO_APP_OUTPUT_ASSEMBLY_NUM,
-                                         DEMO_APP_INPUT_ASSEMBLY_NUM,
-                                         DEMO_APP_CONFIG_ASSEMBLY_NUM);
-  ConfigureInputOnlyConnectionPoint(0,
-                                    DEMO_APP_HEARBEAT_INPUT_ONLY_ASSEMBLY_NUM,
-                                    DEMO_APP_INPUT_ASSEMBLY_NUM,
-                                    DEMO_APP_CONFIG_ASSEMBLY_NUM);
-  ConfigureListenOnlyConnectionPoint(0,
-                                     DEMO_APP_HEARBEAT_LISTEN_ONLY_ASSEMBLY_NUM,
-                                     DEMO_APP_INPUT_ASSEMBLY_NUM,
-                                     DEMO_APP_CONFIG_ASSEMBLY_NUM);
-
-  return EIP_OK;
-}
-
-void CheckIoConnectionEvent(unsigned int pa_unOutputAssembly,
-                       unsigned int pa_unInputAssembly,
-                       EIOConnectionEvent pa_eIOConnectionEvent) {
-  /* maintain a correct output state according to the connection state*/
-
-  (void) pa_unOutputAssembly; /* suppress compiler warning */
-  pa_unInputAssembly = pa_unInputAssembly; /* suppress compiler warning */
-  pa_eIOConnectionEvent = pa_eIOConnectionEvent; /* suppress compiler warning */
-}
-
-EipStatus AfterAssemblyDataReceived(CipInstance *pa_pstInstance) {
-  /*handle the data received e.g., update outputs of the device */
-
-  if (pa_pstInstance->instance_number == DEMO_APP_OUTPUT_ASSEMBLY_NUM) {
-    /* Data for the output assembly has been received.
-     * Mirror it to the inputs */
-    memcpy(&g_assemblydata301[0], &g_assemblydata302[0],
-           sizeof(g_assemblydata301));
-  } else if (pa_pstInstance->instance_number == DEMO_APP_EXPLICT_ASSEMBLY_NUM) {
-    /* do something interesting with the new data from
-     * the explicit set-data-attribute message */
-  }
-
-  return EIP_OK;
-}
-
-EipBool8 BeforeAssemblyDataSend(CipInstance *pa_pstInstance) {
-  /*update data to be sent e.g., read inputs of the device */
-  /*In this sample app we mirror the data from out to inputs on data receive
-   * therefore we need nothing to do here. Just return true to inform that
-   * the data is new.
-   */
-
-  if (pa_pstInstance->instance_number == DEMO_APP_EXPLICT_ASSEMBLY_NUM) {
-    /* do something interesting with the existing data
-     * for the explicit get-data-attribute message */
-  }
-  return true;
-}
-
-EipStatus ResetDevice(void) {
-  /* add reset code here*/
-  return EIP_OK;
-}
-
-EipStatus ResetDeviceToInitialConfiguration(void) {
-  /*rest the parameters and than perform device reset*/
-  return EIP_OK;
-}
-
-void *
-CipCalloc(unsigned pa_nNumberOfElements, unsigned pa_nSizeOfElement) {
-  return mem_calloc(pa_nNumberOfElements, pa_nSizeOfElement);
-}
-
-void CipFree(void *pa_poData) {
-  mem_free(pa_poData);
-}
-
-void RunIdleChanged(EipUint32 pa_nRunIdleValue) {
-  (void) pa_nRunIdleValue;
-}
-
-void HandleApplication(void) {
-  /* check if application needs to trigger an connection */
-}
-

+ 0 - 9
source/src/ports/LM3S8962/config.h

@@ -1,9 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, Rockwell Automation, Inc.
- * All rights reserved. 
- *
- ******************************************************************************/
-
-/*******************************************************************************
- * Empty config.h file for _sbrk in newlib/libgloss/libnosys
- ******************************************************************************/

+ 0 - 125
source/src/ports/LM3S8962/flashmgr.c

@@ -1,125 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, Rockwell Automation, Inc.
- * All rights reserved.
- *
- ******************************************************************************/
-
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-#include <stdlib.h>
-
-#include "hw_memmap.h"
-#include "hw_types.h"
-#include "driverlib/flash.h"
-#include "driverlib/gpio.h"
-#include "lwiplib.h"
-
-/*
- * This flash manager is rudimentary. It does wear leveling by allocating small chunks at a time.
- * When a new parameter block is to be written the old one is erased by writing zeros to it. When
- * there is no more space in the 1K chunk for a new parameter block the entire chunk is erased. 
- *
- * assumptions:
- *   -- erased FLASH is all ones
- *   -- bits in individual words can be written to zero
- *   -- a word that is part ones and part zeros can be written to all zeros
- *   -- to get any bits changed back to ones the entire chunk has to be erased
- * 
- * A parameter block starts with a one word size field. The size indicates the size of the following data.
- * If the size field is zero, the block is erased. 
- * 
- * A chunk of flash can be in one of three states:
- *   -- erased (all ones)
- *   -- data (starts with a size word that is not 0 or 0xffffffff
- *   -- zeroed (all zeros)
- * 
- */
-
-// This flash manger only supports one parameter block at a time.
-// It does not support multiple block types, or multiple instances of blocks.
-
-#define FLASHBASE ((unsigned long *)(255*1024))			// parameter sector is the last 1024 byte chunk of the program flash
-#define FLASHEND ((unsigned long *)(256*1024))
-#define CHUNKSIZE 1024
-static const int erasedFlashField = 0xffffffff;
-
-// erase everything in the parameters block
-static void eraseAllParameters(void) {
-  FlashErase((unsigned long) FLASHBASE);
-}
-
-// find the parameter block
-// returns the address of the parameter block, or zero if not found
-
-unsigned long* findNextEmptyParameterBlock(void) {
-  unsigned long* currentFlashAddress = FLASHBASE;
-  unsigned long* const noSpaceLeft = 0;
-
-  while (currentFlashAddress < FLASHEND) {
-    if (0 == *currentFlashAddress)
-      ++currentFlashAddress;
-    else if (erasedFlashField == *currentFlashAddress)
-      return noSpaceLeft;
-    else
-      return currentFlashAddress;
-  }
-  return noSpaceLeft;
-}
-
-// verify that the block to be written is erased
-static int parameterBlockIsEmpty(unsigned long *data,  // pointer to are to be checked
-    int dataSize)  // sizeof(struct)
-{
-  int const isNotEmpty = 0;
-  int const isEmpty = 1;
-  while (dataSize > 0) {
-    if (*data++ != erasedFlashField)
-      return isNotEmpty;
-    dataSize -= 4;
-  }
-  return isEmpty;
-}
-
-// write a new parameter block
-void writeParameter(unsigned long *data,  // pointer to struct to be saved
-    int dataSize)  // sizeof(struct)
-{
-  unsigned long *currentParameterBlock = findNextEmptyParameterBlock();  // find the current parameter block;
-  unsigned long zero = 0;
-
-  if (currentParameterBlock)  // if found, zero it
-  {
-    int lengthToBeErased = *currentParameterBlock + 4;  // calc dataSize of region to be erased
-
-    if (currentParameterBlock + lengthToBeErased / 4 <= FLASHEND)  // if properly formatted, zero the current block
-    {
-      while (lengthToBeErased > 0)  //   for each word
-      {
-        FlashProgram(&zero, (unsigned long) currentParameterBlock, 4);  // zero one word
-        currentParameterBlock++;  //     advance to next word
-        lengthToBeErased -= 4;  //     dec dataSize
-      }
-    } else  // else flash is corrupt -- erase it all
-    {
-      eraseAllParameters();
-      currentParameterBlock = FLASHBASE;
-    }
-  }
-
-  // at this point p should point to useable erased flash
-
-  // currentParameterBlock now points to the first unerased word
-
-  if (currentParameterBlock + dataSize / 4 > FLASHEND  // if flash is full
-  || !parameterBlockIsEmpty(currentParameterBlock, dataSize))  // or not properly erased
-                            {
-    eraseAllParameters();  // erase the entire block
-    currentParameterBlock = FLASHBASE;  // start from the beginning
-  }
-
-  FlashProgram((unsigned long *) &dataSize,
-               (unsigned long) currentParameterBlock, 4);  // program the length
-  FlashProgram(data, (unsigned long) (currentParameterBlock + 1), dataSize);  // program the data
-}
-

+ 0 - 8
source/src/ports/LM3S8962/flashmgr.h

@@ -1,8 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, Rockwell Automation, Inc.
- * All rights reserved.
- *
- ******************************************************************************/
-
-extern unsigned long *findNextEmptyParameterBlock(void);
-extern void writeParameter(unsigned long *data, int dataSize);

+ 0 - 388
source/src/ports/LM3S8962/networkhandler.c

@@ -1,388 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, Rockwell Automation, Inc.
- * All rights reserved.
- *
- ******************************************************************************/
-
-#include <string.h>
-#include <stdlib.h>
-#include <errno.h>
-#include <assert.h>
-
-#include "networkhandler.h"
-#include "cipcommon.h"
-#include "cipconnectionmanager.h"
-
-#include "encap.h"
-#include <trace.h>
-
-#define EIP_VERBOSE	2
-#define EIP_VVERBOSE	3
-#define EIP_TERSE	1
-
-#define MAX_RECEIVE_SIZE 512
-#define MAX_SEND_SIZE 512
-
-static EipUint8 rxbuf[MAX_RECEIVE_SIZE];  // this appears to be the EIP command buffer
-EipUint8 eip_reply_buf[MAX_SEND_SIZE];  // this appears to be the EthernetIP reply buffer
-
-extern void
-dump(unsigned char *p, int size);
-
-static struct tcp_pcb *TCPlistener;
-static struct udp_pcb *UDPlistener;
-
-#define MAX_NO_OF_TCP_SOCKETS 10
-
-struct sockaddr_in my_addr;
-
-struct tcp_pcb *g_pstCurrentTCP_PCB = NULL;
-
-// UDP UNSOLICITED DATA RECEIVE CALLBACK
-// The callback function is responsible for deallocating the pbuf.
-
-void udp_unsolicited_receive_callback(void * arg,  // arg specified when the callback was registered
-    struct udp_pcb * pcb,  // pcb handling the receive
-    struct pbuf * p,  // the packet
-    struct ip_addr * addr,  // source IP address
-    u16_t port)  // source UDP port number
-{
-  EipUint8 *rxp;  // pointer into the receive buf
-  int rxlen;  // size of the received message
-  int bytesleft;  // bytes left (allows for multiple messages per packet)
-  int replylen;
-  err_t status;
-  struct pbuf * r;  // reply buffer
-  struct sockaddr_in stFrom;
-
-  assert(p->tot_len <= sizeof(rxbuf));  // TODO this needs to be hardened
-  pbuf_copy_partial(p, rxbuf, sizeof(rxbuf), 0);  // copy the packet into a contiguous receive buffer
-  rxlen = p->tot_len;  // size of the received message
-  pbuf_free(p);  // we no longer need the packet buffer
-
-  if (EIP_DEBUG > EIP_VVERBOSE) {
-    OPENER_TRACE_INFO("Data received on UDP:\n");
-    dump(rxbuf, rxlen);
-  }
-
-  rxp = &rxbuf[0];  // point to the start of the message
-  do {
-    stFrom.sin_family = AF_INET;
-    stFrom.sin_port = port;
-    stFrom.sin_addr.s_addr = addr->addr;
-    memset(&stFrom.sin_zero, 0, sizeof(stFrom.sin_zero));
-
-    replylen = HandleReceivedExplictUdpData((unsigned) pcb,  // bogus a socket fd (use the pcb address cast to an int)
-        &stFrom, rxp, rxlen, &bytesleft);
-
-    rxp += rxlen - bytesleft;  // bump the buffer pointer by the amount of data that was eaten
-    rxlen = bytesleft;  // dec the data size by the same amount
-
-    if (replylen > 0) {
-      if (EIP_DEBUG >= EIP_VVERBOSE) {
-        OPENER_TRACE_INFO("reply sent:\n");
-        dump(eip_reply_buf, replylen);
-      }
-
-      r = pbuf_alloc(PBUF_TRANSPORT, 0, PBUF_REF);
-      assert(r != 0);  // TODO harden
-      //r->payload = &eip_reply_buf[0];
-      r->payload = &rxbuf[0];
-      r->len = r->tot_len = replylen;
-      status = udp_sendto(pcb, r, (struct ip_addr *) &addr->addr, port);
-      assert(status == 0);  // TODO check for non-fatal status response?
-      pbuf_free(r);  // reference counting makes sure the header does not get freed prematurely, but what about the replybuf?
-    }
-  } while (rxlen > 0);
-}
-
-// UDP CONNECTED DATA CALLBACK
-
-void udp_registered_receive_callback(void * arg,  // arg specified when the callback was registered
-    struct udp_pcb * pcb,  // pcb handling the receive
-    struct pbuf * pbuf,  // the packet
-    struct ip_addr * addr,  // source IP address
-    u16_t port)  // source UDP port number
-{
-  EipUint8 *rxp;  // pointer into the receive buf
-  int rxlen;  // size of the received message
-  struct sockaddr_in stFrom;
-
-  //assert(pbuf->len == pbuf->tot_len);
-  assert(pbuf->tot_len <= MAX_RECEIVE_SIZE);// TODO this needs to be hardened
-  rxlen = pbuf_copy_partial(pbuf, rxbuf, MAX_RECEIVE_SIZE, 0);  // copy the packet into a contiguous receive buffer
-  //assert(rxlen == pbuf->tot_len);
-  rxp = &rxbuf[0];  // point to the start of the message
-  pbuf_free(pbuf);  // we no longer need the packet buffer
-
-  if (rxlen == 0) {
-    OPENER_TRACE_ERR("connection closed by client\n");
-    udp_disconnect(pcb); /* close socket */
-    udp_remove(pcb);
-    return;
-  }
-  if (rxlen <= 0) {
-    OPENER_TRACE_ERR("networkhandler: error on recv");
-    udp_disconnect(pcb); /* close socket */
-    udp_remove(pcb);
-    return;
-  }
-
-  stFrom.sin_family = AF_INET;
-  stFrom.sin_port = port;
-  stFrom.sin_addr.s_addr = addr->addr;
-  memset(&stFrom.sin_zero, 0, sizeof(stFrom.sin_zero));
-
-  HandleReceivedConnectedData(rxbuf, rxlen, &stFrom);
-}
-
-// TCP DATA SENT CALLBACK
-
-err_t tcp_sent_callback(void * arg, struct tcp_pcb * tpcb, u16_t len) {
-  // TODO unlock the reply buf?
-
-  return ERR_OK;
-}
-
-// TCP DATA RECEIVE CALLBACK
-
-err_t tcp_receive_callback(void * arg,  // arg specified earlier
-    struct tcp_pcb *pcb,  // pcb that is delivering the data
-    struct pbuf *pbuf,  // the packet
-    err_t err)  // TCP uses this to tell us what's happening to the connection perhaps?
-{
-  EipUint8 *rxp;
-  int rxlen;
-  int bytesread;
-  int bytesleft;
-  int replylen;
-  int txspace;
-  int rxoff = 0;
-  err_t status;
-
-  if (err != ERR_OK)
-    return err;  // don't try to receive if error
-
-  if (pbuf == 0)  // check if connection is closing
-      {
-    tcp_close(pcb);  // close out end
-    return ERR_OK;
-  }
-
-  while (rxoff < pbuf->tot_len) {
-    rxlen = pbuf_copy_partial(pbuf, rxbuf, 4, rxoff);  // copy the first four words into the contiguous receive buffer
-    assert(rxlen == 4);  //need at least four bytes of the header at this point
-    rxp = &rxbuf[2];  // at this place EIP stores the data length
-    rxlen = GetIntFromMessage(&rxp) + ENCAPSULATION_HEADER_LENGTH - 4;  // -4 is for the 4 bytes we have already read
-    // (NOTE this advances the buffer pointer)
-
-    if (rxlen + 4 > MAX_RECEIVE_SIZE) {  //TODO can this be handled in a better way?
-      OPENER_TRACE_ERR("too large packet received will be ignored\n");  // this may corrupt the connection ???
-      return EIP_ERROR;
-    }
-
-    bytesread = pbuf_copy_partial(pbuf, &rxbuf[4], rxlen, rxoff + 4);  // copy the rest of the message into the contiguous receive buffer
-    assert(bytesread == rxlen);
-    rxlen += 4;
-    rxoff += rxlen;
-    tcp_recved(pcb, rxlen);  // tell TCP we have received the data
-
-    if (EIP_DEBUG >= EIP_VVERBOSE) {
-      OPENER_TRACE_INFO("Data received on tcp:\n");
-      dump(rxbuf, rxlen);
-    }
-
-    g_pstCurrentTCP_PCB = pcb;
-    replylen = HandleReceivedExplictTcpData((unsigned) pcb,  // bogus a socket fd (use the pcb address cast to an int) -- I do not think this is used anywhere
-        rxbuf, rxlen, &bytesleft);
-    g_pstCurrentTCP_PCB = NULL;
-    assert(bytesleft == 0);
-
-    if (replylen > 0) {
-      if (EIP_DEBUG >= EIP_VVERBOSE) {
-        OPENER_TRACE_INFO("reply sent:\n");
-        dump(eip_reply_buf, replylen);
-      }
-
-      txspace = tcp_sndbuf(pcb);  // see how much data can be sent
-      assert(txspace >= replylen);  // TODO harden this
-
-      status = tcp_write(pcb, rxbuf, replylen, TCP_WRITE_FLAG_COPY);  // TODO need to examine serial reuse of the reply buf
-      if (status != ERR_OK) {
-        OPENER_TRACE_ERR("TCP response was not sent OK: %d\n", status);
-      }
-      tcp_output(pcb);  // push the data out
-    }
-  }
-
-  pbuf_free(pbuf);  // we no longer need the packet buffer
-
-  return ERR_OK;
-}
-
-// TCP CONNECTION ACCEPT CALLBACK
-
-err_t tcp_connection_accept_callback(void *arg,  // arg registered for this listener (ignored in this case)
-    struct tcp_pcb *newpcb,  // pcb for new tcp connection
-    err_t err) {
-  OPENER_TRACE_INFO("networkhandler: new TCP connection\n");
-
-  tcp_accepted(TCPlistener);  // tell the listener that the call was accepted
-
-  tcp_recv(newpcb, tcp_receive_callback);  // set the callback for received data on the new connection
-  tcp_sent(newpcb, tcp_sent_callback);  // set the callback for transmitted data on the new connection
-
-  return ERR_OK;
-}
-
-/* INT8 Start_NetworkHandler()
- * 	start a TCP listening socket, accept connections, receive data in select loop, call manageConnections periodicaly.
- * 	return status
- * 			-1 .. error
- */
-
-EipStatus Start_NetworkHandler() {
-  err_t status;
-
-  my_addr.sin_family = AF_INET;
-  my_addr.sin_port = htons(kOpenerEthernetPort);
-  my_addr.sin_addr.s_addr = htonl(INADDR_ANY);
-  memset(&my_addr.sin_zero, 0, sizeof(my_addr.sin_zero));
-
-  /* create a new TCP listener socket */
-  TCPlistener = tcp_new();
-  assert(TCPlistener != 0);
-  status = tcp_bind(TCPlistener, INADDR_ANY, kOpenerEthernetPort);
-  assert(status == 0);
-  TCPlistener = tcp_listen(TCPlistener);
-  assert(TCPlistener != 0);
-  tcp_accept(TCPlistener, tcp_connection_accept_callback);
-
-  /* create a new UDP listener socket */
-  UDPlistener = udp_new();
-  assert(UDPlistener != 0);
-  udp_bind(UDPlistener, INADDR_ANY, kOpenerEthernetPort);
-  udp_recv(UDPlistener, udp_unsolicited_receive_callback, 0);  // set the callback
-
-  return EIP_OK;
-}
-
-static elapsedtime = 0;
-
-// this gets called every 10 ms from the lwiptick handler, which is called from an Ethernet controller interrupt (SYSTICKHZ = 100)
-void CIPtick(int delta)  // time since last tick in ms, probably 10
-{
-  /* call manage_connections() in connection manager every TIMERTICK ms */
-  elapsedtime += delta;
-  if (elapsedtime >= TIMERTICK) {
-    ManageConnections();
-    elapsedtime = 0;
-  }
-}
-
-/* INT8 registerCallbackFunc(int sockfd, struct sockaddr_in pa_addr, S_CIP_Class *p_stObject, INT8 (*pt2func)(S_CIP_Class *p_stObject, INT8 *data, UINT16 datalength))
- *  register a callbackfuntion with the corresponding CIP object and socket handle.
- * 	sockfd		sockethandle
- * 	pa_addr		remote address for sending UDP packets
- * 	p_stObject	pointer to CIP object which is to be registered
- * 	(*pt2func)()	pointer to callbackfunktion which will be called if data arrive on sockfd
- *
- *	return status	0 .. success
- * 			-1 .. error
- */
-
-EipStatus registerCallbackFunc(int sockfd, struct sockaddr_in *pa_addr,
-                               CipInstance *pa_pstInstance,
-                               CipServiceFunction pa_ptfuncReceiveData) {
-  return EIP_OK;
-}
-
-EipStatus unregisterCallbackFunc(CipInstance * pa_pstInstance) {
-  return EIP_OK;
-}
-
-/* INT8 sendUDPData(struct sockaddr_in pa_addr, int sockfd, INT8 *pa_data, UINT16 pa_datalength)
- * send udp datagram to pa_addr on socket sockfd.
- * 	 pa_addr	remote address
- * 	 sockfd		sockethandle
- * 	 pa_data	pointer to data which will be sent
- * 	 pa_datalength	length of data ind pa_data
- *
- * return status	0 .. success
- * 			-1 .. error
- */
-
-EipStatus SendUdpData(struct sockaddr_in *pa_addr, int sockfd,
-                      EipUint8 *pa_data, EipUint16 pa_datalength) {
-  struct pbuf *r;
-  err_t status;
-  struct udp_pcb *pcb;
-
-  pcb = (struct udp_pcb *) sockfd;
-  r = pbuf_alloc(PBUF_TRANSPORT, 0, PBUF_REF);
-  assert(r != 0);  // TODO harden
-  r->payload = pa_data;
-  r->len = r->tot_len = pa_datalength;
-  status = udp_sendto(pcb, r, (struct ip_addr *) &pa_addr->sin_addr,
-                      htons(pa_addr->sin_port));
-  assert(status == 0);  // TODO check for non-fatal status response?
-  pbuf_free(r);  // reference counting make sure the header does not get freed prematurely, but what about the replybuf?
-
-  return EIP_OK;
-}
-
-// create a new UDP socket for the connection manager
-// returns the fd if successful, else -1
-
-int CreateUdpSocket(int pa_nDirection,  // direction: CONSUMING or PRODUCING
-    struct sockaddr_in *pa_pstAddr)  // bind address, used for producing only
-{
-  struct udp_pcb *pcb;
-
-  /* create a new UDP socket */
-  pcb = udp_new();
-  if (pcb == 0) {
-    OPENER_TRACE_ERR("networkhandler: cannot create UDP socket\n");
-    return -1;
-  }
-  OPENER_TRACE_INFO("networkhandler: created UDP socket %x\n", pcb);
-
-  /* check if it is sending or receiving */
-  if (pa_nDirection == CONSUMING) { /* bind is only for consuming necessary */
-    struct ip_addr addr;
-
-    addr.addr = htonl(pa_pstAddr->sin_addr.s_addr);
-    if (udp_bind(pcb, &addr, htons(pa_pstAddr->sin_port)) != ERR_OK) {
-      OPENER_TRACE_INFO("networkhandler: error on bind udp\n");
-      return -1;
-    }
-
-    OPENER_TRACE_INFO("networkhandler: bind UDP socket %08x port %d\n", pcb,
-                      pa_pstAddr->sin_port);
-    udp_recv(pcb, udp_registered_receive_callback, 0);  // set the callback
-  }
-
-  if ((pa_nDirection == CONSUMING) || (0 == pa_pstAddr->sin_addr.s_addr)) {
-    /* store the originators address */
-    pa_pstAddr->sin_addr.s_addr = g_pstCurrentTCP_PCB->remote_ip.addr;
-  }
-
-  return (int) pcb;
-}
-
-void IApp_CloseSocket_udp(int fd) {
-  struct udp_pcb *pcb;
-
-  OPENER_TRACE_INFO("networkhandler: shutdown UDP socket %x\n", pcb);
-  pcb = (struct udp_pcb *) fd;
-  udp_remove(pcb);
-}
-
-void IApp_CloseSocket_tcp(int fd) {
-  struct tcp_pcb *pcb;
-
-  OPENER_TRACE_INFO("networkhandler: shutdown TCP socket %x\n", pcb);
-  pcb = (struct tcp_pcb *) fd;
-  tcp_close(pcb);
-}
-

+ 0 - 17
source/src/ports/LM3S8962/networkhandler.h

@@ -1,17 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, Rockwell Automation, Inc.
- * All rights reserved. 
- *
- ******************************************************************************/
-#ifndef NETWORKHANDLER_H_
-#define NETWORKHANDLER_H_
-
-#include "typedefs.h"
-
-/*! Start a TCP/UDP listening socket, accept connections, receive data in select loop, call manageConnections periodically.
- *  @return status
- *          EIP_ERROR .. error
- */
-EipStatus Start_NetworkHandler(void);
-
-#endif /*NETWORKHANDLER_H_*/

+ 0 - 12
source/src/ports/LM3S8962/sample_application/CMakeLists.txt

@@ -1,12 +0,0 @@
-
-#######################################
-# Add common includes                 #
-#######################################
-opener_common_includes()
-
-#######################################
-# Add platform-specific includes      #
-#######################################
-opener_platform_support("INCLUDES")
-
-add_library( SAMPLE_APP main.c )

+ 0 - 316
source/src/ports/LM3S8962/sample_application/main.c

@@ -1,316 +0,0 @@
-// Scraps of this module were pulled from the following demo program:
-
-//*****************************************************************************
-//
-// enet_lwip.c - Sample WebServer Application using lwIP.
-//
-// Copyright (c) 2007-2008 Luminary Micro, Inc.  All rights reserved.
-// Software License Agreement
-//
-// Luminary Micro, Inc. (LMI) is supplying this software for use solely and
-// exclusively on LMI's micro controller products.
-//
-// The software is owned by LMI and/or its suppliers, and is protected under
-// applicable copyright laws.  All rights are reserved.  You may not combine
-// this software with "viral" open-source software in order to form a larger
-// program.  Any use in violation of the foregoing restrictions may subject
-// the user to criminal sanctions under applicable laws, as well as to civil
-// liability for the breach of the terms and conditions of this license.
-//
-// THIS SOFTWARE IS PROVIDED "AS IS".  NO WARRANTIES, WHETHER EXPRESS, IMPLIED
-// OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, IMPLIED WARRANTIES OF
-// MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE APPLY TO THIS SOFTWARE.
-// LMI SHALL NOT, IN ANY CIRCUMSTANCES, BE LIABLE FOR SPECIAL, INCIDENTAL, OR
-// CONSEQUENTIAL DAMAGES, FOR ANY REASON WHATSOEVER.
-//
-// This is part of revision 3618 of the EK-LM3S6965 Rev C Firmware Package.
-//
-//*****************************************************************************
-
-#include <stdio.h>
-#include <string.h>
-#include <assert.h>
-#include <stdlib.h>
-#include <math.h>
-
-#include "hw_ints.h"
-#include "hw_memmap.h"
-#include "hw_nvic.h"
-#include "hw_types.h"
-#include "driverlib/ethernet.h"
-#include "driverlib/flash.h"
-#include "driverlib/gpio.h"
-#include "driverlib/interrupt.h"
-#include "driverlib/sysctl.h"
-#include "driverlib/systick.h"
-#include "lwiplib.h"
-
-#include "flashmgr.h"
-#include "networkhandler.h"
-#include <opener_api.h>
-#include "cipcommon.h"
-#include "random.h"
-#include <trace.h>
-
-//define here instead of ptpd.h
-volatile unsigned long g_ulSystemTimeSecfunctiononds;
-volatile unsigned long g_ulSystemTimeNanoSeconds;
-
-// cast an int as a struct_inaddr (check the "inet_ntoa" man page -- it wants a struct_inaddr passed by value, not an int)
-// static IP-Address?
-//#define useStaticIP 1
-#define useStaticIP 0
-
-#ifndef useStaticIP
-#error "useStaticIP undefined"
-#endif
-
-struct parm {
-  int useStatic;  // 1 use static IP address, 0 use DHCP
-  unsigned long ip;  // my ip address
-  unsigned long nm;  // net mask
-  unsigned long gw;  // gateway ip address
-};
-
-//*****************************************************************************
-//
-// Defines for setting up the system clock.
-//
-//*****************************************************************************
-#define SYSTICKHZ               100
-#define SYSTICKMS               (1000 / SYSTICKHZ)
-#define SYSTICKUS               (1000000 / SYSTICKHZ)
-#define SYSTICKNS               (1000000000 / SYSTICKHZ)
-
-//*****************************************************************************
-//
-// Interrupt priority definitions.  The top 3 bits of these values are
-// significant with lower values indicating higher priority interrupts.
-//
-//*****************************************************************************
-#define SYSTICK_INT_PRIORITY    0xF0
-#define ETHERNET_INT_PRIORITY   0xC2
-
-//*****************************************************************************
-//
-// The error routine that is called if the driver library encounters an error.
-//
-//*****************************************************************************
-#ifdef DEBUG
-void
-__error__(char *pcFilename, unsigned long ulLine)
-{
-}
-#endif
-
-// change my IP address etc.
-void setCIPaddress(unsigned long addr,  // my IP address, in network order
-    unsigned long mask,  // netmask, in network order
-    unsigned long gw)  // gateway, in network order
-{
-  struct in_addr inAddr;
-  inAddr.s_addr = addr;
-  char acIPAddr[16];
-  strncpy(acIPAddr, inet_ntoa(inAddr), 16);
-  inAddr.s_addr = mask;
-  char acNetMask[16];
-  strncpy(acNetMask, inet_ntoa(inAddr), 16);
-  inAddr.s_addr = gw;
-  char acGW[16];
-  strncpy(acGW, inet_ntoa(inAddr), 16);
-
-  ConfigureNetworkInterface(acIPAddr, acNetMask, acGW);
-  ConfigureDomainName("test");
-  ConfigureHostName("karl");
-}
-
-// this gets called every 100 usec by the lwip timer handler
-void lwIPHostTimerHandler(void) {
-  static unsigned long ulLastIPAddress = 0;
-  unsigned long ulIPAddress;
-  unsigned long ulNetmask;
-  unsigned long ulGateway;
-
-  ulIPAddress = lwIPLocalIPAddrGet();
-
-  if (ulLastIPAddress != ulIPAddress) {
-    ulLastIPAddress = ulIPAddress;
-    ulNetmask = lwIPLocalNetMaskGet();
-    ulGateway = lwIPLocalGWAddrGet();
-    setCIPaddress(ulIPAddress, ulNetmask, ulGateway);
-  }
-}
-
-int main(void) {
-  int i;
-  unsigned long ulUser0, ulUser1;
-  unsigned char pucMACArray[8];
-
-  unsigned long ip, nm, gw;
-  int valid;
-
-  struct parm parm;
-  struct parm *p;
-  unsigned long *pl;
-
-  IntPriorityGroupingSet(4);
-
-  //
-  // Set the clocking to run directly from the crystal.
-  //
-  SysCtlClockSet(
-      SYSCTL_SYSDIV_1 | SYSCTL_USE_OSC | SYSCTL_OSC_MAIN | SYSCTL_XTAL_8MHZ);
-
-  SysCtlPeripheralEnable(SYSCTL_PERIPH_ETH);
-  SysCtlPeripheralReset(SYSCTL_PERIPH_ETH);
-
-  // Enable Port F for Ethernet LEDs.
-  //  LED0        Bit 3   Output
-  //  LED1        Bit 2   Output
-  //
-  SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOE);
-  SysCtlPeripheralEnable(SYSCTL_PERIPH_GPIOF);
-  GPIODirModeSet(GPIO_PORTF_BASE, GPIO_PIN_2 | GPIO_PIN_3, GPIO_DIR_MODE_HW);
-  GPIOPadConfigSet(GPIO_PORTF_BASE, GPIO_PIN_2 | GPIO_PIN_3, GPIO_STRENGTH_2MA,
-                   GPIO_PIN_TYPE_STD);
-
-  //
-  // Configure the GPIOs used to read the state of the on-board push buttons.
-  //
-  GPIOPinTypeGPIOInput(GPIO_PORTE_BASE,
-                       GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3);
-  GPIOPadConfigSet(GPIO_PORTE_BASE,
-                   GPIO_PIN_0 | GPIO_PIN_1 | GPIO_PIN_2 | GPIO_PIN_3,
-                   GPIO_STRENGTH_2MA, GPIO_PIN_TYPE_STD_WPU);
-  GPIOPinTypeGPIOInput(GPIO_PORTF_BASE, GPIO_PIN_1);
-  GPIOPadConfigSet(GPIO_PORTF_BASE, GPIO_PIN_1, GPIO_STRENGTH_2MA,
-                   GPIO_PIN_TYPE_STD_WPU);
-
-  // configure the user LED output
-  GPIOPinTypeGPIOOutput(GPIO_PORTF_BASE, GPIO_PIN_0);
-  GPIOPinWrite(GPIO_PORTF_BASE, GPIO_PIN_0, 0);
-
-  //
-  // Configure SysTick for a 100 Hz (10 ms) interrupt.
-  //
-  SysTickPeriodSet(SysCtlClockGet() / SYSTICKHZ);
-  SysTickEnable();
-  SysTickIntEnable();
-
-  //
-  // Enable processor interrupts.
-  //
-  IntMasterEnable();
-
-  //
-  // Configure the hardware MAC address for Ethernet Controller filtering of
-  // incoming packets.
-  //
-  // For the LM3S6965 Evaluation Kit, the MAC address will be stored in the
-  // non-volatile USER0 and USER1 registers.  These registers can be read
-  // using the FlashUserGet function, as illustrated below.
-  //
-  FlashUserGet(&ulUser0, &ulUser1);
-  if ((ulUser0 == 0xffffffff) || (ulUser1 == 0xffffffff)) {
-    //
-    // We should never get here.  This is an error if the MAC address has
-    // not been programmed into the device.  Exit the program.
-    //
-
-    while (1) {
-    }
-  }
-
-  //
-  // Convert the 24/24 split MAC address from NV ram into a 32/16 split MAC
-  // address needed to program the hardware registers, then program the MAC
-  // address into the Ethernet Controller registers.
-  //
-
-  pucMACArray[0] = ((ulUser0 >> 0) & 0xff);
-  pucMACArray[1] = ((ulUser0 >> 8) & 0xff);
-  pucMACArray[2] = ((ulUser0 >> 16) & 0xff);
-  pucMACArray[3] = ((ulUser1 >> 0) & 0xff);
-  pucMACArray[4] = ((ulUser1 >> 8) & 0xff);
-  pucMACArray[5] = ((ulUser1 >> 16) & 0xff);
-
-  //////////////////////////////////////////////////////////
-  // YOU MUST SET THESE TO VALID VALUES FOR YOUR LOCATION //
-  //////////////////////////////////////////////////////////
-  ConfigureMacAddress(pucMACArray);
-
-  //
-  // Initialze the lwIP library
-  //
-
-  pl = findNextEmptyParameterBlock();
-  p = (struct parm *) (pl + 1);
-
-  if (useStaticIP) {
-    OPENER_TRACE_INFO("using static IP address\n");
-
-    ip = 0x8083BAC9;  //128.130.200.201
-    nm = 0xFFFFFF00;
-    gw = 0x8083BA01;
-    valid = 7;
-    lwIPInit(pucMACArray, ip, nm, gw, IPADDR_USE_STATIC);
-  } else {
-    //
-    // Initialze the lwIP library, using DHCP.
-    //
-    OPENER_TRACE_INFO("using DHCP\n");
-    valid = 0;  //0
-    lwIPInit(pucMACArray, 0, 0, 0, IPADDR_USE_DHCP);
-  }
-
-  //change time-interval value for call of updateElMeasuringAndMeteringData
-  //in SysTickIntHandler-method to show/provide correct values (see line 370)
-
-  IntPrioritySet(INT_ETH, ETHERNET_INT_PRIORITY);
-  IntPrioritySet(FAULT_SYSTICK, SYSTICK_INT_PRIORITY);
-
-  /*for a real device the serial number should be unique per device */
-  SetDeviceSerialNumber(123456789);
-
-  /* Setup the CIP Layer */
-  CipStackInit(365);
-  IntMasterDisable();
-
-  IntMasterEnable();
-  Start_NetworkHandler();
-
-  // this is a simple command interpreter which reads from serial port 0
-  // it is used to set a static IP address
-  while (1) {
-
-  }
-}
-
-/* implement missing functions rand and srand */
-int _EXFUN( rand, (_VOID)) {
-  return NextXorShiftUInt32();
-}
-
-_VOID _EXFUN( srand, (unsigned __seed)) {
-  SetXorShiftSeed(__seed);
-}
-
-//*****************************************************************************
-//
-// The interrupt handler for the SysTick interrupt.
-// Entry here directly from the interrupt vector
-// This interrupt occurs once every 10 milliseconds
-//*****************************************************************************
-void SysTickIntHandler(void) {
-
-  //
-  // Update internal time and set PPS output, if needed.
-  //
-  g_ulSystemTimeNanoSeconds += SYSTICKNS;
-
-  //
-  // Call the lwIP timer handler.
-  //
-  lwIPTimer(SYSTICKMS);
-}
-

+ 0 - 182
source/src/ports/LM3S8962/sample_application/opener_user_conf.h

@@ -1,182 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, Rockwell Automation, Inc.
- * All rights reserved. 
- *
- ******************************************************************************/
-#ifndef OPENER_USER_CONF_H_
-#define OPENER_USER_CONF_H_
-
-/*! \file
- * \brief OpENer configuration setup
- * 
- * This file contains the general application specific configuration for OpENer.
- * 
- * Furthermore you have to specific platform specific network include files.
- * OpENer needs definitions for the following data-types
- * and functions:
- *    - struct sockaddr_in
- *    - AF_INET
- *    - INADDR_ANY
- *    - htons
- *    - ntohl
- *    - inet_addr
- */
-
-#include "lwiplib.h"
-#include "archnw.h"
-
-/* members are in network byte order */
-struct sockaddr_in {
-  u8_t sin_len;
-  u8_t sin_family;
-  u16_t sin_port;
-  struct in_addr sin_addr;
-  char sin_zero[8];
-};
-
-struct sockaddr {
-  u8_t sa_len;
-  u8_t sa_family;
-  char sa_data[14];
-};
-
-#ifndef socklen_t
-#define socklen_t u32_t
-#endif
-
-#define SOCK_STREAM     1
-#define  SOL_SOCKET  0xfff    /* options for socket level */
-#define  SO_BROADCAST   0x0020 /* Unimplemented: permit sending of broadcast msgs */
-
-/*! Identity configuration of the device */
-#define OPENER_DEVICE_VENDOR_ID           1
-#define OPENER_DEVICE_TYPE               43
-#define OPENER_DEVICE_PRODUCT_CODE      0x01
-#define OPENER_DEVICE_MAJOR_REVISION      1
-#define OPENER_DEVICE_MINOR_REVISION      2
-#define OPENER_DEVICE_NAME      "OpENer Energy"
-
-/*! Define the number of objects that may be used in connections
- *
- *  This number needs only to consider additional objects. Connections to
- *  the connection manager object as well as to the assembly object are supported
- *  in any case.
- */
-#define OPENER_CIP_NUM_APPLICATION_SPECIFIC_CONNECTABLE_OBJECTS 1
-
-/*! Define the number of supported explicit connections.
- *  According to ODVA's PUB 70 this number should be greater than 6.
- */
-#define OPENER_CIP_NUM_EXPLICIT_CONNS 6
-
-/*! Define the number of supported exclusive owner connections.
- *  Each of these connections has to be configured with the function
- *  void configureExclusiveOwnerConnectionPoint(unsigned int pa_unConnNum, unsigned int pa_unOutputAssembly, unsigned int pa_unInputAssembly, unsigned int pa_unConfigAssembly)
- *
- */
-#define OPENER_CIP_NUM_EXLUSIVE_OWNER_CONNS 1
-
-/*! Define the number of supported input only connections.
- *  Each of these connections has to be configured with the function
- *  void configureInputOnlyConnectionPoint(unsigned int pa_unConnNum, unsigned int pa_unOutputAssembly, unsigned int pa_unInputAssembly, unsigned int pa_unConfigAssembly)
- *
- */
-#define OPENER_CIP_NUM_INPUT_ONLY_CONNS 1
-
-/*! Define the number of supported input only connections per connection path
- */
-#define OPENER_CIP_NUM_INPUT_ONLY_CONNS_PER_CON_PATH 1
-
-/*! Define the number of supported listen only connections.
- *  Each of these connections has to be configured with the function
- *  void configureListenOnlyConnectionPoint(unsigned int pa_unConnNum, unsigned int pa_unOutputAssembly, unsigned int pa_unInputAssembly, unsigned int pa_unConfigAssembly)
- *
- */
-#define OPENER_CIP_NUM_LISTEN_ONLY_CONNS 1
-
-/*! Define the number of supported Listen only connections per connection path
- */
-#define OPENER_CIP_NUM_LISTEN_ONLY_CONNS_PER_CON_PATH   1
-
-/*! The number of bytes used for the buffer that will be used for generating any
- *  reply data of messages. There are two uses in OpENer:
- *    1. Explicit messages will use this buffer to store the data generated by the request
- *    2. I/O Connections will use this buffer for the produced data
- */
-#define OPENER_MESSAGE_DATA_REPLY_BUFFER 250
-
-/*! Number of sessions that can be handled at the same time
- */
-#define OPENER_NUMBER_OF_SUPPORTED_SESSIONS 4
-
-/*! The time in ms of the timer used in this implementations
- */
-#define OPENER_TIMER_TICK 10 
-
-/*! Define if RUN IDLE data is sent with consumed data
- */
-#define OPENER_CONSUMED_DATA_HAS_RUN_IDLE_HEADER 1
-
-/*! Define if RUN IDLE data is to be sent with produced data
- *
- * Per default we don't send run idle headers with produced data
- */
-#define OPENER_PRODUCED_DATA_HAS_RUN_IDLE_HEADER 0
-
-#ifdef OPENER_WITH_TRACES
-/* If we have tracing enabled provide print tracing macro */
-#include <stdio.h>
-
-#define LOG_TRACE(args...)  fprintf(stderr,args)
-
-/*#define PRINT_TRACE(args...)  fprintf(stderr,args);*/
-
-/*! A specialized assertion command that will log the assertion and block
- *  further execution in an while(1) loop.
- */
-#define OPENER_ASSERT(assertion) \
-    do { \
-      if(!(assertion)) { \
-        LOG_TRACE("Assertion \"%s\" failed: file \"%s\", line %d\n", #assertion, __FILE__, __LINE__); \
-        while(1){;} \
-      } \
-    } while(0)
-
-/* else use standard assert() */
-//#include <assert.h>
-//#include <stdio.h>
-//#define OPENER_ASSERT(assertion) assert(assertion)
-#else
-
-/* for release builds execute the assertion, but don't test it */
-#define OPENER_ASSERT(assertion) assertion
-
-/* the above may result in "statement with no effect" warnings.
- *  If you do not use assert()s to run functions, the an empty
- *  macro can be used as below
- */
-//#define OPENER_ASSERT(assertion)
-/* else if you still want assertions to stop execution but without tracing, use the following */
-//#define OPENER_ASSERT(assertion) do { if(!(assertion)) { while(1){;} } } while (0)
-/* else use standard assert() */
-//#include <assert.h>
-//#include <stdio.h>
-//#define OPENER_ASSERT(assertion) assert(assertion)
-
-#endif
-
-/*! The number of bytes used for the Ethernet message buffer on
- * the pc port. For different platforms it may makes sense to 
- * have more than one buffer.
- *
- *  This buffer size will be used for any received message.
- *  The same buffer is used for the replied explicit message.
- */
-#define PC_OPENER_ETHERNET_BUFFER_SIZE 512
-
-/*! If this define is here opener will enable 64Bit data type support.
- *
- */
-#define OPENER_SUPPORT_64BIT_DATATYPES 1
-
-#endif /*OPENER_USER_CONF_H_*/

+ 0 - 70
source/src/ports/LM3S8962/stubs.c

@@ -1,70 +0,0 @@
-/*******************************************************************************
- * Copyright (c) 2009, Rockwell Automation, Inc.
- * All rights reserved. 
- *
- ******************************************************************************/
-
-#include <string.h>
-#include <stdio.h>
-#include <stdarg.h>
-#include <assert.h>
-#include <trace.h>
-
-int __errno(void) {
-  return 0;
-}
-
-void raise(void) {
-  while (1)
-    ;
-}
-
-void abort(void) {
-  while (1)
-    ;
-}
-
-void BUG(char *s) {
-  while (1)
-    ;
-}
-
-static char dumpbuf[256];
-
-void __assert_func(const char *__file, int __line, const char *__function,
-                   const char *__assertion) {
-  snprintf(dumpbuf, 100,
-           "assert(%s) failed in function %s, file %s, at line %d\n",
-           __assertion, __function, __file, __line);
-
-  OPENER_TRACE_ERR(dumpbuf);
-  while (1)
-    ;
-}
-
-void dump(unsigned char *p, int size) {
-  int i;
-  char *b;
-
-  while (size > 0) {
-    b = dumpbuf;
-    for (i = 0; i < 16; i++) {
-      if (i < size)
-        b += sprintf(b, "%02x ", p[i]);
-      else
-        b += sprintf(b, "   ");
-    }
-    b += sprintf(b, " |");
-    for (i = 0; i < 16; i++) {
-      if (i < size) {
-        if (' ' <= p[i] && p[i] < 0x7f)
-          b += sprintf(b, "%c", p[i]);
-        else
-          b += sprintf(b, ".");
-      }
-    }
-    p += 16;
-    size -= 16;
-    OPENER_TRACE_INFO("%s\n", dumpbuf);
-  }
-}