samples: power: power_mgr: Remove redundant test

The removed test does the same thing and runs on the same platforms
as already existing samples/boards/nrf52/power_mgr.

Signed-off-by: Piotr Zięcik <piotr.ziecik@nordicsemi.no>
This commit is contained in:
Piotr Zięcik 2019-01-03 09:40:21 +01:00 committed by Carles Cufí
commit 1ef5ad1883
7 changed files with 0 additions and 184 deletions

View file

@ -1,10 +0,0 @@
.. _power_management-samples:
Power Management Samples
########################
.. toctree::
:maxdepth: 1
:glob:
**/*

View file

@ -1,6 +0,0 @@
cmake_minimum_required(VERSION 3.13.1)
include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE)
project(power_mgr)
FILE(GLOB app_sources src/*.c)
target_sources(app PRIVATE ${app_sources})

View file

@ -1,79 +0,0 @@
.. _os-power-mgr-sample:
OS Power management demo
###########################
Overview
********
This sample demonstrates OS managed power saving mechanism through the sample
application which will periodically go sleep there by invoking the idle thread
which will call the sys_suspend() to enter into low power states. The Low
Power state will be selected based on the next timeout event.
Requirements
************
This application uses nrf52 DK board for the demo.
Building, Flashing and Running
******************************
.. zephyr-app-commands::
:zephyr-app: samples/subsys/power/power_mgr
:board: nrf52_pca10040
:goals: build flash
:compact:
Running:
1. Open UART terminal.
2. Power Cycle Device.
3. Device will enter into Low Power Modes periodically.
Sample Output
=================
nrf52 core output
-----------------
.. code-block:: console
***OS Power Management Demo on arm****
Demo Description
Application creates Idleness, Due to which System Idle Thread is
scheduled and it enters into various Low Power States.
<-- App doing busy wait for 10 Sec -->
<-- App going to sleep for 6000 msec -->
Entering Low Power state (0)
Entering Low Power state (0)
Entering Low Power state (0)
Entering Low Power state (0)
<-- App doing busy wait for 10 Sec -->
<-- App going to sleep for 11000 msec -->
Entering Low Power state (1)
Entering Low Power state (1)
Entering Low Power state (1)
Entering Low Power state (1)
<-- App doing busy wait for 10 Sec -->
<-- App going to sleep for 6000 msec -->
Entering Low Power state (0)
Entering Low Power state (0)
Entering Low Power state (0)
Entering Low Power state (0)
<-- App doing busy wait for 10 Sec -->
<-- App going to sleep for 11000 msec -->
Entering Low Power state (1)
Entering Low Power state (1)
Entering Low Power state (1)
Entering Low Power state (1)
OS managed Power Management Test completed

View file

@ -1,10 +0,0 @@
CONFIG_SYS_POWER_MANAGEMENT=y
CONFIG_SYS_POWER_LOW_POWER_STATE=y
CONFIG_SYS_POWER_DEEP_SLEEP=y
CONFIG_DEVICE_POWER_MANAGEMENT=y
CONFIG_PM_CONTROL_OS=y
CONFIG_PM_POLICY_RESIDENCY=y
CONFIG_PM_LPS_MIN_RES=5
CONFIG_PM_LPS_1_MIN_RES=10
CONFIG_PM_DEEP_SLEEP_MIN_RES=60

View file

@ -1,13 +0,0 @@
CONFIG_NUM_COOP_PRIORITIES=29
CONFIG_NUM_PREEMPT_PRIORITIES=40
CONFIG_SYS_POWER_MANAGEMENT=y
CONFIG_SYS_POWER_LOW_POWER_STATE=y
CONFIG_SYS_POWER_DEEP_SLEEP=y
CONFIG_DEVICE_POWER_MANAGEMENT=y
CONFIG_TICKLESS_KERNEL=y
CONFIG_PM_CONTROL_OS=y
CONFIG_PM_POLICY_RESIDENCY=y
CONFIG_PM_LPS_MIN_RES=5
CONFIG_PM_LPS_1_MIN_RES=10
CONFIG_PM_DEEP_SLEEP_MIN_RES=60

View file

@ -1,6 +0,0 @@
sample:
name: OS managed Power Management Sample
tests:
ospm.low_power_state:
platform_whitelist: nrf52840_pca10056 nrf52_pca10040
tags: power

View file

@ -1,60 +0,0 @@
/*
* Copyright (c) 2016 Intel Corporation.
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr.h>
#include <power.h>
#include <soc_power.h>
#include <misc/printk.h>
#include <string.h>
#include <device.h>
#include <gpio.h>
#define SECONDS_TO_SLEEP 1
#define BUSY_WAIT_DELAY_US (10 * 1000000)
#define LPS_STATE_ENTER_TO ((CONFIG_PM_LPS_MIN_RES + 1) * 1000)
#define LPS1_STATE_ENTER_TO ((CONFIG_PM_LPS_1_MIN_RES + 1) * 1000)
#define DEMO_DESCRIPTION \
"Demo Description\n" \
"Application creates Idleness, Due to which System Idle Thread is\n"\
"scheduled and it enters into various Low Power States.\n"\
void sys_pm_notify_lps_entry(enum power_states state)
{
printk("Entering Low Power state (%d)\n", state);
}
void sys_pm_notify_lps_exit(enum power_states state)
{
printk("Exiting Low Power state (%d)\n", state);
}
/* Application main Thread */
void main(void)
{
printk("\n\n***OS Power Management Demo on %s****\n", CONFIG_ARCH);
printk(DEMO_DESCRIPTION);
for (int i = 1; i <= 4; i++) {
printk("\n<-- App doing busy wait for 10 Sec -->\n");
k_busy_wait(BUSY_WAIT_DELAY_US);
/* Create Idleness to make Idle thread run */
if ((i % 2) == 0) {
printk("\n<-- App going to sleep for %d msec -->\n",
LPS1_STATE_ENTER_TO);
k_sleep(LPS1_STATE_ENTER_TO);
} else {
printk("\n<-- App going to sleep for %d msec -->\n",
LPS_STATE_ENTER_TO);
k_sleep(LPS_STATE_ENTER_TO);
}
}
printk("OS managed Power Management Test completed\n");
}