mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-08-19 17:48:33 -04:00
Updated AVR32 demos and added AVR32 UC3B demo.
This commit is contained in:
parent
45e7e5ac55
commit
94c94d3c0e
164 changed files with 21458 additions and 3994 deletions
63
Demo/lwIP_AVR32_UC3/NETWORK/lwip-port/AT32UC3A/IAR/errno.h
Normal file
63
Demo/lwIP_AVR32_UC3/NETWORK/lwip-port/AT32UC3A/IAR/errno.h
Normal file
|
@ -0,0 +1,63 @@
|
|||
/* errno.h standard header */
|
||||
#ifndef _ERRNO
|
||||
#define _ERRNO
|
||||
|
||||
#ifndef _SYSTEM_BUILD
|
||||
#pragma system_include
|
||||
#endif
|
||||
|
||||
#ifndef _YVALS
|
||||
#include <yvals.h>
|
||||
#endif
|
||||
_C_STD_BEGIN
|
||||
|
||||
/* ERROR CODES */
|
||||
#define EDOM _EDOM
|
||||
#define ERANGE _ERANGE
|
||||
#define EFPOS _EFPOS
|
||||
#define EILSEQ _EILSEQ
|
||||
|
||||
/* lwip error codes, from cygwin errno.h */
|
||||
#define EIO 5 /* I/O error */
|
||||
#define EWOULDBLOCK 11 /* Operation would block */
|
||||
#define ENOMEM 12 /* Not enough core */
|
||||
#define EFAULT 14 /* Bad address */
|
||||
#define EINVAL 22 /* Invalid argument */
|
||||
#define ENOSYS 88 /* Function not implemented */
|
||||
#define ECONNRESET 104 /* Connection reset by peer */
|
||||
#define ENOBUFS 105 /* No buffer space available */
|
||||
#define ENOPROTOOPT 109 /* Protocol not available */
|
||||
#define ESHUTDOWN 110 /* Can't send after socket shutdown */
|
||||
#define EADDRINUSE 112 /* Address already in use */
|
||||
#define ECONNABORTED 113 /* Connection aborted */
|
||||
#define EHOSTUNREACH 118 /* Host is unreachable */
|
||||
#define ENOTCONN 128 /* Socket is not connected */
|
||||
|
||||
#define _NERR 129 /* one more than last code */
|
||||
|
||||
/* DECLARATIONS */
|
||||
_C_LIB_DECL
|
||||
#if !_MULTI_THREAD || _COMPILER_TLS && !_GLOBAL_LOCALE
|
||||
extern int _TLS_QUAL errno;
|
||||
|
||||
#else /* !_MULTI_THREAD || _COMPILER_TLS && !_GLOBAL_LOCALE */
|
||||
__INTRINSIC int *_Geterrno(void);
|
||||
|
||||
#define errno (*_Geterrno())
|
||||
#endif /* !_MULTI_THREAD || _COMPILER_TLS && !_GLOBAL_LOCALE */
|
||||
_END_C_LIB_DECL
|
||||
_C_STD_END
|
||||
#endif /* _ERRNO */
|
||||
|
||||
#ifdef _STD_USING
|
||||
#ifndef errno
|
||||
using _CSTD errno;
|
||||
#endif
|
||||
#endif /* _STD_USING */
|
||||
/*
|
||||
* Copyright (c) 1992-2002 by P.J. Plauger. ALL RIGHTS RESERVED.
|
||||
* Consult your license regarding permissions and restrictions.
|
||||
V3.12:0576 */
|
||||
|
||||
|
||||
|
|
@ -1,5 +1,3 @@
|
|||
/* This header file is part of the ATMEL FREERTOS-0.9.0 Release */
|
||||
|
||||
/*This file has been prepared for Doxygen automatic documentation generation.*/
|
||||
/*! \file *********************************************************************
|
||||
*
|
||||
|
@ -10,7 +8,7 @@
|
|||
* - AppNote:
|
||||
*
|
||||
* \author Atmel Corporation: http://www.atmel.com \n
|
||||
* Support email: avr32@atmel.com
|
||||
* Support and FAQ: http://support.atmel.no/
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
@ -67,9 +65,24 @@ typedef int sys_prot_t;
|
|||
#define LWIP_PLATFORM_ASSERT(x)
|
||||
|
||||
/* */
|
||||
#if __GNUC__
|
||||
#define PACK_STRUCT_BEGIN
|
||||
#elif __ICCAVR32__
|
||||
#define PACK_STRUCT_BEGIN _Pragma("pack(1)")
|
||||
#endif
|
||||
|
||||
#if __GNUC__
|
||||
#define PACK_STRUCT_STRUCT __attribute__ ((__packed__))
|
||||
#elif __ICCAVR32__
|
||||
#define PACK_STRUCT_STRUCT
|
||||
#endif
|
||||
|
||||
#if __GNUC__
|
||||
#define PACK_STRUCT_END
|
||||
#elif __ICCAVR32__
|
||||
#define PACK_STRUCT_END _Pragma("pack()")
|
||||
#endif
|
||||
|
||||
#define PACK_STRUCT_FIELD(x) x
|
||||
|
||||
#endif /* __CC_H__ */
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
/* This header file is part of the ATMEL FREERTOS-0.9.0 Release */
|
||||
|
||||
/*This file has been prepared for Doxygen automatic documentation generation.*/
|
||||
/*! \file *********************************************************************
|
||||
*
|
||||
|
@ -10,7 +8,7 @@
|
|||
* - AppNote:
|
||||
*
|
||||
* \author Atmel Corporation: http://www.atmel.com \n
|
||||
* Support email: avr32@atmel.com
|
||||
* Support and FAQ: http://support.atmel.no/
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
/* This header file is part of the ATMEL FREERTOS-0.9.0 Release */
|
||||
|
||||
/*This file has been prepared for Doxygen automatic documentation generation.*/
|
||||
/*! \file *********************************************************************
|
||||
*
|
||||
|
@ -10,7 +8,7 @@
|
|||
* - AppNote:
|
||||
*
|
||||
* \author Atmel Corporation: http://www.atmel.com \n
|
||||
* Support email: avr32@atmel.com
|
||||
* Support and FAQ: http://support.atmel.no/
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
/* This header file is part of the ATMEL FREERTOS-0.9.0 Release */
|
||||
|
||||
/*This file has been prepared for Doxygen automatic documentation generation.*/
|
||||
/*! \file *********************************************************************
|
||||
*
|
||||
|
@ -10,7 +8,7 @@
|
|||
* - AppNote:
|
||||
*
|
||||
* \author Atmel Corporation: http://www.atmel.com \n
|
||||
* Support email: avr32@atmel.com
|
||||
* Support and FAQ: http://support.atmel.no/
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
/* This header file is part of the ATMEL FREERTOS-0.9.0 Release */
|
||||
|
||||
/*This file has been prepared for Doxygen automatic documentation generation.*/
|
||||
/*! \file *********************************************************************
|
||||
*
|
||||
|
@ -10,7 +8,7 @@
|
|||
* - AppNote:
|
||||
*
|
||||
* \author Atmel Corporation: http://www.atmel.com \n
|
||||
* Support email: avr32@atmel.com
|
||||
* Support and FAQ: http://support.atmel.no/
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
/* This header file is part of the ATMEL FREERTOS-0.9.0 Release */
|
||||
|
||||
/*This file has been prepared for Doxygen automatic documentation generation.*/
|
||||
/*! \file *********************************************************************
|
||||
*
|
||||
|
@ -10,7 +8,7 @@
|
|||
* - AppNote:
|
||||
*
|
||||
* \author Atmel Corporation: http://www.atmel.com \n
|
||||
* Support email: avr32@atmel.com
|
||||
* Support and FAQ: http://support.atmel.no/
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
/* This source file is part of the ATMEL FREERTOS-0.9.0 Release */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
|
@ -52,8 +50,7 @@
|
|||
|
||||
/* FreeRTOS includes. */
|
||||
#include "FreeRTOS.h"
|
||||
#include "AVR32_EMAC.h"
|
||||
#include "AVR32_CONF_EMAC.h"
|
||||
#include "macb.h"
|
||||
|
||||
#define netifMTU ( 1500 )
|
||||
#define netifGUARD_BLOCK_TIME ( 250 )
|
||||
|
@ -90,20 +87,20 @@ low_level_init(struct netif *netif)
|
|||
/* Do whatever else is needed to initialize interface. */
|
||||
xNetIf = netif;
|
||||
|
||||
/* Initialise the EMAC. This routine contains code that polls status bits.
|
||||
/* Initialise the MACB. This routine contains code that polls status bits.
|
||||
If the Ethernet cable is not plugged in then this can take a considerable
|
||||
time. To prevent this starving lower priority tasks of processing time we
|
||||
lower our priority prior to the call, then raise it back again once the
|
||||
initialisation is complete. */
|
||||
uxPriority = uxTaskPriorityGet( NULL );
|
||||
vTaskPrioritySet( NULL, tskIDLE_PRIORITY );
|
||||
while( xEMACInit() == NULL )
|
||||
while( xMACBInit(&AVR32_MACB) == FALSE )
|
||||
{
|
||||
__asm( "NOP" );
|
||||
__asm__ __volatile__ ( "nop" );
|
||||
}
|
||||
vTaskPrioritySet( NULL, uxPriority );
|
||||
|
||||
/* Create the task that handles the EMAC. */
|
||||
/* Create the task that handles the MACB. */
|
||||
// xTaskCreate( ethernetif_input, ( signed portCHAR * ) "ETH_INT", netifINTERFACE_TASK_STACK_SIZE, NULL, netifINTERFACE_TASK_PRIORITY, NULL );
|
||||
sys_thread_new( ethernetif_input, NULL, netifINTERFACE_TASK_PRIORITY );
|
||||
}
|
||||
|
@ -136,7 +133,7 @@ err_t xReturn = ERR_OK;
|
|||
pbuf_header( p, -ETH_PAD_SIZE ); /* drop the padding word */
|
||||
#endif
|
||||
|
||||
/* Access to the EMAC is guarded using a semaphore. */
|
||||
/* Access to the MACB is guarded using a semaphore. */
|
||||
if( xSemaphoreTake( xTxSemaphore, netifGUARD_BLOCK_TIME ) )
|
||||
{
|
||||
for( q = p; q != NULL; q = q->next )
|
||||
|
@ -145,13 +142,12 @@ err_t xReturn = ERR_OK;
|
|||
time. The size of the data in each pbuf is kept in the ->len
|
||||
variable. if q->next == NULL then this is the last pbuf in the
|
||||
chain. */
|
||||
if( !lEMACSend( q->payload, q->len, ( q->next == NULL ) ) )
|
||||
if( !lMACBSend(&AVR32_MACB, q->payload, q->len, ( q->next == NULL ) ) )
|
||||
{
|
||||
xReturn = ~ERR_OK;
|
||||
}
|
||||
}
|
||||
|
||||
xSemaphoreGive( xTxSemaphore );
|
||||
xSemaphoreGive( xTxSemaphore );
|
||||
}
|
||||
|
||||
|
||||
|
@ -193,7 +189,7 @@ static xSemaphoreHandle xRxSemaphore = NULL;
|
|||
if( xSemaphoreTake( xRxSemaphore, netifGUARD_BLOCK_TIME ) )
|
||||
{
|
||||
/* Obtain the size of the packet. */
|
||||
len = ulEMACInputLength();
|
||||
len = ulMACBInputLength();
|
||||
|
||||
if( len )
|
||||
{
|
||||
|
@ -211,7 +207,7 @@ static xSemaphoreHandle xRxSemaphore = NULL;
|
|||
#endif
|
||||
|
||||
/* Let the driver know we are going to read a new packet. */
|
||||
vEMACRead( NULL, 0, len );
|
||||
vMACBRead( NULL, 0, len );
|
||||
|
||||
/* We iterate over the pbuf chain until we have read the entire
|
||||
packet into the pbuf. */
|
||||
|
@ -219,7 +215,7 @@ static xSemaphoreHandle xRxSemaphore = NULL;
|
|||
{
|
||||
/* Read enough bytes to fill this pbuf in the chain. The
|
||||
available data in the pbuf is given by the q->len variable. */
|
||||
vEMACRead( q->payload, q->len, len );
|
||||
vMACBRead( q->payload, q->len, len );
|
||||
}
|
||||
|
||||
#if ETH_PAD_SIZE
|
||||
|
@ -294,7 +290,7 @@ struct pbuf *p;
|
|||
{
|
||||
/* No packet could be read. Wait a for an interrupt to tell us
|
||||
there is more data available. */
|
||||
vEMACWaitForInput();
|
||||
vMACBWaitForInput(100);
|
||||
}
|
||||
|
||||
} while( p == NULL );
|
||||
|
@ -350,7 +346,7 @@ arp_timer(void *arg)
|
|||
* actual setup of the hardware.
|
||||
*
|
||||
*/
|
||||
extern struct netif EMAC_if;
|
||||
extern struct netif MACB_if;
|
||||
err_t
|
||||
ethernetif_init(struct netif *netif)
|
||||
{
|
||||
|
@ -371,7 +367,7 @@ ethernetif_init(struct netif *netif)
|
|||
netif->output = ethernetif_output;
|
||||
netif->linkoutput = low_level_output;
|
||||
|
||||
for(i = 0; i < 6; i++) netif->hwaddr[i] = EMAC_if.hwaddr[i];
|
||||
for(i = 0; i < 6; i++) netif->hwaddr[i] = MACB_if.hwaddr[i];
|
||||
|
||||
low_level_init(netif);
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
/* This header file is part of the ATMEL FREERTOS-0.9.0 Release */
|
||||
|
||||
/*
|
||||
* Copyright (c) 2001-2004 Swedish Institute of Computer Science.
|
||||
* All rights reserved.
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
/* This header file is part of the ATMEL FREERTOS-0.9.0 Release */
|
||||
|
||||
/*This file has been prepared for Doxygen automatic documentation generation.*/
|
||||
/*! \file *********************************************************************
|
||||
*
|
||||
|
@ -10,7 +8,7 @@
|
|||
* - AppNote:
|
||||
*
|
||||
* \author Atmel Corporation: http://www.atmel.com \n
|
||||
* Support email: avr32@atmel.com
|
||||
* Support and FAQ: http://support.atmel.no/
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
|
|
@ -1,5 +1,3 @@
|
|||
/* This source file is part of the ATMEL FREERTOS-0.9.0 Release */
|
||||
|
||||
/*This file has been prepared for Doxygen automatic documentation generation.*/
|
||||
/*! \file *********************************************************************
|
||||
*
|
||||
|
@ -10,7 +8,7 @@
|
|||
* - AppNote:
|
||||
*
|
||||
* \author Atmel Corporation: http://www.atmel.com \n
|
||||
* Support email: avr32@atmel.com
|
||||
* Support and FAQ: http://support.atmel.no/
|
||||
*
|
||||
*****************************************************************************/
|
||||
|
||||
|
@ -102,7 +100,7 @@ sys_mbox_free(sys_mbox_t mbox)
|
|||
if( uxQueueMessagesWaiting( mbox ) )
|
||||
{
|
||||
/* Line for breakpoint. Should never break here! */
|
||||
__asm volatile ( "NOP" );
|
||||
__asm__ __volatile__ ( "nop" );
|
||||
}
|
||||
|
||||
vQueueDelete( mbox );
|
||||
|
@ -377,9 +375,9 @@ static int iCall = 0;
|
|||
}
|
||||
#endif
|
||||
#if (SMTP_USED == 1)
|
||||
else if (thread == vBasicSMTPHost)
|
||||
else if (thread == vBasicSMTPClient)
|
||||
{
|
||||
result = xTaskCreate( thread, ( signed portCHAR * ) "SMTP", lwipBASIC_SMTP_HOST_STACK_SIZE, arg, prio, &CreatedTask );
|
||||
result = xTaskCreate( thread, ( signed portCHAR * ) "SMTP", lwipBASIC_SMTP_CLIENT_STACK_SIZE, arg, prio, &CreatedTask );
|
||||
}
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue