2009-09-08 22:07:35 +02:00
|
|
|
/*
|
|
|
|
* \file
|
|
|
|
* This file contains a set of configuration for using SDCC as a compiler.
|
|
|
|
* Modified from z80 port for cc2430 port.
|
|
|
|
*
|
|
|
|
* \author
|
2012-03-05 17:28:06 +01:00
|
|
|
* Takahide Matsutsuka <markn@markn.org> (Original)
|
|
|
|
* George Oikonomou - <oikonomou@users.sourceforge.net>
|
|
|
|
* (recent updates for the sensinode/cc2430 port)
|
2009-09-08 22:07:35 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __8051_DEF_H__
|
|
|
|
#define __8051_DEF_H__
|
|
|
|
|
2012-03-05 17:28:06 +01:00
|
|
|
#include <stdint.h>
|
|
|
|
|
2012-04-30 14:30:34 +02:00
|
|
|
/* This port no longer implements the legacy clock_delay. Hack its usages
|
|
|
|
* outta the way till it gets phased out completely
|
|
|
|
* NB: This also overwrites the prototype so delay_usec() is declared twice */
|
|
|
|
#define clock_delay(t) clock_delay_usec(t)
|
|
|
|
|
2012-03-05 17:28:06 +01:00
|
|
|
/*
|
|
|
|
* lint - style defines to help syntax parsers with sdcc-specific 8051 code
|
|
|
|
* They don't interfere with actual compilation
|
|
|
|
*/
|
|
|
|
#if !defined(__SDCC_mcs51) && !defined(SDCC_mcs51)
|
|
|
|
#define __data
|
|
|
|
#define __xdata
|
|
|
|
#define __code
|
|
|
|
#define __bit bool
|
|
|
|
#define __sfr volatile unsigned char
|
|
|
|
#define __sbit volatile bool
|
|
|
|
#define __critical
|
|
|
|
#define __at(x)
|
|
|
|
#define __using(x)
|
|
|
|
#define __interrupt(x)
|
|
|
|
#define __naked
|
|
|
|
#endif
|
|
|
|
|
2009-09-08 22:07:35 +02:00
|
|
|
#define CC_CONF_FUNCTION_POINTER_ARGS 1
|
|
|
|
#define CC_CONF_FASTCALL
|
|
|
|
#define CC_CONF_VA_ARGS 1
|
|
|
|
#define CC_CONF_UNSIGNED_CHAR_BUGS 0
|
|
|
|
#define CC_CONF_REGISTER_ARGS 0
|
|
|
|
#define CC_CONF_FUNCTION_POINTER_KEYWORD __reentrant
|
2012-04-01 21:07:53 +02:00
|
|
|
#define CC_CONF_NON_BANKED_OPTIMIZATION 1
|
|
|
|
|
|
|
|
#if (defined(__SDCC_mcs51) || defined(SDCC_mcs51)) && CC_CONF_NON_BANKED_OPTIMIZATION
|
|
|
|
#define CC_NON_BANKED __nonbanked
|
|
|
|
#else
|
|
|
|
#define CC_NON_BANKED
|
|
|
|
#endif
|
2009-09-08 22:07:35 +02:00
|
|
|
|
|
|
|
/* Generic types. */
|
|
|
|
typedef unsigned short uip_stats_t;
|
2012-03-05 17:28:06 +01:00
|
|
|
|
|
|
|
/* Time type. */
|
|
|
|
typedef unsigned short clock_time_t;
|
|
|
|
#define MAX_TICKS (~((clock_time_t)0) / 2)
|
2012-04-01 21:08:23 +02:00
|
|
|
/* Defines tick counts for a second. */
|
|
|
|
#define CLOCK_CONF_SECOND 128
|
2009-09-08 22:07:35 +02:00
|
|
|
|
|
|
|
/* Compiler configurations */
|
|
|
|
#define CCIF
|
|
|
|
#define CLIF
|
|
|
|
|
2012-04-03 15:50:13 +02:00
|
|
|
/* Single asm instruction without messing up syntax highlighting */
|
|
|
|
#if defined(__SDCC_mcs51) || defined(SDCC_mcs51)
|
|
|
|
#define ASM(x) __asm \
|
|
|
|
x \
|
|
|
|
__endasm
|
|
|
|
#else
|
|
|
|
#define ASM(x)
|
|
|
|
#endif
|
|
|
|
|
2009-09-08 22:07:35 +02:00
|
|
|
/* Critical section management */
|
2012-03-05 17:28:06 +01:00
|
|
|
#define DISABLE_INTERRUPTS() do {EA = 0;} while(0)
|
|
|
|
#define ENABLE_INTERRUPTS() do {EA = 1;} while(0)
|
2009-09-08 22:07:35 +02:00
|
|
|
|
2012-03-29 12:22:56 +02:00
|
|
|
/* Macro for a soft reset. */
|
|
|
|
#define SOFT_RESET() do {((void (__code *) (void)) 0x0000) ();} while(0)
|
2009-12-22 10:28:14 +01:00
|
|
|
|
2012-03-05 17:28:06 +01:00
|
|
|
/* We don't provide architecture-specific checksum calculations */
|
2012-04-02 17:10:05 +02:00
|
|
|
#define UIP_ARCH_ADD32 0
|
|
|
|
#define UIP_ARCH_CHKSUM 0
|
2009-09-08 22:07:35 +02:00
|
|
|
|
|
|
|
#define CC_CONF_ASSIGN_AGGREGATE(dest, src) \
|
|
|
|
memcpy(dest, src, sizeof(*dest))
|
|
|
|
|
|
|
|
#define uip_ipaddr_copy(dest, src) \
|
|
|
|
memcpy(dest, src, sizeof(*dest))
|
|
|
|
|
|
|
|
#endif /* __8051_DEF_H__ */
|