Skip to content

Commit

Permalink
chore: update repo name
Browse files Browse the repository at this point in the history
  • Loading branch information
sutyum committed Aug 14, 2024
1 parent 09ec367 commit 9256f07
Show file tree
Hide file tree
Showing 13 changed files with 107 additions and 98 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
with:
path: zephyr-firmware-template
path: firmware-template

- name: Set up Python
uses: actions/setup-python@v5
Expand All @@ -27,11 +27,11 @@ jobs:
- name: Setup Zephyr project
uses: zephyrproject-rtos/action-zephyr-setup@v1
with:
app-path: zephyr-firmware-template
app-path: firmware-template
toolchains: arm-zephyr-eabi

- name: Build firmware
working-directory: zephyr-firmware-template
working-directory: firmware-template
shell: bash
run: |
if [ "${{ runner.os }}" = "Windows" ]; then
Expand All @@ -40,7 +40,7 @@ jobs:
west twister -T app -v --inline-logs --integration $EXTRA_TWISTER_FLAGS
- name: Twister Tests
working-directory: zephyr-firmware-template
working-directory: firmware-template
shell: bash
run: |
if [ "${{ runner.os }}" = "Windows" ]; then
Expand Down
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
# Zephyr Firmware Template
# Firmware Template

<a href="https://github.com/zephyrproject-rtos/example-application/actions/workflows/build.yml?query=branch%3Amain">
<img src="https://github.com/zephyrproject-rtos/example-application/actions/workflows/build.yml/badge.svg?event=push">
<a href="https://github.com/technoculture/firmware-template/actions/workflows/build.yml?query=branch%3Amain">
<img src="https://github.com/technoculture/firmware-template/actions/workflows/build.yml/badge.svg?event=push">
</a>
<a href="https://github.com/zephyrproject-rtos/example-application/actions/workflows/docs.yml?query=branch%3Amain">
<img src="https://github.com/zephyrproject-rtos/example-application/actions/workflows/docs.yml/badge.svg?event=push">
<a href="https://github.com/technoculture/firmware-template/actions/workflows/docs.yml?query=branch%3Amain">
<img src="https://github.com/technoculture/firmware-template/actions/workflows/docs.yml/badge.svg?event=push">
</a>
<a href="https://zephyrproject-rtos.github.io/example-application">
<img alt="Documentation" src="https://img.shields.io/badge/documentation-3D578C?logo=sphinx&logoColor=white">
Expand All @@ -15,7 +15,7 @@
<br />
<img width="360" alt="shape_3FWSg8mxSBF3motfyvrGN at 24-08-13 17 33 10" src="https://github.com/user-attachments/assets/c300b66f-24a9-4c4f-a74e-2d8c7c23c4da">

This repository contains a Zephyr example application. The main purpose of this
This repository contains a Zephyr firmware template. The main purpose of this
repository is to serve as a reference on how to structure Zephyr-based
applications. Some of the features demonstrated in this example are:

Expand Down Expand Up @@ -57,12 +57,12 @@ environment. Follow the official
### Initialization

The first step is to initialize the workspace folder (``my-workspace``) where
the ``example-application`` and all Zephyr modules will be cloned. Run the following
the ``firmware-template`` and all Zephyr modules will be cloned. Run the following
command:

