hal_wdog.c

来自「非常全的nrf2401设计资料」· C语言 代码 · 共 42 行

C
42
字号
/* Copyright (c) 2008 Nordic Semiconductor. All Rights Reserved.
 *
 * The information contained herein is property of Nordic Semiconductor ASA.
 * Terms and conditions of usage are described in detail in NORDIC
 * SEMICONDUCTOR STANDARD SOFTWARE LICENSE AGREEMENT. 
 *
 * Licensees are granted free, non-transferable use of the information. NO
 * WARRENTY of ANY KIND is provided. This heading must NOT be removed from
 * the file.
 *
 * $LastChangedRevision$
 */ 

/** @file
 *
 * @author Rune Brandsegg
 *
 */

#include <stdint.h>
#include <stdbool.h>

#include <Nordic\reg24le1.h>
#include "nordic_common.h"
#include "hal_wdog.h"

void hal_wdog_init(uint16_t start_value)
{
  WDSV = LSB(start_value);      // Write the 8 LSB to the WD counter
  WDSV = MSB(start_value);      // Write the 8 MSB to the WD counter
}

void hal_wdog_restart(void)
{
  uint8_t wd_msb, wd_lsb;

  wd_lsb = WDSV;
  wd_msb = WDSV;

  WDSV = wd_lsb;           // Write the 8 LSB to the WD counter
  WDSV = wd_msb;           // Write the 8 MSB to the WD counter
}

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?