From efc2cf23a849f7be1d65c4cdd7767f88917c46a7 Mon Sep 17 00:00:00 2001 From: patacongo Date: Wed, 21 Feb 2007 21:55:16 +0000 Subject: Progress toward clean SDCC compilation git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@18 42af7a65-404d-4744-a932-0658087f49c3 --- nuttx/include/wdog.h | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) (limited to 'nuttx/include/wdog.h') diff --git a/nuttx/include/wdog.h b/nuttx/include/wdog.h index 9ef16256c..a1065eaae 100644 --- a/nuttx/include/wdog.h +++ b/nuttx/include/wdog.h @@ -55,11 +55,28 @@ * Global Type Declarations ************************************************************/ +/* The arguments are passed as uint32 values. For systems + * where the sizeof(pointer) < sizeof(uint32), the following + * union defines the alignment of the pointer within the + * uint32. For example, the SDCC MCS51 general pointer is + * 24-bits, but uint32 is 32-bits (of course). + * + * For systems where sizeof(pointer) > sizeof(uint32), we will + * have to do some redesign. + */ + +union wdparm_u +{ + void *pvarg; + uint32 *dwarg; +}; +typedef union wdparm_u wdparm_t; + /* This is the form of the function that is called when the * watchdog function expires. Up to four parameters may be passed. */ -typedef void (*wdentry_t)(int arg1, ...); +typedef void (*wdentry_t)(int argc, uint32 arg1, ...); /* Watchdog 'handle' */ @@ -81,10 +98,10 @@ extern "C" { #endif EXTERN WDOG_ID wd_create(void); -EXTERN STATUS wd_delete(WDOG_ID wdId); -EXTERN STATUS wd_start(WDOG_ID wdId, int delay, wdentry_t wdentry, - int parm1, int parm2, int parm3, int parm4); -EXTERN STATUS wd_cancel(WDOG_ID wdId); +EXTERN STATUS wd_delete(WDOG_ID wdog); +EXTERN STATUS wd_start(WDOG_ID wdog, int delay, wdentry_t wdentry, + int argc, ...); +EXTERN STATUS wd_cancel(WDOG_ID wdog); #undef EXTERN #ifdef __cplusplus -- cgit v1.2.3