Change formatting rules
This commit is contained in:
@@ -13,36 +13,36 @@ static const char* device_types_str[] = {
|
||||
[DEVICE_TYPE_USB_CTRL] = "USB controller",
|
||||
};
|
||||
|
||||
static void list_all_devices (void) {
|
||||
struct device_info* infos = malloc (sizeof (struct device_info) * 1024);
|
||||
memset (infos, 0, sizeof (struct device_info) * 1024);
|
||||
static void list_all_devices(void) {
|
||||
struct device_info* infos = malloc(sizeof(struct device_info) * 1024);
|
||||
memset(infos, 0, sizeof(struct device_info) * 1024);
|
||||
|
||||
int device_count = get_device_info (infos, 1024);
|
||||
int device_count = get_device_info(infos, 1024);
|
||||
|
||||
mprintf ("%-30s %-20s\n", "NAME", "TYPE");
|
||||
mprintf("%-30s %-20s\n", "NAME", "TYPE");
|
||||
for (int dev = 0; dev < device_count; dev++) {
|
||||
struct device_info* info = &infos[dev];
|
||||
|
||||
mprintf ("%-30s %-20s\n", info->key, device_types_str[info->type]);
|
||||
mprintf("%-30s %-20s\n", info->key, device_types_str[info->type]);
|
||||
}
|
||||
}
|
||||
|
||||
void app_main (void) {
|
||||
void app_main(void) {
|
||||
char commandbuf[32];
|
||||
memset (commandbuf, 0, sizeof (commandbuf));
|
||||
memset(commandbuf, 0, sizeof(commandbuf));
|
||||
|
||||
if (env_get (process_get_pgid (), "help", (void*)commandbuf, sizeof (commandbuf)) == ST_OK) {
|
||||
mprintf ("devices -C command\n");
|
||||
mprintf ("commands: list_all\n");
|
||||
if (env_get(process_get_pgid(), "help", (void*)commandbuf, sizeof(commandbuf)) == ST_OK) {
|
||||
mprintf("devices -C command\n");
|
||||
mprintf("commands: list_all\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (env_get (process_get_pgid (), "C", (void*)commandbuf, sizeof (commandbuf)) != ST_OK) {
|
||||
mprintf ("ERROR C=???. No command provided\n");
|
||||
if (env_get(process_get_pgid(), "C", (void*)commandbuf, sizeof(commandbuf)) != ST_OK) {
|
||||
mprintf("ERROR C=???. No command provided\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (strcmp (commandbuf, "list_all") == 0) {
|
||||
list_all_devices ();
|
||||
if (strcmp(commandbuf, "list_all") == 0) {
|
||||
list_all_devices();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user