```shell
# initialize my-workspace for the panomic-application (main branch)
west init -m git@github.com:Technoculture/panomic-tray-firmware --mr main panomic-workspace
west init -m https://github.com/Technoculture/firmware-template --mr main panomic-workspace
# update Zephyr modules
cd panomic-workspace
west update
Expand Down
2 changes: 1 addition & 1 deletion app/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#-------------------------------------------------------------------------------
# Zephyr Example Application
# Firmware Template
#
# Copyright (c) 2021 Nordic Semiconductor ASA
# SPDX-License-Identifier: Apache-2.0
Expand Down
22 changes: 11 additions & 11 deletions app/boards/nucleo_f302r8.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -5,23 +5,23 @@

/* This devicetree overlay file will be automatically picked by the Zephyr
* build system when building the sample for the nucleo_f302r8 board. It shows
* how the example-application can be built on sample boards already provided
* how the firmware-template can be built on sample boards already provided
* by Zephyr.
*/

/ {
example_sensor: example-sensor {
compatible = "zephyr,example-sensor";
input-gpios = <&gpioc 13 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
};
example_sensor: example-sensor {
compatible = "zephyr,example-sensor";
input-gpios = <&gpioc 13 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
};

blink_led: blink-led {
compatible = "blink-gpio-led";
led-gpios = <&gpiob 13 GPIO_ACTIVE_HIGH>;
blink-period-ms = <1000>;
};
blink_led: blink-led {
compatible = "blink-gpio-led";
led-gpios = <&gpiob 13 GPIO_ACTIVE_HIGH>;
blink-period-ms = <1000>;
};
};

&gpioc {
status = "okay";
status = "okay";
};
4 changes: 2 additions & 2 deletions app/sample.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@
# the Zephyr testing tool. In this file, multiple combinations can be specified,
# so that you can easily test all of them locally or in CI.
sample:
description: Example application
name: example-application
description: Firmware template
name: firmware-template
common:
build_only: true
integration_platforms:
Expand Down
129 changes: 69 additions & 60 deletions app/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -14,67 +14,76 @@
LOG_MODULE_REGISTER(main, CONFIG_APP_LOG_LEVEL);

#define BLINK_PERIOD_MS_STEP 100U
#define BLINK_PERIOD_MS_MAX 1000U
#define BLINK_PERIOD_MS_MAX 1000U

int main(void)
{
int ret;
unsigned int period_ms = BLINK_PERIOD_MS_MAX;
const struct device *sensor, *blink;
struct sensor_value last_val = { 0 }, val;

printk("Zephyr Example Application %s\n", APP_VERSION_STRING);

sensor = DEVICE_DT_GET(DT_NODELABEL(example_sensor));
if (!device_is_ready(sensor)) {
LOG_ERR("Sensor not ready");
return 0;
}

blink = DEVICE_DT_GET(DT_NODELABEL(blink_led));
if (!device_is_ready(blink)) {
LOG_ERR("Blink LED not ready");
return 0;
}

ret = blink_off(blink);
if (ret < 0) {
LOG_ERR("Could not turn off LED (%d)", ret);
return 0;
}

printk("Use the sensor to change LED blinking period\n");

while (1) {
ret = sensor_sample_fetch(sensor);
if (ret < 0) {
LOG_ERR("Could not fetch sample (%d)", ret);
return 0;
}

ret = sensor_channel_get(sensor, SENSOR_CHAN_PROX, &val);
if (ret < 0) {
LOG_ERR("Could not get sample (%d)", ret);
return 0;
}

if ((last_val.val1 == 0) && (val.val1 == 1)) {
if (period_ms == 0U) {
period_ms = BLINK_PERIOD_MS_MAX;
} else {
period_ms -= BLINK_PERIOD_MS_STEP;
}

printk("Proximity detected, setting LED period to %u ms\n",
period_ms);
blink_set_period_ms(blink, period_ms);
}

last_val = val;

k_sleep(K_MSEC(100));
}

return 0;
int ret;
unsigned int period_ms = BLINK_PERIOD_MS_MAX;
const struct device *sensor, *blink;
struct sensor_value last_val = {0}, val;

printk("Firmware Template %s\n", APP_VERSION_STRING);

sensor = DEVICE_DT_GET(DT_NODELABEL(example_sensor));
if (!device_is_ready(sensor))
{
LOG_ERR("Sensor not ready");
return 0;
}

blink = DEVICE_DT_GET(DT_NODELABEL(blink_led));
if (!device_is_ready(blink))
{
LOG_ERR("Blink LED not ready");
return 0;
}

ret = blink_off(blink);
if (ret < 0)
{
LOG_ERR("Could not turn off LED (%d)", ret);
return 0;
}

printk("Use the sensor to change LED blinking period\n");

while (1)
{
ret = sensor_sample_fetch(sensor);
if (ret < 0)
{
LOG_ERR("Could not fetch sample (%d)", ret);
return 0;
}

ret = sensor_channel_get(sensor, SENSOR_CHAN_PROX, &val);
if (ret < 0)
{
LOG_ERR("Could not get sample (%d)", ret);
return 0;
}

if ((last_val.val1 == 0) && (val.val1 == 1))
{
if (period_ms == 0U)
{
period_ms = BLINK_PERIOD_MS_MAX;
}
else
{
period_ms -= BLINK_PERIOD_MS_STEP;
}

printk("Proximity detected, setting LED period to %u ms\n",
period_ms);
blink_set_period_ms(blink, period_ms);
}

last_val = val;

k_sleep(K_MSEC(100));
}

return 0;
}

2 changes: 1 addition & 1 deletion boards/vendor/custom_plank/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@

`custom_plank` board is used to demonstrate how to create custom boards. It is
in fact a simplified version of the nRF52840-DK board, so the
`example-application` can be run on that development kit when using
`firmware-template` can be run on that development kit when using
`custom_plank`.
4 changes: 2 additions & 2 deletions doc/Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ DOXYFILE_ENCODING = UTF-8
# title of most generated pages and in a few other places.
# The default value is: My Project.

PROJECT_NAME = "Example Application"
PROJECT_NAME = "Firmware Template"

# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
# could be handy for archiving the generated documentation or if some version
Expand All @@ -54,7 +54,7 @@ PROJECT_NUMBER = 1.0.0
# for a project that appears at the top of each page and should give viewer a
# quick idea about the purpose of the project. Keep the description short.

PROJECT_BRIEF = A Zephyr-based example application
PROJECT_BRIEF = A Zephyr-based firmware template

# With the PROJECT_LOGO tag one can specify a logo or an icon that is included
# in the documentation. The maximum height of the logo should not exceed 55
Expand Down
4 changes: 2 additions & 2 deletions doc/_doxygen/main.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Introduction

This is the Doxygen documentation for [example-application].
This is the Doxygen documentation for [firmware-template].

[example-application]: https://github.com/zephyrproject-rtos/example-application
[firmware-template]: https://github.com/technoculture/firmware-template
6 changes: 3 additions & 3 deletions doc/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = 'Example Application'
project = 'Firmware Template'
copyright = '2024, The Zephyr Community'
author = 'The Zephyr Community'
release = '1.0.0'
Expand Down Expand Up @@ -35,6 +35,6 @@
# WARNING: please, check breathe maintainership status before using this
# extension in production!

breathe_projects = {'example-application': '_build_doxygen/xml'}
breathe_default_project = 'example-application'
breathe_projects = {'firmware-template': '_build_doxygen/xml'}
breathe_default_project = 'firmware-template'
breathe_default_members = ('members', )
4 changes: 2 additions & 2 deletions doc/index.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Welcome to Example Application's documentation!
Welcome to Firmware Template's documentation!
===============================================

This is a simple Sphinx documentation setup for ``example-application``.
This is a simple Sphinx documentation setup for ``firmware-template``.

.. toctree::
:maxdepth: 2
Expand Down
2 changes: 1 addition & 1 deletion scripts/example_west_command.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

'''example_west_command.py
Example of a west extension in the example-application repository.'''
Example of a west extension in the firmware-template repository.'''

from west.commands import WestCommand # your extension must subclass this
from west import log # use this for user output
Expand Down
2 changes: 1 addition & 1 deletion zephyr/module.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

build:
# Path to the Kconfig file that will be sourced into Zephyr Kconfig tree under
# Zephyr > Modules > example-application. Path is relative from root of this
# Zephyr > Modules > firmware-template. Path is relative from root of this
# repository.
kconfig: Kconfig
# Path to the folder that contains the CMakeLists.txt file to be included by
Expand Down

0 comments on commit 9256f07

Please sign in to comment.