mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
The bulk of this change was tightly coupled and needed to be deleted in one pass. Some of the smaller changes were things that broke as a result of the initial purge and subsequently fixed by further eradicating unnecessary platform differences. Finally, I deleted any dead code I came across in the related files I touched while going through everything.
- DriverFramework (src/lib/DriverFramework submodule) completely removed
- added dspal submodule in qurt platform (was brought in via DriverFramework)
- all df wrapper drivers removed
- all boards using df wrapper drivers updated to use in tree equivalents
- unused empty arch/board.h on posix and qurt removed
- unused IOCTLs removed (pub block, priv, etc)
- Integrator delete methods only used from df wrapper drivers
- commander: sensor calibration use "NuttX version" everywhere for now
- sensors: update to px4_{open, read, close} instead of DevMgr wrapper (adc open for analog differential pressure)
- battery_status: update to px4_{open, read, close} instead of DevMgr wrapper (adc open for analog differential pressure)
- cdev cleanup conflicting typedefs and names with actual OS (pollevent_t, etc)
- load_mon and top remove from linux boards (unused)
- delete unused PX4_MAIN_FUNCTION
- delete unused getreg32 macro
- delete unused SIOCDEVPRIVATE define
- named each platform tasks consistently
- posix list_devices and list_topics removed (list_files now shows all virtual files)
73 lines
1.5 KiB
C++
73 lines
1.5 KiB
C++
/* definitions of builtin command list - automatically generated, do not edit */
|
|
#include <px4_platform_common/time.h>
|
|
#include <px4_platform_common/posix.h>
|
|
#include <px4_platform_common/log.h>
|
|
|
|
#include "apps.h"
|
|
|
|
#include <cstdio>
|
|
#include <map>
|
|
#include <string>
|
|
|
|
#include <cstdlib>
|
|
|
|
#define MODULE_NAME "px4"
|
|
|
|
extern "C" {
|
|
|
|
${builtin_apps_decl_string}
|
|
int shutdown_main(int argc, char *argv[]);
|
|
int list_tasks_main(int argc, char *argv[]);
|
|
int list_files_main(int argc, char *argv[]);
|
|
int sleep_main(int argc, char *argv[]);
|
|
|
|
}
|
|
|
|
void init_app_map(apps_map_type &apps)
|
|
{
|
|
${builtin_apps_string}
|
|
apps["shutdown"] = shutdown_main;
|
|
apps["list_tasks"] = list_tasks_main;
|
|
apps["list_files"] = list_files_main;
|
|
apps["sleep"] = sleep_main;
|
|
}
|
|
|
|
void list_builtins(apps_map_type &apps)
|
|
{
|
|
printf("Builtin Commands:\n");
|
|
for (apps_map_type::iterator it = apps.begin(); it != apps.end(); ++it) {
|
|
printf(" %s\n", it->first.c_str());
|
|
}
|
|
}
|
|
|
|
int shutdown_main(int argc, char *argv[])
|
|
{
|
|
printf("Shutting down\n");
|
|
system_exit(0);
|
|
}
|
|
|
|
int list_tasks_main(int argc, char *argv[])
|
|
{
|
|
px4_show_tasks();
|
|
return 0;
|
|
}
|
|
|
|
int list_files_main(int argc, char *argv[])
|
|
{
|
|
px4_show_files();
|
|
return 0;
|
|
}
|
|
|
|
int sleep_main(int argc, char *argv[])
|
|
{
|
|
if (argc != 2) {
|
|
PX4_WARN( "Usage: sleep <seconds>" );
|
|
return 1;
|
|
}
|
|
|
|
unsigned long usecs = 1000000UL * atol(argv[1]);
|
|
printf("Sleeping for %s s; (%lu us).\n", argv[1], usecs);
|
|
px4_usleep(usecs);
|
|
return 0;
|
|
}
|