mirror of
https://github.com/apache/nuttx-apps.git
synced 2026-08-01 20:29:00 +00:00
examples: Add depends on
Signed-off-by: zhangshoukui <zhangshoukui@xiaomi.com>
This commit is contained in:
parent
366865723b
commit
d404b846f9
26 changed files with 51 additions and 58 deletions
|
|
@ -6,6 +6,7 @@
|
|||
config EXAMPLES_ADXL372_TEST
|
||||
tristate "ADXL372 test program"
|
||||
default n
|
||||
depends on SENSORS_ADXL372
|
||||
---help---
|
||||
Enable the ADXL372 sensor SPI test program.
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
config EXAMPLES_APA102
|
||||
tristate "APA102 LED Strip example"
|
||||
default n
|
||||
depends on LCD_APA102
|
||||
---help---
|
||||
Enable the APA102 example
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
config EXAMPLES_BATTERY
|
||||
tristate "Battery monitor example"
|
||||
default n
|
||||
depends on BATTERY_CHARGER || BATTERY_GAUGE || BATTERY_MONITOR
|
||||
---help---
|
||||
Enable the battery monitor example
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
config EXAMPLES_SIXAXIS
|
||||
bool "BMI160 sensor example"
|
||||
default n
|
||||
depends on SENSORS_BMG160
|
||||
---help---
|
||||
Enable the 6 axis sensor example
|
||||
|
||||
|
|
@ -14,6 +15,7 @@ if EXAMPLES_SIXAXIS
|
|||
config EXAMPLES_SIXAXIS_UORB
|
||||
bool "BMI160 sensor uorb example"
|
||||
default n
|
||||
depends on SENSORS_BMI160_UORB
|
||||
---help---
|
||||
Enables Work with the UORB or Character Device interface.
|
||||
If not set, the Character Device is used by default.
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
config EXAMPLES_CAMERA
|
||||
tristate "Camera example"
|
||||
default n
|
||||
depends on DRIVERS_VIDEO
|
||||
---help---
|
||||
Enable the camera example
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
config EXAMPLES_CHRONO
|
||||
tristate "Chronometer example to use with STM32LDiscover"
|
||||
default n
|
||||
depends on SLCD
|
||||
---help---
|
||||
Enable the Chronometer example
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
config EXAMPLES_DHTXX
|
||||
tristate "Dhtxx sensor example"
|
||||
default n
|
||||
depends on SENSORS_DHTXX
|
||||
---help---
|
||||
Enable the dhtxx sensor example
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
config EXAMPLES_HDC1008
|
||||
tristate "HDC1008 driver example"
|
||||
default n
|
||||
depends on SENSORS_HDC1008
|
||||
---help---
|
||||
Enable the example application
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
config EXAMPLES_HIDKBD
|
||||
tristate "USB HID keyboard example"
|
||||
default n
|
||||
depends on USBHOST_HIDKBD
|
||||
---help---
|
||||
Enable the USB HID keyboard example
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
config EXAMPLES_INA219
|
||||
tristate "INA219 example"
|
||||
default n
|
||||
depends on SENSORS_INA219
|
||||
---help---
|
||||
Enable the INA219 example
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
config EXAMPLES_INA226
|
||||
tristate "INA226 example"
|
||||
default n
|
||||
depends on SENSORS_INA226
|
||||
---help---
|
||||
Enable the INA226 example
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
config EXAMPLES_ISL29023
|
||||
tristate "ISL29023 driver example"
|
||||
default n
|
||||
depends on SENSORS_ISL29023
|
||||
---help---
|
||||
Enable the example application
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
config EXAMPLES_LP503X
|
||||
tristate "LP503X PWM LED example"
|
||||
default n
|
||||
depends on LP503X
|
||||
---help---
|
||||
Enable the LP503X example
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
config EXAMPLES_LSM330SPI_TEST
|
||||
tristate "LSM330 SPI test program"
|
||||
default n
|
||||
depends on SENSORS_LSM330SPI
|
||||
---help---
|
||||
Enable the LSM330 sensor SPI test program.
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
config EXAMPLES_PCA9635
|
||||
tristate "PCA9635 PWM LED example"
|
||||
default n
|
||||
depends on PCA9635PW
|
||||
---help---
|
||||
Enable the PCA9635 example
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@
|
|||
config EXAMPLES_POWERLED
|
||||
tristate "Powerled example"
|
||||
default n
|
||||
depends on DRIVERS_POWERLED
|
||||
depends on LIBC_FLOATINGPOINT
|
||||
---help---
|
||||
Enable the powerled driver example
|
||||
|
||||
|
|
|
|||
|
|
@ -42,24 +42,10 @@
|
|||
|
||||
#include <nuttx/power/powerled.h>
|
||||
|
||||
#if defined(CONFIG_EXAMPLES_POWERLED)
|
||||
|
||||
#ifndef CONFIG_DRIVERS_POWERLED
|
||||
# error "Powerled example requires powerled support"
|
||||
#endif
|
||||
|
||||
/****************************************************************************
|
||||
* 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_MIN 0.0
|
||||
#define DEMO_CONT_BRIGHTNESS_STEP 10.0
|
||||
|
|
@ -778,4 +764,3 @@ errout:
|
|||
return 0;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_EXAMPLE_POWERLED */
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
config EXAMPLES_POWERMONITOR
|
||||
tristate "LTC4151 powermonitor example"
|
||||
default n
|
||||
depends on SENSORS_LTC4151
|
||||
|
||||
if EXAMPLES_POWERMONITOR
|
||||
endif # EXAMPLES_POWERMONITOR
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
config EXAMPLES_RFID_READUID
|
||||
tristate "RFID Read UID example"
|
||||
default n
|
||||
depends on CL_MFRC522
|
||||
---help---
|
||||
Enable the RFID READUID example
|
||||
|
||||
|
|
|
|||
|
|
@ -37,15 +37,10 @@
|
|||
* Pre-processor Definitions
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef CONFIG_CL_MFRC522
|
||||
# error "CONFIG_CL_MFRC522 is not defined in the configuration"
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_EXAMPLES_RFID_READUID_DEVNAME
|
||||
# define CONFIG_EXAMPLES_RFID_READUID_DEVNAME "/dev/rfid0"
|
||||
#endif
|
||||
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
config EXAMPLES_SLCD
|
||||
tristate "Segment LCD test"
|
||||
default n
|
||||
depends on SLCD
|
||||
---help---
|
||||
Enables a simple test of an alphanumer, segment LCD
|
||||
|
||||
|
|
|
|||
|
|
@ -5,6 +5,8 @@
|
|||
|
||||
config EXAMPLES_SMPS
|
||||
tristate "Smps example"
|
||||
depends on DRIVERS_SMPS
|
||||
depends on LIBC_FLOATINGPOINT
|
||||
|
||||
if EXAMPLES_SMPS
|
||||
|
||||
|
|
|
|||
|
|
@ -42,20 +42,10 @@
|
|||
#include <nuttx/fs/fs.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
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef CONFIG_LIBC_FLOATINGPOINT
|
||||
# error "CONFIG_LIBC_FLOATINGPOINT must be set!"
|
||||
#endif
|
||||
|
||||
#ifndef CONFIG_EXAMPLES_SMPS_TIME_DEFAULT
|
||||
# define CONFIG_EXAMPLES_SMPS_TIME_DEFAULT 10
|
||||
#endif
|
||||
|
|
@ -637,4 +627,3 @@ errout:
|
|||
return 0;
|
||||
}
|
||||
|
||||
#endif /* CONFIG_EXAMPLE_SMPS */
|
||||
|
|
|
|||
|
|
@ -6,6 +6,7 @@
|
|||
config EXAMPLES_WS2812
|
||||
tristate "ws2812 Demo Program"
|
||||
default n
|
||||
depends on WS2812
|
||||
---help---
|
||||
Enable the ws2812 demo
|
||||
|
||||
|
|
|
|||
|
|
@ -6,6 +6,8 @@
|
|||
config EXAMPLES_XBC_TEST
|
||||
tristate "XBox Controller Test example"
|
||||
default n
|
||||
depends on USBHOST
|
||||
depends on !USBHOST_INT_DISABLE
|
||||
---help---
|
||||
Enable the XBox Controller Test example
|
||||
|
||||
|
|
|
|||
|
|
@ -53,17 +53,6 @@
|
|||
/****************************************************************************
|
||||
* 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 */
|
||||
|
||||
|
|
@ -89,7 +78,7 @@ int main(int argc, FAR char *argv[])
|
|||
* controller test.
|
||||
*/
|
||||
|
||||
for (;;)
|
||||
for (; ; )
|
||||
{
|
||||
/* Open the controller device. Loop until the device is successfully
|
||||
* opened.
|
||||
|
|
@ -122,24 +111,33 @@ int main(int argc, FAR char *argv[])
|
|||
{
|
||||
/* On success, echo the buffer to stdout */
|
||||
|
||||
printf("%d bytes read\n", nbytes);
|
||||
if (nbytes == sizeof(struct xbox_controller_buttonstate_s))
|
||||
{
|
||||
struct xbox_controller_buttonstate_s *rpt = (struct xbox_controller_buttonstate_s*)buffer;
|
||||
printf("guide: %d sync: %d start: %d back: %d a: %d b: %d x: %d y: %d\n",
|
||||
rpt->guide, rpt->sync, rpt->start, rpt->back, rpt->a, rpt->b, rpt->x, rpt->y);
|
||||
printf("dpad_u: %d d: %d l: %d r: %d bump_l: %d r: %d stick_l: %d r: %d\n",
|
||||
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);
|
||||
}
|
||||
}
|
||||
printf("%zd bytes read\n", nbytes);
|
||||
if (nbytes == sizeof(struct xbox_controller_buttonstate_s))
|
||||
{
|
||||
struct xbox_controller_buttonstate_s *rpt =
|
||||
(FAR struct xbox_controller_buttonstate_s *)buffer;
|
||||
printf("guide: %d sync: %d start: %d back: %d
|
||||
a: %d b: %d x: %d y: %d\n",
|
||||
rpt->guide, rpt->sync, rpt->start,
|
||||
rpt->back, rpt->a, rpt->b, rpt->x, rpt->y);
|
||||
printf("dpad_u: %d d: %d l: %d r: %d bump_l: %d
|
||||
r: %d stick_l: %d r: %d\n",
|
||||
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);
|
||||
|
||||
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);
|
||||
close(fd);
|
||||
break;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue