• Main Page
  • Modules
  • Index
  • File List
  • Globals

hal/nrf24le1/hal_wdog.c

Go to the documentation of this file.
00001 /* Copyright (c) 2009 Nordic Semiconductor. All Rights Reserved.
00002  *
00003  * The information contained herein is confidential property of Nordic 
00004  * Semiconductor ASA.Terms and conditions of usage are described in detail 
00005  * in NORDIC SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. 
00006  *
00007  * Licensees are granted free, non-transferable use of the information. NO
00008  * WARRENTY of ANY KIND is provided. This heading must NOT be removed from
00009  * the file.
00010  *              
00011  * $LastChangedRevision: 133 $
00012  */
00013 
00018 #include <stdint.h>
00019 #include <stdbool.h>
00020 
00021 #include "nrf24le1.h"
00022 #include "nordic_common.h"
00023 #include "hal_wdog.h"
00024 
00025 void hal_wdog_init(uint16_t start_value)
00026 {
00027 #ifdef __C51__
00028   WDSV = LSB(start_value);      // Write the 8 LSB to the WD counter
00029   WDSV = MSB(start_value);      // Write the 8 MSB to the WD counter
00030 #elif __ICC8051__
00031   WDSVL = LSB(start_value); 
00032   WDSVH = MSB(start_value);
00033 #else
00034 #error Please define watchdog registers!
00035 #endif
00036 }
00037 
00038 void hal_wdog_restart(void)
00039 {
00040   uint8_t wd_msb, wd_lsb;
00041 
00042   #ifdef __C51__  
00043   wd_lsb = WDSV;
00044   wd_msb = WDSV;
00045   WDSV = wd_lsb;           // Write the 8 LSB to the WD counter
00046   WDSV = wd_msb;           // Write the 8 MSB to the WD counter
00047 #elif __ICC8051__
00048   wd_lsb = WDSVL;
00049   wd_msb = WDSVH;
00050   WDSVL = wd_lsb;           // Write the 8 LSB to the WD counter
00051   WDSVH = wd_msb;           // Write the 8 MSB to the WD counter
00052 #else
00053 #error Please define watchdog restart
00054 #endif
00055 }

Generated on Fri Apr 20 2012 14:11:45 for nRFGo SDK by  doxygen 1.7.2