File tree Expand file tree Collapse file tree 2 files changed +12
-11
lines changed
hw/drivers/sensors/bmp280 Expand file tree Collapse file tree 2 files changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -42,5 +42,13 @@ pkg.deps.BUS_DRIVER_PRESENT:
4242pkg.req_apis :
4343 - stats
4444
45+ pkg.whole_archive : true
46+
47+ pkg.source_files :
48+ - src/bmp280.c
49+
50+ pkg.source_files.BMP280_CLI :
51+ - src/bmp280_shell.c
52+
4553pkg.deps.BMP280_CLI :
4654 - " @apache-mynewt-core/util/parse"
Original file line number Diff line number Diff line change 3131#include "shell/shell.h"
3232#include "parse/parse.h"
3333
34- static int bmp280_shell_cmd (int argc , char * * argv );
35-
36- static struct shell_cmd bmp280_shell_cmd_struct = {
37- .sc_cmd = "bmp280" ,
38- .sc_cmd_func = bmp280_shell_cmd
39- };
40-
4134#if MYNEWT_VAL (BUS_DRIVER_PRESENT )
4235static struct sensor_itf g_sensor_itf ;
4336#else
@@ -76,7 +69,7 @@ bmp280_shell_err_invalid_arg(char *cmd_name)
7669static int
7770bmp280_shell_help (void )
7871{
79- console_printf ("%s cmd [flags...]\n" , bmp280_shell_cmd_struct . sc_cmd );
72+ console_printf ("bmp280 cmd [flags...]\n" );
8073 console_printf ("cmd:\n" );
8174 console_printf ("\tr [n_samples]\n" );
8275 console_printf ("\tmode [0-sleep | 1/2-forced | 3-normal]\n" );
@@ -434,10 +427,12 @@ static const struct bus_spi_node_cfg bmp280_raw_cfg = {
434427
435428#endif
436429
430+ MAKE_SHELL_CMD (bmp280 , bmp280_shell_cmd , NULL )
431+
437432int
438433bmp280_shell_init (void )
439434{
440- int rc ;
435+ int rc = 0 ;
441436
442437#if MYNEWT_VAL (BUS_DRIVER_PRESENT )
443438 struct os_dev * dev = NULL ;
@@ -457,8 +452,6 @@ bmp280_shell_init(void)
457452 console_printf ("Failed to create bmp280_raw device\n" );
458453 }
459454#endif
460- rc = shell_cmd_register (& bmp280_shell_cmd_struct );
461- SYSINIT_PANIC_ASSERT (rc == 0 );
462455
463456 return rc ;
464457}
You can’t perform that action at this time.
0 commit comments