examples: Add depends on

Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
This commit is contained in:
zhangshoukui 2024-12-31 14:48:22 +08:00 committed by Xiang Xiao
parent 366865723b
commit d404b846f9
26 changed files with 51 additions and 58 deletions

View file

@ -6,6 +6,7 @@
config EXAMPLES_ADXL372_TEST config EXAMPLES_ADXL372_TEST
tristate "ADXL372 test program" tristate "ADXL372 test program"
default n default n
depends on SENSORS_ADXL372
---help--- ---help---
Enable the ADXL372 sensor SPI test program. Enable the ADXL372 sensor SPI test program.

View file

@ -6,6 +6,7 @@
config EXAMPLES_APA102 config EXAMPLES_APA102
tristate "APA102 LED Strip example" tristate "APA102 LED Strip example"
default n default n
depends on LCD_APA102
---help--- ---help---
Enable the APA102 example Enable the APA102 example

View file

@ -6,6 +6,7 @@
config EXAMPLES_BATTERY config EXAMPLES_BATTERY
tristate "Battery monitor example" tristate "Battery monitor example"
default n default n
depends on BATTERY_CHARGER || BATTERY_GAUGE || BATTERY_MONITOR
---help--- ---help---
Enable the battery monitor example Enable the battery monitor example

View file

@ -6,6 +6,7 @@
config EXAMPLES_SIXAXIS config EXAMPLES_SIXAXIS
bool "BMI160 sensor example" bool "BMI160 sensor example"
default n default n
depends on SENSORS_BMG160
---help--- ---help---
Enable the 6 axis sensor example Enable the 6 axis sensor example
@ -14,6 +15,7 @@ if EXAMPLES_SIXAXIS
config EXAMPLES_SIXAXIS_UORB config EXAMPLES_SIXAXIS_UORB
bool "BMI160 sensor uorb example" bool "BMI160 sensor uorb example"
default n default n
depends on SENSORS_BMI160_UORB
---help--- ---help---
Enables Work with the UORB or Character Device interface. Enables Work with the UORB or Character Device interface.
If not set, the Character Device is used by default. If not set, the Character Device is used by default.

View file

@ -6,6 +6,7 @@
config EXAMPLES_CAMERA config EXAMPLES_CAMERA
tristate "Camera example" tristate "Camera example"
default n default n
depends on DRIVERS_VIDEO
---help--- ---help---
Enable the camera example Enable the camera example

View file

@ -6,6 +6,7 @@
config EXAMPLES_CHRONO config EXAMPLES_CHRONO
tristate "Chronometer example to use with STM32LDiscover" tristate "Chronometer example to use with STM32LDiscover"
default n default n
depends on SLCD
---help--- ---help---
Enable the Chronometer example Enable the Chronometer example

View file

@ -6,6 +6,7 @@
config EXAMPLES_DHTXX config EXAMPLES_DHTXX
tristate "Dhtxx sensor example" tristate "Dhtxx sensor example"
default n default n
depends on SENSORS_DHTXX
---help--- ---help---
Enable the dhtxx sensor example Enable the dhtxx sensor example

View file

@ -6,6 +6,7 @@
config EXAMPLES_HDC1008 config EXAMPLES_HDC1008
tristate "HDC1008 driver example" tristate "HDC1008 driver example"
default n default n
depends on SENSORS_HDC1008
---help--- ---help---
Enable the example application Enable the example application

View file

@ -6,6 +6,7 @@
config EXAMPLES_HIDKBD config EXAMPLES_HIDKBD
tristate "USB HID keyboard example" tristate "USB HID keyboard example"
default n default n
depends on USBHOST_HIDKBD
---help--- ---help---
Enable the USB HID keyboard example Enable the USB HID keyboard example

View file

@ -6,6 +6,7 @@
config EXAMPLES_INA219 config EXAMPLES_INA219
tristate "INA219 example" tristate "INA219 example"
default n default n
depends on SENSORS_INA219
---help--- ---help---
Enable the INA219 example Enable the INA219 example

View file

@ -6,6 +6,7 @@
config EXAMPLES_INA226 config EXAMPLES_INA226
tristate "INA226 example" tristate "INA226 example"
default n default n
depends on SENSORS_INA226
---help--- ---help---
Enable the INA226 example Enable the INA226 example

View file

@ -6,6 +6,7 @@
config EXAMPLES_ISL29023 config EXAMPLES_ISL29023
tristate "ISL29023 driver example" tristate "ISL29023 driver example"
default n default n
depends on SENSORS_ISL29023
---help--- ---help---
Enable the example application Enable the example application

View file

@ -6,6 +6,7 @@
config EXAMPLES_LP503X config EXAMPLES_LP503X
tristate "LP503X PWM LED example" tristate "LP503X PWM LED example"
default n default n
depends on LP503X
---help--- ---help---
Enable the LP503X example Enable the LP503X example

View file

