mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-02-01 18:30:56 +00:00
chore(ble): cleanup of ble code
This commit is contained in:
parent
f8f4a30a25
commit
58b321a2a2
@ -58,13 +58,13 @@ west update
|
||||
|
||||
|
||||
### Building the Application
|
||||
Build the application for the t3w1_revA_nrf52832 board:
|
||||
```sh
|
||||
cd trezor
|
||||
west build ./trezor-ble -b t3w1_revA_nrf52832 --sysbuild
|
||||
```
|
||||
|
||||
Debug builds can be built using the debug overlay configuration:
|
||||
Build the application for the t3w1_revA_nrf52832 board:
|
||||
```sh
|
||||
cd trezor
|
||||
```sh
|
||||
west build ./trezor-ble -b t3w1_revA_nrf52832 --sysbuild -- -DOVERLAY_CONFIG=debug.conf
|
||||
```
|
||||
|
@ -1,23 +0,0 @@
|
||||
# Copyright (c) 2021 Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
description: |
|
||||
An example sensor that reads the GPIO level defined in input-gpios. The
|
||||
purpose of this sensor is to demonstrate how to create out-of-tree drivers.
|
||||
|
||||
Example definition in devicetree:
|
||||
|
||||
example-sensor {
|
||||
compatible = "zephyr,example-sensor";
|
||||
input-gpios = <&gpio0 0 (GPIO_PULL_UP | GPIO_ACTIVE_LOW)>;
|
||||
};
|
||||
|
||||
compatible: "zephyr,example-sensor"
|
||||
|
||||
include: base.yaml
|
||||
|
||||
properties:
|
||||
input-gpios:
|
||||
type: phandle-array
|
||||
required: true
|
||||
description: Input GPIO to be sensed.
|
@ -1,49 +0,0 @@
|
||||
# Copyright (c) 2019 Foundries.io
|
||||
# Copyright (c) 2022 Nordic Semiconductor ASA
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
'''example_west_command.py
|
||||
|
||||
Example of a west extension in the example-application repository.'''
|
||||
|
||||
from west.commands import WestCommand # your extension must subclass this
|
||||
from west import log # use this for user output
|
||||
|
||||
class ExampleWestCommand(WestCommand):
|
||||
|
||||
def __init__(self):
|
||||
super().__init__(
|
||||
'example-west-command', # gets stored as self.name
|
||||
'an example west extension command', # self.help
|
||||
# self.description:
|
||||
'''\
|
||||
A multi-line description of example-west-command.
|
||||
|
||||
You can split this up into multiple paragraphs and they'll get
|
||||
reflowed for you. You can also pass
|
||||
formatter_class=argparse.RawDescriptionHelpFormatter when calling
|
||||
parser_adder.add_parser() below if you want to keep your line
|
||||
endings.''')
|
||||
|
||||
def do_add_parser(self, parser_adder):
|
||||
# This is a bit of boilerplate, which allows you full control over the
|
||||
# type of argparse handling you want. The "parser_adder" argument is
|
||||
# the return value of an argparse.ArgumentParser.add_subparsers() call.
|
||||
parser = parser_adder.add_parser(self.name,
|
||||
help=self.help,
|
||||
description=self.description)
|
||||
|
||||
# Add some example options using the standard argparse module API.
|
||||
parser.add_argument('-o', '--optional', help='an optional argument')
|
||||
parser.add_argument('required', help='a required argument')
|
||||
|
||||
return parser # gets stored as self.parser
|
||||
|
||||
def do_run(self, args, unknown_args):
|
||||
# This gets called when the user runs the command, e.g.:
|
||||
#
|
||||
# $ west my-command-name -o FOO BAR
|
||||
# --optional is FOO
|
||||
# required is BAR
|
||||
log.inf('--optional is', args.optional)
|
||||
log.inf('required is', args.required)
|
@ -1,6 +0,0 @@
|
||||
west-commands:
|
||||
- file: scripts/example_west_command.py
|
||||
commands:
|
||||
- name: example-west-command
|
||||
class: ExampleWestCommand
|
||||
help: an example west extension command
|
@ -1,8 +0,0 @@
|
||||
# Copyright (c) 2021, Legrand North America, LLC.
|
||||
# SPDX-License-Identifier: Apache-2.0
|
||||
|
||||
cmake_minimum_required(VERSION 3.20.0)
|
||||
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
|
||||
project(app_lib_custom_test)
|
||||
|
||||
target_sources(app PRIVATE src/main.c)
|
@ -1,2 +0,0 @@
|
||||
CONFIG_ZTEST=y
|
||||
CONFIG_CUSTOM=y
|
@ -1,38 +0,0 @@
|
||||
/*
|
||||
* Copyright (c) 2021 Legrand North America, LLC.
|
||||
*
|
||||
* SPDX-License-Identifier: Apache-2.0
|
||||
*/
|
||||
|
||||
/*
|
||||
* @file test custom_lib library
|
||||
*
|
||||
* This suite verifies that the methods provided with the custom_lib
|
||||
* library works correctly.
|
||||
*/
|
||||
|
||||
#include <limits.h>
|
||||
|
||||
#include <zephyr/ztest.h>
|
||||
|
||||
#include <app/lib/custom.h>
|
||||
|
||||
ZTEST(custom_lib, test_get_value) {
|
||||
/* Verify standard behavior */
|
||||
zassert_equal(custom_get_value(INT_MIN), INT_MIN,
|
||||
"get_value failed input of INT_MIN");
|
||||
zassert_equal(custom_get_value(INT_MIN + 1), INT_MIN + 1,
|
||||
"get_value failed input of INT_MIN + 1");
|
||||
zassert_equal(custom_get_value(-1), -1, "get_value failed input of -1");
|
||||
zassert_equal(custom_get_value(1), 1, "get_value failed input of 1");
|
||||
zassert_equal(custom_get_value(INT_MAX - 1), INT_MAX - 1,
|
||||
"get_value failed input of INT_MAX - 1");
|
||||
zassert_equal(custom_get_value(INT_MAX), INT_MAX,
|
||||
"get_value failed input of INT_MAX");
|
||||
|
||||
/* Verify override behavior */
|
||||
zassert_equal(custom_get_value(0), CONFIG_CUSTOM_GET_VALUE_DEFAULT,
|
||||
"get_value failed input of 0");
|
||||
}
|
||||
|
||||
ZTEST_SUITE(custom_lib, NULL, NULL, NULL, NULL, NULL);
|
@ -1,9 +0,0 @@
|
||||
common:
|
||||
tags: extensibility
|
||||
integration_platforms:
|
||||
- custom_plank
|
||||
- qemu_cortex_m0
|
||||
tests:
|
||||
lib.custom: {}
|
||||
lib.custom.non_default:
|
||||
extra_args: CONFIG_CUSTOM_GET_VALUE_DEFAULT=6
|
@ -1,5 +1,5 @@
|
||||
VERSION_MAJOR = 1
|
||||
VERSION_MINOR = 0
|
||||
VERSION_MAJOR = 0
|
||||
VERSION_MINOR = 1
|
||||
PATCHLEVEL = 0
|
||||
VERSION_TWEAK = 0
|
||||
EXTRAVERSION =
|
||||
|
@ -5,7 +5,7 @@
|
||||
*/
|
||||
/ {
|
||||
chosen {
|
||||
nordic,nus-uart = &uart0;
|
||||
trezor,trz-uart = &uart0;
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -5,7 +5,7 @@
|
||||
*/
|
||||
/ {
|
||||
chosen {
|
||||
nordic,nus-uart = &uart0;
|
||||
trezor,trz-uart = &uart0;
|
||||
};
|
||||
};
|
||||
|
||||
|
@ -36,7 +36,7 @@ LOG_MODULE_REGISTER(LOG_MODULE_NAME);
|
||||
#define UART_WAIT_FOR_BUF_DELAY K_MSEC(50)
|
||||
#define UART_WAIT_FOR_RX CONFIG_BT_NUS_UART_RX_WAIT_TIME
|
||||
|
||||
static const struct device *uart = DEVICE_DT_GET(DT_CHOSEN(nordic_nus_uart));
|
||||
static const struct device *uart = DEVICE_DT_GET(DT_CHOSEN(trezor_trz_uart));
|
||||
|
||||
static K_FIFO_DEFINE(fifo_uart_tx_data);
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user