Go to the documentation of this file.00001 
00002 
00003 
00004 
00005 
00006 
00007 
00008 
00009 
00010 
00011 
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);      
00029   WDSV = MSB(start_value);      
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;           
00046   WDSV = wd_msb;           
00047 #elif __ICC8051__
00048   wd_lsb = WDSVL;
00049   wd_msb = WDSVH;
00050   WDSVL = wd_lsb;           
00051   WDSVH = wd_msb;           
00052 #else
00053 #error Please define watchdog restart
00054 #endif
00055 }