Change formatting rules
All checks were successful
Build ISO image / build-and-deploy (push) Successful in 2m7s
Build documentation / build-and-deploy (push) Successful in 39s

This commit is contained in:
2026-04-24 01:54:48 +02:00
parent 34f7809a2d
commit c8fb575bdd
208 changed files with 6310 additions and 6339 deletions

View File

@@ -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();
}
}