Skip to content

Commit 851eca4

Browse files
committed
added naieve way of sleeping seems to work at first glance
1 parent 798c3c5 commit 851eca4

File tree

2 files changed

+32
-3
lines changed

2 files changed

+32
-3
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
/* mbed Microcontroller Library
2+
* Copyright (c) 2006-2018 Arm Limited and affiliates.
3+
* SPDX-License-Identifier: Apache-2.0
4+
*
5+
* Licensed under the Apache License, Version 2.0 (the "License");
6+
* you may not use this file except in compliance with the License.
7+
* You may obtain a copy of the License at
8+
*
9+
* http://www.apache.org/licenses/LICENSE-2.0
10+
*
11+
* Unless required by applicable law or agreed to in writing, software
12+
* distributed under the License is distributed on an "AS IS" BASIS,
13+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
* See the License for the specific language governing permissions and
15+
* limitations under the License.
16+
*/
17+
#include "sleep_api.h"
18+
#include "am_hal_sysctrl.h"
19+
20+
void hal_sleep(void)
21+
{
22+
am_hal_sysctrl_sleep(AM_HAL_SYSCTRL_SLEEP_NORMAL);
23+
}
24+
25+
void hal_deepsleep(void)
26+
{
27+
am_hal_sysctrl_sleep(AM_HAL_SYSCTRL_SLEEP_DEEP);
28+
}

targets/targets.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7167,7 +7167,7 @@
71677167
"features": ["BLE"],
71687168
"default_toolchain": "GCC_ARM",
71697169
"supported_toolchains": [
7170-
"GCC_ARM",
7170+
"GCC_ARM",
71717171
"ARMC6"
71727172
],
71737173
"public": false,
@@ -7185,7 +7185,8 @@
71857185
"STDIO_MESSAGES",
71867186
"FLASH",
71877187
"SPI",
7188-
"I2C"
7188+
"I2C",
7189+
"SLEEP"
71897190
],
71907191
"components": [
71917192
"FLASHIAP"
@@ -7218,7 +7219,7 @@
72187219
},
72197220
"SFE_ARTEMIS_THING_PLUS": {
72207221
"inherits": ["AMA3B1KK"]
7221-
},
7222+
},
72227223
"SFE_EDGE": {
72237224
"inherits": ["AMA3B1KK"],
72247225
"components_add": ["lis2dh12", "hm01b0"]

0 commit comments

Comments
 (0)