Skip to content

Commit

Permalink
Merge branch 'apache:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
OceanfromXiaomi committed Sep 30, 2024
2 parents 6dc938e + b20f023 commit e82e013
Show file tree
Hide file tree
Showing 8 changed files with 38 additions and 22 deletions.
12 changes: 12 additions & 0 deletions examples/gpio/gpio_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ static void show_usage(FAR const char *progname)
fprintf(stderr, "\t 8: GPIO_INTERRUPT_RISING_PIN\n");
fprintf(stderr, "\t 9: GPIO_INTERRUPT_FALLING_PIN\n");
fprintf(stderr, "\t10: GPIO_INTERRUPT_BOTH_PIN\n");
fprintf(stderr, "\t11: GPIO_INTERRUPT_PIN_WAKEUP\n");
fprintf(stderr, "\t12: GPIO_INTERRUPT_HIGH_PIN_WAKEUP\n");
fprintf(stderr, "\t13: GPIO_INTERRUPT_LOW_PIN_WAKEUP\n");
fprintf(stderr, "\t14: GPIO_INTERRUPT_RISING_PIN_WAKEUP\n");
fprintf(stderr, "\t15: GPIO_INTERRUPT_FALLING_PIN_WAKEUP\n");
fprintf(stderr, "\t16: GPIO_INTERRUPT_BOTH_PIN_WAKEUP\n");
}