@ -6,6 +6,7 @@
config EXAMPLES_LSM330SPI_TEST config EXAMPLES_LSM330SPI_TEST
tristate "LSM330 SPI test program" tristate "LSM330 SPI test program"
default n default n
depends on SENSORS_LSM330SPI
---help--- ---help---
Enable the LSM330 sensor SPI test program. Enable the LSM330 sensor SPI test program.

View file

@ -6,6 +6,7 @@
config EXAMPLES_PCA9635 config EXAMPLES_PCA9635
tristate "PCA9635 PWM LED example" tristate "PCA9635 PWM LED example"
default n default n
depends on PCA9635PW
---help--- ---help---
Enable the PCA9635 example Enable the PCA9635 example

View file

@ -6,6 +6,8 @@
config EXAMPLES_POWERLED config EXAMPLES_POWERLED
tristate "Powerled example" tristate "Powerled example"
default n default n
depends on DRIVERS_POWERLED
depends on LIBC_FLOATINGPOINT
---help--- ---help---
Enable the powerled driver example Enable the powerled driver example

View file

@ -42,24 +42,10 @@
#include <nuttx/power/powerled.h> #include <nuttx/power/powerled.h>
#if defined(CONFIG_EXAMPLES_POWERLED)
#ifndef CONFIG_DRIVERS_POWERLED
# error "Powerled example requires powerled support"
#endif
/**************************************************************************** /****************************************************************************
* Pre-processor Definitions * Pre-processor Definitions
****************************************************************************/ ****************************************************************************/
#ifndef CONFIG_EXAMPLES_POWERLED_CURRENT_LIMIT
# error "LED current limit must be set!"
#endif
#ifndef CONFIG_LIBC_FLOATINGPOINT
# error "CONFIG_LIBC_FLOATINGPOINT must be set!"
#endif
#define DEMO_CONT_BRIGHTNESS_MAX 100.0 #define DEMO_CONT_BRIGHTNESS_MAX 100.0
#define DEMO_CONT_BRIGHTNESS_MIN 0.0 #define DEMO_CONT_BRIGHTNESS_MIN 0.0
#define DEMO_CONT_BRIGHTNESS_STEP 10.0 #define DEMO_CONT_BRIGHTNESS_STEP 10.0
@ -778,4 +764,3 @@ errout:
return 0; return 0;
} }
#endif /* CONFIG_EXAMPLE_POWERLED */

View file

@ -6,6 +6,7 @@
config EXAMPLES_POWERMONITOR config EXAMPLES_POWERMONITOR
tristate "LTC4151 powermonitor example" tristate "LTC4151 powermonitor example"
default n default n
depends on SENSORS_LTC4151
if EXAMPLES_POWERMONITOR if EXAMPLES_POWERMONITOR
endif # EXAMPLES_POWERMONITOR endif # EXAMPLES_POWERMONITOR

View file

@ -6,6 +6,7 @@
config EXAMPLES_RFID_READUID config EXAMPLES_RFID_READUID
tristate "RFID Read UID example" tristate "RFID Read UID example"
default n default n
depends on CL_MFRC522
---help--- ---help---
Enable the RFID READUID example Enable the RFID READUID example

View file

@ -37,15 +37,10 @@
* Pre-processor Definitions * Pre-processor Definitions
****************************************************************************/ ****************************************************************************/
#ifndef CONFIG_CL_MFRC522
# error "CONFIG_CL_MFRC522 is not defined in the configuration"
#endif
#ifndef CONFIG_EXAMPLES_RFID_READUID_DEVNAME #ifndef CONFIG_EXAMPLES_RFID_READUID_DEVNAME
# define CONFIG_EXAMPLES_RFID_READUID_DEVNAME "/dev/rfid0" # define CONFIG_EXAMPLES_RFID_READUID_DEVNAME "/dev/rfid0"
#endif #endif
/**************************************************************************** /****************************************************************************
* Public Functions * Public Functions
****************************************************************************/ ****************************************************************************/

View file

@ -6,6 +6,7 @@
config EXAMPLES_SLCD config EXAMPLES_SLCD
tristate "Segment LCD test" tristate "Segment LCD test"
default n default n
depends on SLCD
---help--- ---help---
Enables a simple test of an alphanumer, segment LCD Enables a simple test of an alphanumer, segment LCD

View file

@ -5,6 +5,8 @@
config EXAMPLES_SMPS config EXAMPLES_SMPS
tristate "Smps example" tristate "Smps example"
depends on DRIVERS_SMPS
depends on LIBC_FLOATINGPOINT
if EXAMPLES_SMPS if EXAMPLES_SMPS

View file

