Skip to content

Commit

Permalink
fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
buglloc committed Jun 25, 2024
1 parent 96ab7ac commit baf4d38
Show file tree
Hide file tree
Showing 9 changed files with 19 additions and 12 deletions.
4 changes: 4 additions & 0 deletions boards/holyiot/holyiot_21014/holyiot_21014.dts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@
status = "okay";
};

&uicr {
gpio-as-nreset;
};

&spi0 {
compatible = "nordic,nrf-spi";
status = "okay";
Expand Down
2 changes: 0 additions & 2 deletions boards/holyiot/holyiot_21014/holyiot_21014_defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,6 @@ CONFIG_ARM_MPU=y
CONFIG_HW_STACK_PROTECTION=y

# additional board options
CONFIG_GPIO_AS_PINRESET=y

CONFIG_PINCTRL=y

CONFIG_GPIO=y
Expand Down
6 changes: 6 additions & 0 deletions boards/holyiot/holyiot_21014/pre_dt_board.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Copyright (c) 2022 Nordic Semiconductor
# SPDX-License-Identifier: Apache-2.0

# Suppress "unique_unit_address_if_enabled" to handle the following overlaps:
# - power@40000000 & clock@40000000 & bprot@40000000
list(APPEND EXTRA_DTC_FLAGS "-Wno-unique_unit_address_if_enabled")
4 changes: 2 additions & 2 deletions boards/holyiot_21014.overlay
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/ {
aliases {
sw-gpios = &button0;
led-gpios = &led0_blue;
button-sw = &button0;
button-led = &led0_blue;
};

zephyr,user {
Expand Down
4 changes: 2 additions & 2 deletions boards/xiao_ble.overlay
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

aliases {
sw0 = &button0;
sw-gpios = &button0;
led-gpios = &led2;
button-sw = &button0;
button-led = &led2;
};
};
1 change: 0 additions & 1 deletion prj.conf
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ CONFIG_BT_CTLR_ADV_DATA_LEN_MAX=64

CONFIG_MBEDTLS=y
CONFIG_MBEDTLS_BUILTIN=y
CONFIG_MBEDTLS_HEAP_SIZE=512
CONFIG_MBEDTLS_SHA1=y

CONFIG_PM_DEVICE=y
Expand Down
6 changes: 3 additions & 3 deletions src/batt.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

LOG_MODULE_REGISTER(pw_batt);

#if !DT_NODE_EXISTS(DT_PATH(zephyr_user)) || \
!DT_NODE_HAS_PROP(DT_PATH(zephyr_user), io_channels) || \
!DT_NODE_HAS_PROP(DT_PATH(zephyr_user), io_channels_names)
#if DT_NODE_EXISTS(DT_PATH(zephyr_user)) && \
DT_NODE_HAS_PROP(DT_PATH(zephyr_user), io_channels) && \
DT_NODE_HAS_PROP(DT_PATH(zephyr_user), io_channel_names)

static const struct adc_dt_spec adc_channel = ADC_DT_SPEC_GET_BY_NAME(DT_PATH(zephyr_user), batt);
static uint16_t pw_adc_buf;
Expand Down
2 changes: 1 addition & 1 deletion src/btn.c
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ LOG_MODULE_REGISTER(pw_btn);

#define BUTTON_DEBOUNCE_DELAY_MS 100

#define SW_NODE DT_ALIAS(sw_gpios)
#define SW_NODE DT_ALIAS(button_sw)
#if !DT_NODE_HAS_STATUS(SW_NODE, okay)
#error "Unsupported board: sw0 devicetree alias is not defined"
#endif
Expand Down
2 changes: 1 addition & 1 deletion src/led.c
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

LOG_MODULE_REGISTER(pw_led);

#define LED_NODE DT_ALIAS(led_gpios)
#define LED_NODE DT_ALIAS(button_led)
#if !DT_NODE_HAS_STATUS(LED_NODE, okay)
#error "Unsupported board: led0 devicetree alias is not defined"
#endif
Expand Down

0 comments on commit baf4d38

Please sign in to comment.