source: rtems/bsps/arm/atsam/start/power-clock.c @ 9964895

5
Last change on this file since 9964895 was 9964895, checked in by Sebastian Huber <sebastian.huber@…>, on 04/20/18 at 08:35:35

bsps: Move startup files to bsps

Adjust build support files to new directory layout.

This patch is a part of the BSP source reorganization.

Update #3285.

  • Property mode set to 100644
File size: 897 bytes
Line 
1/*
2 * Copyright (c) 2016 embedded brains GmbH.  All rights reserved.
3 *
4 *  embedded brains GmbH
5 *  Dornierstr. 4
6 *  82178 Puchheim
7 *  Germany
8 *  <rtems@embedded-brains.de>
9 *
10 * The license and distribution terms for this file may be
11 * found in the file LICENSE in this distribution or at
12 * http://www.rtems.org/license/LICENSE.
13 */
14
15#include <bsp.h>
16#include <bsp/power.h>
17#include <bsp/irq.h>
18
19#include <libchip/chip.h>
20
21#include <rtems/score/armv7m.h>
22
23void atsam_power_handler_clock_driver(
24    const atsam_power_control *control,
25    atsam_power_state state
26)
27{
28        volatile ARMV7M_Systick *systick = _ARMV7M_Systick;
29
30        (void) control;
31
32        switch (state) {
33                case ATSAM_POWER_ON:
34                        systick->csr = ARMV7M_SYSTICK_CSR_ENABLE |
35                            ARMV7M_SYSTICK_CSR_TICKINT |
36                            ARMV7M_SYSTICK_CSR_CLKSOURCE;
37                        break;
38                case ATSAM_POWER_OFF:
39                        systick->csr = 0;
40                        break;
41                default:
42                        break;
43        }
44}
Note: See TracBrowser for help on using the repository browser.