ap_config.h

#ifdef __cplusplus
extern "C" {
#endif

/*
 * ap_config.h: system-dependant #defines and includes...
 * See PORTING for a listing of what they mean
 */

#include "ap_mmn.h"  /* MODULE_MAGIC_NUMBER_ */

/*
 * Support for platform dependent autogenerated defines
 */

#include "ap_config_auto.h"


/* Have to include sys/stat.h before ../os/win32/os.h so we can override
stat() properly */
#include <sys/types.h>
#include <sys/stat.h>


#include "os.h"


#include <sys/param.h>


/* Define one of these according to your system. */
#if defined(MINT)


#elif defined(MPE)


#elif defined(SUNOS4)


#elif defined(SOLARIS2)

#elif defined(IRIX)

 

#elif defined(HIUX)


#elif defined(HPUX) || defined(HPUX10)

#elif defined(HPUX11)


#elif defined(AIX)


#elif defined(ULTRIX)


#elif defined(OSF1)

#elif defined(PARAGON)


#elif defined(SEQUENT)


#elif defined(NEXT)

 


#elif defined(RHAPSODY) /* Mac OS X Server */

 

#elif defined(LINUX)

#if LINUX > 1
#include <features.h>

/* libc4 systems probably still work, it probably doesn't define
 *  __GNU_LIBRARY__
 * libc5 systems define __GNU_LIBRARY__ == 1, but don't define __GLIBC__
 * glibc 2.x and later systems define __GNU_LIBRARY__ == 6, but list it as
 * "deprecated in favour of __GLIBC__"; the value 6 will never be changed.
 * glibc 1.x systems (i.e. redhat 4.x on sparc/alpha) should have
 * __GLIBC__ < 2
 * all glibc based systems need crypt.h
 */
 //this Macro __GNU_LIBRARY is defined in the features.h
#if defined(__GNU_LIBRARY__) && __GNU_LIBRARY__ > 1
#include <crypt.h>
#endif

/* glibc 2.0.0 through 2.0.4 need size_t * here, where 2.0.5 needs socklen_t *
 * there's no way to discern between these two libraries.  But using int should
 * be portable because otherwise these libs would be hopelessly broken with
 * reams of existing networking code.  We'll use socklen_t * for 2.1.x and
 * later.
 *
 * int works for all the earlier libs, and is picked up by default later.
 */
 // the macro __GLIBC__  is defined in the features.h
#if defined(__GLIBC__) && (__GLIBC__ > 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ > 0))
#define NET_SIZE_T socklen_t
#endif

#define HAVE_SHMGET 1
#define USE_SHMGET_SCOREBOARD
#define HAVE_MMAP 1
#define USE_MMAP_FILES

/* glibc 2.1 and later finally define rlim_t */
#if !defined(__GLIBC__) || __GLIBC__ < 2 || (__GLIBC__ == 2 && __GLIBC_MINOR__ < 1)
typedef int rlim_t;
#endif

/* flock is faster ... but hasn't been tested on 1.x systems */
#define USE_FLOCK_SERIALIZED_ACCEPT

#define SYS_SIGLIST _sys_siglist

#else   // according to if LINUX > 1
#define USE_FCNTL_SERIALIZED_ACCEPT
#endif

#undef HAVE_GMTOFF
#undef NO_KILLPG
#undef NO_SETSID
#undef NEED_STRDUP
#include <sys/time.h>
#define HAVE_SYSLOG 1

#elif defined(SCO)

#elif defined(SCO5)

 

#elif defined(AUX3)


#elif defined(SVR4)

 

#elif defined(UW)

#elif defined(DGUX)


#elif defined(__NetBSD__) || defined(__OpenBSD__) || defined(NETBSD)


#elif defined(UTS21)


#elif defined(APOLLO)


#elif defined(__FreeBSD__) || defined(__bsdi__)


#elif defined(QNX)


#elif defined(LYNXOS)


#elif defined(UXPDS)


#elif defined(OS2)


#elif defined(__MACHTEN__)


/* Convex OS v11 */
#elif defined(CONVEXOS11)

 


#elif defined(ISC)


#elif defined(NEWSOS)


#elif defined(RISCIX)

#elif defined(WIN32)

/* All windows stuff is now in os/win32/os.h */

#else

#endif

/* stuff marked API_EXPORT is part of the API, and intended for use
 * by modules
 */
#ifndef API_EXPORT
#define API_EXPORT(type)    type
#endif

/* Stuff marked API_EXPORT_NONSTD is part of the API, and intended for
 * use by modules.  The difference between API_EXPORT and
 * API_EXPORT_NONSTD is that the latter is required for any functions
 * which use varargs or are used via indirect function call.  This
 * is to accomodate the two calling conventions in windows dlls.
 */
#ifndef API_EXPORT_NONSTD
#define API_EXPORT_NONSTD(type)    type
#endif

#ifndef MODULE_VAR_EXPORT
#define MODULE_VAR_EXPORT
#endif

#ifndef API_VAR_EXPORT
#define API_VAR_EXPORT
#endif

/* modules should not used functions marked CORE_EXPORT
 * or CORE_EXPORT_NONSTD */
#ifndef CORE_EXPORT
#define CORE_EXPORT API_EXPORT
#endif

#ifndef CORE_EXPORT_NONSTD
#define CORE_EXPORT_NONSTD API_EXPORT_NONSTD
#endif

/* On OpenStep and Rhapsody, symbols that conflict with loaded dylibs
 * (eg. System framework) need to be declared as private symbols with
 * __private_extern__.
 * For other systems, make that a no-op.
 */

#define ap_private_extern


/* So that we can use inline on some critical functions, and use
 * GNUC attributes (such as to get -Wall warnings for printf-like
 * functions).  Only do this in gcc 2.7 or later ... it may work
 * on earlier stuff, but why chance it.
 *
 * We've since discovered that the gcc shipped with NeXT systems
 * as "cc" is completely broken.  It claims to be __GNUC__ and so
 * on, but it doesn't implement half of the things that __GNUC__
 * means.  In particular it's missing inline and the __attribute__
 * stuff.  So we hack around it.  PR#1613. -djg
 */


#define ap_inline __inline__
#define USE_GNU_INLINE
#define ENUM_BITFIELD(e,n,w)  e n : w


/*
 * The particular directory style your system supports. If you have dirent.h
 * in /usr/include (POSIX) or /usr/include/sys (SYSV), #include
 * that file and define DIR_TYPE to be dirent. Otherwise, if you have
 * /usr/include/sys/dir.h, define DIR_TYPE to be direct and include that
 * file. If you have neither, I'm confused.
 */

#include <sys/types.h>
#include <stdarg.h>


#include <dirent.h>
#define DIR_TYPE dirent


#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "ap_ctype.h"

#include <sys/file.h>

#ifndef WIN32
#include <sys/socket.h>
#ifdef HAVE_SYS_SELECT_H
#include <sys/select.h>
#endif /* HAVE_SYS_SELECT_H */
#include <netinet/in.h>
#include <netdb.h>
#include <sys/ioctl.h>

#include <arpa/inet.h>  /* for inet_ntoa */

#include <sys/wait.h>
#include <pwd.h>
#include <grp.h>
#include <fcntl.h>
#include <limits.h>
#define closesocket(s) close(s)

#define O_BINARY (0)


#else /* WIN32 */
#include <winsock.h>
#include <malloc.h>
#include <io.h>
#include <fcntl.h>
#endif /* ndef WIN32 */

 

 


#include <time.h>  /* for ctime */
#include <signal.h>
#include <errno.h>

#include <memory.h>


#ifdef NEED_PROCESS_H
#include <process.h>
#endif


#include "hsregex.h"

 

#include <sys/resource.h>

 

#if !defined(MAP_ANON) && defined(MAP_ANONYMOUS)
#define MAP_ANON MAP_ANONYMOUS
#endif

#if defined(USE_MMAP_FILES) && (defined(NO_MMAP) || !defined(HAVE_MMAP))
#undef USE_MMAP_FILES
#endif

#if defined(USE_MMAP_SCOREBOARD) && (defined(NO_MMAP) || !defined(HAVE_MMAP))
#undef USE_MMAP_SCOREBOARD
#endif

#if defined(USE_SHMGET_SCOREBOARD) && (defined(NO_SHMGET) || !defined(HAVE_SHMGET))
#undef USE_SHMGET_SCOREBOARD
#endif

#ifndef LOGNAME_MAX
#define LOGNAME_MAX 25
#endif

#ifdef HAVE_UNISTD_H
#include <unistd.h>
#endif

 

#ifndef S_ISLNK
#define S_ISLNK(m) (((m) & S_IFMT) == S_IFLNK)
#endif

#ifndef INADDR_NONE
#define INADDR_NONE ((unsigned long) -1)
#endif

/*
 * Replace signal function with sigaction equivalent
 */
#ifndef NO_USE_SIGACTION
typedef void Sigfunc(int);

#if defined(SIG_IGN) && !defined(SIG_ERR)
#define SIG_ERR ((Sigfunc *)-1)
#endif

/*
 * For some strange reason, QNX defines signal to signal. Eliminate it.
 */
#ifdef signal
#undef signal
#endif
#define signal(s,f) ap_signal(s,f)
Sigfunc *signal(int signo, Sigfunc * func);
#endif

#include <setjmp.h>

#if defined(USE_LONGJMP)
#define ap_longjmp(x, y)        longjmp((x), (y))
#define ap_setjmp(x)            setjmp(x)
#ifndef JMP_BUF
#define JMP_BUF jmp_buf
#endif
#else
#define ap_longjmp(x, y)        siglongjmp((x), (y))
#define ap_setjmp(x)            sigsetjmp((x), 1)
#ifndef JMP_BUF
#define JMP_BUF sigjmp_buf
#endif
#endif


#define ap_select select

 

#define ap_fdopen(d,m) fdopen((d), (m))


#ifndef ap_inet_addr
#define ap_inet_addr inet_addr
#endif

 


/* Finding offsets of elements within structures.
 * Taken from the X code... they've sweated portability of this stuff
 * so we don't have to.  Sigh...
 */

 

#define XtOffset(p_type,field) /
 ((long) (((char *) (&(((p_type)NULL)->field))) - ((char *) NULL)))

 


#define XtOffsetOf(s_type,field) XtOffset(s_type*,field)


/*
 * NET_SIZE_T exists because of shortsightedness on the POSIX committee.  BSD
 * systems used "int *" as the parameter to accept(), getsockname(),
 * getpeername() et al.  Consequently many unixes took an int * for that
 * parameter.  The POSIX committee decided that "int" was just too generic and
 * had to be replaced with size_t almost everywhere.  There's no problem with
 * that when you're passing by value.  But when you're passing by reference
 * this creates a gross source incompatibility with existing programs.  On
 * 32-bit architectures it creates only a warning.  On 64-bit architectures it
 * creates broken code -- because "int *" is a pointer to a 64-bit quantity and
 * "size_t *" is frequently a pointer to a 32-bit quantity.
 *
 * Some Unixes adopted "size_t *" for the sake of POSIX compliance.  Others
 * ignored it because it was such a broken interface.  Chaos ensued.  POSIX
 * finally woke up and decided that it was wrong and created a new type
 * socklen_t.  The only useful value for socklen_t is int, and that's how
 * everyone who has a clue implements it.  It is almost always the case that
 * NET_SIZE_T should be defined to be an int, unless the system being compiled
 * for was created in the window of POSIX madness.
 */
#ifndef NET_SIZE_T
#define NET_SIZE_T int
#endif

/* Linux defines __WCOREDUMP, but doesn't define WCOREDUMP unless __USE_BSD
 * is in use... we'd prefer to just use WCOREDUMP everywhere.
 */
#if defined(__WCOREDUMP) && !defined(WCOREDUMP)
#define WCOREDUMP __WCOREDUMP
#endif

 

 

 

 


#ifndef ap_wait_t
#define ap_wait_t int
#endif

#ifdef __cplusplus
}
#endif

