Você não pode selecionar mais de 25 tópicos Os tópicos devem começar com uma letra ou um número, podem incluir traços ('-') e podem ter até 35 caracteres.
 
 
 
 

65 linhas
1.6 KiB

  1. /*******************************************************************************
  2. * *
  3. * Copyright 2010 Rheinmetall Canada Inc. *
  4. * *
  5. * No part of this document may be reproduced, stored in *
  6. * a retrieval system, or transmitted, in any form or by any means, *
  7. * electronic, mechanical, photocopying, recording, or otherwise, *
  8. * without the prior written permission of Rheinmetall Canada Inc. *
  9. * *
  10. *******************************************************************************/
  11. /*
  12. Description:
  13. This is a template file for standard C code file.
  14. */
  15. /* ************************************************************************** */
  16. /* ¤Revision:
  17. 000 20100616 JFM,
  18. Original version.
  19. ### YYYYMMDD Initial, Bug Identification
  20. Change description.
  21. */
  22. /* ************************************************************************** */
  23. /* Includes */
  24. #include "define.h"
  25. #include "Watchdog.h"
  26. int WatchdogTriggered = 0;
  27. void InitWatchdog(void)
  28. {
  29. if(RCONbits.WDTO == 1)
  30. {
  31. WatchdogTriggered = 1;
  32. printf("Watchdog was triggered\n");
  33. }
  34. }
  35. void EnableWatchdog(void)
  36. {
  37. // WDTCONbits.ON = 1;
  38. WDTCONSET = _WDTCON_ON_MASK;
  39. }
  40. void DisableWatchdog(void)
  41. {
  42. // WDTCONbits.ON = 0;
  43. WDTCONCLR = _WDTCON_ON_MASK;
  44. }
  45. void KickWatchdog(void)
  46. {
  47. // WDTCONbits.WDTCLR = 1;
  48. WDTCONSET = 0x01;
  49. }
  50. //EOF