ts-7000
[Top] [All Lists]

[ts-7000] How to do soft shutdown with watchdog timer?

To:
Subject: [ts-7000] How to do soft shutdown with watchdog timer?
From: "Rekcut_Nod" <>
Date: Tue, 08 Mar 2011 21:31:21 -0000
I'm using a TS-7260.  I monitor a DIO line for the user to shutdown the system, 
at which point I want to close all open ports and devices, and issue a 
"shutdown -h now" command via popen (I'm writing c code).

My question is, if the watchdog is initialized and fed by:

int fd = open("/dev/mem", O_RDWR|O_SYNC);
volatile unsigned char *wdt_control;
volatile unsigned char *wdt_feedl;

wdt_control = (unsigned 
char*)mmap(0,getpagesize(),PROT_READ|PROT_WRITE,MAP_SHARED,fd,0x23800000);
wdt_feed = (unsigned 
char*)mmap(0,getpagesize(),PROT_READ|PROT_WRITE,MAP_SHARED,fd,0x23C00000);

*wdt_feed=0x05;
*wdt_control=0x07;//set duration to max = 8 seconds

how can I call fclose(fd)?  I don't want the watchdog to reset the board before 
the "shutdown -h now" is finished, nor do I want the program to be terminated 
by the shutdown command before I've safely released /dev/mem. Any suggestions?



------------------------------------

Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/ts-7000/

<*> Your email settings:
    Individual Email | Traditional

<*> To change settings online go to:
    http://groups.yahoo.com/group/ts-7000/join
    (Yahoo! ID required)

<*> To change settings via email:
     
    

<*> To unsubscribe from this group, send an email to:
    

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/

<Prev in Thread] Current Thread [Next in Thread>
Admin

Disclaimer: Neither Andrew Taylor nor the University of NSW School of Computer and Engineering take any responsibility for the contents of this archive. It is purely a compilation of material sent by many people to the birding-aus mailing list. It has not been checked for accuracy nor its content verified in any way. If you wish to get material removed from the archive or have other queries about the archive e-mail Andrew Taylor at this address: andrewt@cse.unsw.EDU.AU