#endif /* !AP_CONFIG_H */

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
#include "global_define.h" uint8_t R_DiscOutVol_Cnt,R_Request_Num_BK,R_PPS_Request_Volt_BK; uint32_t R_PPS_Request_Cur_BK; uint8_t R_HVScan_RequestVol=0,R_HVScan_RequestVol_BK=0,Cnt_Delay_OutVol_Control=0; uint16_t R_VbatVol_Value,R_IbusCur_Value,R_IbatCur_Value; uint8_t R_Error_Time,R_WWDT_Time; TypeOfTimeFlag TimeFlag = {0}; TypeOfStateFlag StateFlag = {0}; //TypeOf_TypeC AP_TypeCA = {0}; TypeOf_TypeC AP_TypeCB = {0}; //TypeOf_PD AP_PDA = {0}; TypeOf_PD AP_PDB = {0}; const unsigned int CONFIG0 __at(0x00300000) = 0x0ED8F127; const uint32_t CONFIG1 __at(0x00300004) = 0x00C0FF3F; //ÓÐIAP¹¦ÄÜ,²»¿ª¿´ÃŹ·// //const unsigned int CONFIG1 __at(0x00300004) = 0x0040ffbf; const unsigned int CONFIG2 __at(0x00300008) = 0x1fffe000; const unsigned int CONFIG3 __at(0x0030000c) = 0x0000ffff; void SlotBranch100ms(void); void SlotBranch1s(void); volatile IsrFlag_Char R_Time_Flag; typedef struct{ uint8_t B_bit0: 1; }TestBits; TestBits Bits; #define check_8812 1 #define check_discharger 0 #define check_MOS 0 extern unsigned char display_gate; //¸Ãº¯ÊýÖ÷ÒªÓÃÀ´¼ì²émosµÄÓ¦Óᣠvoid check_nmos(void) { static unsigned int m,n=0; if(m<500) { m++; GPIO_WriteBit(GPIOB, GPIO_PinSource2, Bit_RESET); } else if(m<1000) { m++; GPIO_WriteBit(GPIOB, GPIO_PinSource2, Bit_SET); } else { m=0; } } unsigned char key_val=0; unsigned char device_state=0; unsigned int device_state_counter=0; #define device_state_counter_data 250 #define device_state_counter_data2 5 #define A_1 10 #define A_8 128 void led_inial(void) { DispBuf.Bits.FastCharge = RESET; DispInit(); } //Main function int main(void) { static unsigned int counter1,counter2=0,bufer; F_MCU_Initialization(); //MCU³õʼ»¯ HV_Init(); //*********************************************************************************** AP_TypeCB.TypeCx = TypeCB; AP_TypeCB.B_Support_HW = SET; AP_TypeCB.TypeC_Rp_Mode = TypeC_Cur
最新发布
07-11

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值