samples: basic: Remove disco sample
This commit removes the disco sample because it is basically the same as blinky but with two LESs and adds no new value to the samples. Signed-off-by: Alexander Wachter <alexander.wachter@student.tugraz.at>
This commit is contained in:
parent
87591958cf
commit
ec721d4bb9
5 changed files with 0 additions and 85 deletions
|
@ -1,7 +0,0 @@
|
|||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
cmake_minimum_required(VERSION 3.13.1)
|
||||
include($ENV{ZEPHYR_BASE}/cmake/app/boilerplate.cmake NO_POLICY_SCOPE)
|
||||
project(disco)
|
||||
|
||||
target_sources(app PRIVATE src/main.c)
|
|
@ -1,32 +0,0 @@
|
|||
.. _disco-sample:
|
||||
|
||||
Disco demo
|
||||
##########
|
||||
|
||||
Overview
|
||||
********
|
||||
|
||||
A simple 'disco' demo. The demo assumes that 2 LEDs are connected to
|
||||
GPIO outputs of the MCU/board.
|
||||
|
||||
|
||||
Wiring
|
||||
******
|
||||
|
||||
This sample should work on board with multiple built-in LEDs without any
|
||||
changes, otherwise, the code may need some changes before running on various
|
||||
board: set PORT, LED0 and LED1 according to the board's GPIO configuration.
|
||||
|
||||
Building and Running
|
||||
*********************
|
||||
|
||||
After startup, the program looks up a predefined GPIO device defined by 'PORT',
|
||||
and configures pins 'LED0' and 'LED1' in output mode. During each iteration of
|
||||
the main loop, the state of GPIO lines will be changed so that one of the lines
|
||||
is in high state, while the other is in low, thus switching the LEDs on and off
|
||||
in an alternating pattern.
|
||||
|
||||
This project does not output to the serial console, but instead causes two LEDs
|
||||
connected to the GPIO device to blink in an alternating pattern.
|
||||
|
||||
The sample can be found here: :zephyr_file:`samples/basic/disco`.
|
|
@ -1 +0,0 @@
|
|||
CONFIG_GPIO=y
|
|
@ -1,9 +0,0 @@
|
|||
sample:
|
||||
name: Disco Lights
|
||||
tests:
|
||||
sample.disco:
|
||||
filter: dt_compat_enabled_with_alias("gpio-leds", "led0") and
|
||||
dt_compat_enabled_with_alias("gpio-leds", "led1")
|
||||
tags: LED gpio
|
||||
depends_on: gpio
|
||||
harness: led
|
|
@ -1,36 +0,0 @@
|
|||
/*
|
||||
* Copyright (c) 2016 Open-RnD Sp. z o.o.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
#include <zephyr.h>
|
||||
#include <device.h>
|
||||
#include <drivers/gpio.h>
|
||||
|
||||
#define PORT0 DT_ALIAS_LED0_GPIOS_CONTROLLER
|
||||
#define PORT1 DT_ALIAS_LED1_GPIOS_CONTROLLER
|
||||
|
||||
#define LED0 DT_ALIAS_LED0_GPIOS_PIN
|
||||
#define LED1 DT_ALIAS_LED1_GPIOS_PIN
|
||||
|
||||
#define SLEEP_TIME 500
|
||||
|
||||
void main(void)
|
||||
{
|
||||
int cnt = 0;
|
||||
struct device *gpio0, *gpio1;
|
||||
|
||||
gpio0 = device_get_binding(PORT0);
|
||||
gpio1 = device_get_binding(PORT1);
|
||||
|
||||
gpio_pin_configure(gpio0, LED0, GPIO_DIR_OUT);
|
||||
gpio_pin_configure(gpio1, LED1, GPIO_DIR_OUT);
|
||||
|
||||
while (1) {
|
||||
gpio_pin_write(gpio0, LED0, cnt % 2);
|
||||
gpio_pin_write(gpio1, LED1, (cnt + 1) % 2);
|
||||
k_sleep(SLEEP_TIME);
|
||||
cnt++;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue