/******************************************************************************* * * * Copyright 2010 Rheinmetall Canada Inc. * * * * No part of this document may be reproduced, stored in * * a retrieval system, or transmitted, in any form or by any means, * * electronic, mechanical, photocopying, recording, or otherwise, * * without the prior written permission of Rheinmetall Canada Inc. * * * *******************************************************************************/ /* Description: This is a template file for standard C code file. */ /* ************************************************************************** */ /* ¤Revision: 000 20100616 JFM, Original version. ### YYYYMMDD Initial, Bug Identification Change description. */ /* ************************************************************************** */ /* Includes */ #include "define.h" #include "Watchdog.h" int WatchdogTriggered = 0; void InitWatchdog(void) { if(RCONbits.WDTO == 1) { WatchdogTriggered = 1; printf("Watchdog was triggered\n"); } } void EnableWatchdog(void) { // WDTCONbits.ON = 1; WDTCONSET = _WDTCON_ON_MASK; } void DisableWatchdog(void) { // WDTCONbits.ON = 0; WDTCONCLR = _WDTCON_ON_MASK; } void KickWatchdog(void) { // WDTCONbits.WDTCLR = 1; WDTCONSET = 0x01; } //EOF