source: rtems/c/src/lib/libbsp/arm/lpc32xx/startup/bspreset.c @ c499856

4.115
Last change on this file since c499856 was c499856, checked in by Chris Johns <chrisj@…>, on 03/20/14 at 21:10:47

Change all references of rtems.com to rtems.org.

  • Property mode set to 100644
File size: 979 bytes
Line 
1/**
2 * @file
3 *
4 * @ingroup arm_lpc32xx
5 *
6 * @brief Reset code.
7 */
8
9/*
10 * Copyright (c) 2009-2010 embedded brains GmbH.  All rights reserved.
11 *
12 *  embedded brains GmbH
13 *  Obere Lagerstr. 30
14 *  82178 Puchheim
15 *  Germany
16 *  <rtems@embedded-brains.de>
17 *
18 * The license and distribution terms for this file may be
19 * found in the file LICENSE in this distribution or at
20 * http://www.rtems.org/license/LICENSE.
21 */
22
23#include <stdbool.h>
24
25#include <bspopts.h>
26#include <bsp/bootcard.h>
27#include <bsp/lpc32xx.h>
28
29static void watchdog_reset(void)
30{
31  #ifdef LPC32XX_ENABLE_WATCHDOG_RESET
32    LPC32XX_TIMCLK_CTRL |= TIMCLK_CTRL_WDT;
33    lpc32xx.wdt.mctrl |= WDTTIM_MCTRL_M_RES1 | WDTTIM_MCTRL_M_RES2;
34    lpc32xx.wdt.emr = WDTTIM_EMR_MATCH_CTRL_SET(lpc32xx.wdt.emr, 0x2);
35    lpc32xx.wdt.ctrl |= WDTTIM_CTRL_COUNT_ENAB;
36    lpc32xx.wdt.match0 = 1;
37    lpc32xx.wdt.counter = 0;
38  #endif
39}
40
41void bsp_reset( void)
42{
43  watchdog_reset();
44
45  while (true) {
46    /* Do nothing */
47  }
48}
Note: See TracBrowser for help on using the repository browser.