/****************************************************************************
Expand Down Expand Up @@ -308,6 +314,12 @@ int main(int argc, FAR char *argv[])
case GPIO_INTERRUPT_RISING_PIN:
case GPIO_INTERRUPT_FALLING_PIN:
case GPIO_INTERRUPT_BOTH_PIN:
case GPIO_INTERRUPT_PIN_WAKEUP:
case GPIO_INTERRUPT_HIGH_PIN_WAKEUP:
case GPIO_INTERRUPT_LOW_PIN_WAKEUP:
case GPIO_INTERRUPT_RISING_PIN_WAKEUP:
case GPIO_INTERRUPT_FALLING_PIN_WAKEUP:
case GPIO_INTERRUPT_BOTH_PIN_WAKEUP:
{
printf(" Interrupt pin: Value=%u\n", invalue);

Expand Down
2 changes: 1 addition & 1 deletion nshlib/nsh_syscmds.c
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ int cmd_pmconfig(FAR struct nsh_vtbl_s *vtbl, int argc, FAR char **argv)
if (argc == 4)
{
ctrl.domain = atoi(argv[3]);
if (ctrl.domain < 0 || ctrl.domain >= CONFIG_PM_NDOMAINS)
if (ctrl.domain >= CONFIG_PM_NDOMAINS)
{
nsh_error(vtbl, g_fmtargrange, argv[3]);
return ERROR;
Expand Down
12 changes: 6 additions & 6 deletions testing/batterydump/Kconfig → system/batterydump/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,26 +3,26 @@
# see the file kconfig-language.txt in the NuttX tools repository.
#
#
config TESTING_BATTERYDUMP
tristate "Battery dump for test"
config SYSTEM_BATTERYDUMP
tristate "Battery dump system tool"
default n
---help---
Enable the battery dump

if TESTING_BATTERYDUMP
if SYSTEM_BATTERYDUMP

config TESTING_BATTERYDUMP_PROGNAME
config SYSTEM_BATTERYDUMP_PROGNAME
string "Program name"
default "batterydump"
---help---
This is the name of the program that will be used when the NSH ELF
program is installed.

config TESTING_BATTERYDUMP_PRIORITY
config SYSTEM_BATTERYDUMP_PRIORITY
int "Battery dump task priority"
default 100

config TESTING_BATTERYDUMP_STACKSIZE
config SYSTEM_BATTERYDUMP_STACKSIZE
int "Battery dump stack size"
default DEFAULT_TASK_STACKSIZE

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
############################################################################
# apps/testing/batterydump/Make.defs
# apps/system/batterydump/Make.defs
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
Expand All @@ -18,6 +18,6 @@
#
############################################################################

ifneq ($(CONFIG_TESTING_BATTERYDUMP),)
CONFIGURED_APPS += $(APPDIR)/testing/batterydump
ifneq ($(CONFIG_SYSTEM_BATTERYDUMP),)
CONFIGURED_APPS += $(APPDIR)/system/batterydump
endif
10 changes: 5 additions & 5 deletions testing/batterydump/Makefile → system/batterydump/Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
############################################################################
# apps/testing/batterydump/Makefile
# apps/system/batterydump/Makefile
#
# Licensed to the Apache Software Foundation (ASF) under one or more
# contributor license agreements. See the NOTICE file distributed with
Expand All @@ -20,10 +20,10 @@

include $(APPDIR)/Make.defs

PROGNAME = $(CONFIG_TESTING_BATTERYDUMP_PROGNAME)
PRIORITY = $(CONFIG_TESTING_BATTERYDUMP_PRIORITY)
STACKSIZE = $(CONFIG_TESTING_BATTERYDUMP_STACKSIZE)
MODULE = $(CONFIG_TESTING_BATTERYDUMP)
PROGNAME = $(CONFIG_SYSTEM_BATTERYDUMP_PROGNAME)
PRIORITY = $(CONFIG_SYSTEM_BATTERYDUMP_PRIORITY)
STACKSIZE = $(CONFIG_SYSTEM_BATTERYDUMP_STACKSIZE)
MODULE = $(CONFIG_SYSTEM_BATTERYDUMP)

MAINSRC = batterydump.c

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/****************************************************************************
* apps/testing/batterydump/batterydump.c
* apps/system/batterydump/batterydump.c
*
* Licensed to the Apache Software Foundation (ASF) under one or more
* contributor license agreements. See the NOTICE file distributed with
Expand Down
4 changes: 3 additions & 1 deletion testing/drivertest/drivertest_pm_runtime.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <stddef.h>
#include <setjmp.h>
#include <string.h>
#include <pthread.h>
#include <cmocka.h>
#include <nuttx/power/pm_runtime.h>

Expand Down
12 changes: 7 additions & 5 deletions testing/drivertest/drivertest_regulator.c
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,10 @@
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
#include <stddef.h>
#include <setjmp.h>
#include <string.h>
#include <pthread.h>
#include <cmocka.h>
#include <nuttx/power/consumer.h>

Expand Down Expand Up @@ -446,18 +448,17 @@ static void test_regulator_supply_4(FAR void **state)
&g_fake_regulator);
assert_false(NULL == g_fake_regulator.rdev);
test = regulator_get(REGULATOR_ID);
assert_false(NULL == test);
assert_true(NULL == test);
g_fake_regulator_supply.state = 0;
ret = regulator_enable(test);
assert_true(ret < 0);
g_fake_regulator_supply.rdev = regulator_register(
&g_fake_regulator_supply_desc,
&g_fake_regulator_ops,
&g_fake_regulator_supply);
assert_false(NULL == g_fake_regulator_supply.rdev);
assert_int_equal(g_fake_regulator_supply.state, 0);
assert_int_equal(g_fake_regulator.state, 0);

test = regulator_get(REGULATOR_ID);
assert_false(NULL == test);
while (cnt--)
{
ret = regulator_enable(test);
Expand Down Expand Up @@ -499,6 +500,7 @@ static void test_regulator_mode(FAR void **state)
int ret = 0;

g_fake_regulator.lpmode = 0;
g_fake_regulator_desc.supply_name = NULL;
g_fake_regulator.rdev = regulator_register(&g_fake_regulator_desc,
&g_fake_regulator_ops,
&g_fake_regulator);
Expand Down

0 comments on commit e82e013

Please sign in to comment.