@ -42,20 +42,10 @@
#include <nuttx/fs/fs.h> #include <nuttx/fs/fs.h>
#include <nuttx/power/smps.h> #include <nuttx/power/smps.h>
#if defined(CONFIG_EXAMPLES_SMPS)
#ifndef CONFIG_DRIVERS_SMPS
# error "Smps example requires smps support"
#endif
/**************************************************************************** /****************************************************************************
* Pre-processor Definitions * Pre-processor Definitions
****************************************************************************/ ****************************************************************************/
#ifndef CONFIG_LIBC_FLOATINGPOINT
# error "CONFIG_LIBC_FLOATINGPOINT must be set!"
#endif
#ifndef CONFIG_EXAMPLES_SMPS_TIME_DEFAULT #ifndef CONFIG_EXAMPLES_SMPS_TIME_DEFAULT
# define CONFIG_EXAMPLES_SMPS_TIME_DEFAULT 10 # define CONFIG_EXAMPLES_SMPS_TIME_DEFAULT 10
#endif #endif
@ -637,4 +627,3 @@ errout:
return 0; return 0;
} }
#endif /* CONFIG_EXAMPLE_SMPS */

View file

@ -6,6 +6,7 @@
config EXAMPLES_WS2812 config EXAMPLES_WS2812
tristate "ws2812 Demo Program" tristate "ws2812 Demo Program"
default n default n
depends on WS2812
---help--- ---help---
Enable the ws2812 demo Enable the ws2812 demo

View file

@ -6,6 +6,8 @@
config EXAMPLES_XBC_TEST config EXAMPLES_XBC_TEST
tristate "XBox Controller Test example" tristate "XBox Controller Test example"
default n default n
depends on USBHOST
depends on !USBHOST_INT_DISABLE
---help--- ---help---
Enable the XBox Controller Test example Enable the XBox Controller Test example

View file

@ -53,17 +53,6 @@
/**************************************************************************** /****************************************************************************
* Pre-processor Definitions * Pre-processor Definitions
****************************************************************************/ ****************************************************************************/
/* Configuration ************************************************************/
/* Sanity checking */
#ifndef CONFIG_USBHOST
# error "CONFIG_USBHOST is not defined"
#endif
#ifdef CONFIG_USBHOST_INT_DISABLE
# error "Interrupt endpoints are disabled (CONFIG_USBHOST_INT_DISABLE)"
#endif
/* Provide some default values for other configuration settings */ /* Provide some default values for other configuration settings */
@ -89,7 +78,7 @@ int main(int argc, FAR char *argv[])
* controller test. * controller test.
*/ */
for (;;) for (; ; )
{ {
/* Open the controller device. Loop until the device is successfully /* Open the controller device. Loop until the device is successfully
* opened. * opened.
@ -122,24 +111,33 @@ int main(int argc, FAR char *argv[])
{ {
/* On success, echo the buffer to stdout */ /* On success, echo the buffer to stdout */
printf("%d bytes read\n", nbytes); printf("%zd bytes read\n", nbytes);
if (nbytes == sizeof(struct xbox_controller_buttonstate_s)) if (nbytes == sizeof(struct xbox_controller_buttonstate_s))
{ {
struct xbox_controller_buttonstate_s *rpt = (struct xbox_controller_buttonstate_s*)buffer; struct xbox_controller_buttonstate_s *rpt =
printf("guide: %d sync: %d start: %d back: %d a: %d b: %d x: %d y: %d\n", (FAR struct xbox_controller_buttonstate_s *)buffer;
rpt->guide, rpt->sync, rpt->start, rpt->back, rpt->a, rpt->b, rpt->x, rpt->y); printf("guide: %d sync: %d start: %d back: %d
printf("dpad_u: %d d: %d l: %d r: %d bump_l: %d r: %d stick_l: %d r: %d\n", a: %d b: %d x: %d y: %d\n",
rpt->dpad_up, rpt->dpad_down, rpt->dpad_left, rpt->dpad_right, rpt->guide, rpt->sync, rpt->start,
rpt->bumper_left, rpt->bumper_right, rpt->stick_click_left, rpt->stick_click_right); rpt->back, rpt->a, rpt->b, rpt->x, rpt->y);
printf("stick_left_x: %d y: %d right_x: %d y: %d trigger_l: %d r: %d\n", printf("dpad_u: %d d: %d l: %d r: %d bump_l: %d
rpt->stick_left_x, rpt->stick_left_y, rpt->stick_right_x, rpt->stick_right_y, r: %d stick_l: %d r: %d\n",
rpt->trigger_left, rpt->trigger_right); rpt->dpad_up, rpt->dpad_down, rpt->dpad_left,
} rpt->dpad_right, rpt->bumper_left,
} rpt->bumper_right, rpt->stick_click_left,
rpt->stick_click_right);
printf("stick_left_x: %d y: %d right_x: %d y: %d
trigger_l: %d r: %d\n",
rpt->stick_left_x, rpt->stick_left_y,
rpt->stick_right_x, rpt->stick_right_y,
rpt->trigger_left, rpt->trigger_right);
}
}
} }
while (nbytes > 0); while (nbytes > 0);
printf("Closing device %s: %d\n", CONFIG_EXAMPLES_XBC_DEVNAME, (int)nbytes); printf("Closing device %s: %zd\n", CONFIG_EXAMPLES_XBC_DEVNAME,
nbytes);
fflush(stdout); fflush(stdout);
close(fd); close(fd);
break; break;