Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions sys/rshell/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
include $(RIOTBASE)/Makefile.base
10 changes: 10 additions & 0 deletions sys/rshell/Makefile.dep
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
USEMODULE += walltime
USEMODULE += periph_cpuid
USEMODULE += board
USEMODULE += shell
USEMODULE += shell_cmds_default
USEMODULE += ps
# include and auto-initialize all available sensors
USEMODULE += ztimer
USEMODULE += ztimer_msec
USEMODULE += ztimer_sec
78 changes: 78 additions & 0 deletions sys/rshell/main.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
/*
* Copyright (C) 2008, 2009, 2010 Kaspar Schleiser <kaspar@schleiser.de>
* Copyright (C) 2013 INRIA
* Copyright (C) 2013 Ludwig Knüpfer <ludwig.knuepfer@fu-berlin.de>
*
* This file is subject to the terms and conditions of the GNU Lesser
* General Public License v2.1. See the file LICENSE in the top level
* directory for more details.
*/

/**
* @ingroup examples
* @{
*
* @file
* @brief Default application that shows a lot of functionality of RIOT
*
* @author Kaspar Schleiser <kaspar@schleiser.de>
* @author Oliver Hahm <oliver.hahm@inria.fr>
* @author Ludwig Knüpfer <ludwig.knuepfer@fu-berlin.de>
*
* @}
*/
const char* rshell_logo = "\
\e[31m ########## \e[32m \e[0m\n\

Check warning on line 25 in sys/rshell/main.c

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
\e[31m ################ \e[32m \e[0m\n\

Check warning on line 26 in sys/rshell/main.c

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
\e[31m #################### \e[32m \e[0m\n\

Check warning on line 27 in sys/rshell/main.c

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
\e[31m ######### ######## \e[32m \e[0m\n\

Check warning on line 28 in sys/rshell/main.c

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
\e[31m ####### #######\e[32m \e[0m\n\

Check warning on line 29 in sys/rshell/main.c

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
\e[31m ###### ######\e[32m \e[0m\n\

Check warning on line 30 in sys/rshell/main.c

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
\e[31m ###### ######\e[32m \e[0m\n\

Check warning on line 31 in sys/rshell/main.c

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
\e[31m ###### ######\e[32m \e[0m\n\

Check warning on line 32 in sys/rshell/main.c

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
\e[31m ###### #######\e[32m \e[0m\n\

Check warning on line 33 in sys/rshell/main.c

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
\e[31m ###### ####### \e[32m \e[0m\n\

Check warning on line 34 in sys/rshell/main.c

View workflow job for this annotation

GitHub Actions / static-tests

line is longer than 100 characters
\e[31m ###### ######## \e[32m \e[0m\n\
\e[31m ###### ########### \e[32m \e[0m\n\
\e[31m ## ###### ############ \e[32m \e[0m\n\
\e[31m ######### ###### ######### \e[32m \e[0m\n\
\e[31m ########### ##### ## \e[32m \e[0m\n\
\e[31m ######## ##### \e[32m \e[0m\n\
\e[31m ###### ##### \e[32m \e[0m\n\
\e[31m ###### ##### #### \e[32m ++++ +++++ +++++\e[0m\n\
\e[31m###### ###### ##### \e[32m ++++ +++++ +++++\e[0m\n\
\e[31m##### ###### ####### \e[32m ++++++++ ++++ ++++++ +++++++ +++++ +++++\e[0m\n\
\e[31m##### ##### ####### \e[32m++++++++++++ ++++++++++++ ++++++++++++ +++++ +++++\e[0m\n\
\e[31m##### ###### ####### \e[32m++++++ +++++ ++++ +++++ ++++ +++++ +++++\e[0m\n\
\e[31m ##### ####### ####### \e[32m +++++++++++ ++++ ++++ ++++++++++++++ +++++ +++++\e[0m\n\
\e[31m ####### ######## ####### \e[32m +++++++ ++++ ++++ ++++ +++++ +++++\e[0m\n\
\e[31m #################### ###### \e[32m++++++++++++ ++++ ++++ +++++++++++++ +++++ +++++\e[0m\n\
\e[31m ################ ### \e[32m ++++++++++ ++++ ++++ ++++++++++ +++++ +++++\e[0m\n\
\e[31m ########## \e[32m \e[0m\n\
\n\
welcome to Rshell, the RIOTos shell\n\
";

#include <stdio.h>
#include <string.h>

#include "shell.h"
#include "ztimer.h"
#include "net/gnrc/pktdump.h"
#include "net/gnrc.h"
#include "neofetch.h"
#include "auto_init_utils.h"
SHELL_COMMAND(neofetch, "gives information about the OS and (soon) the hardware", infofetch);
void rshell(void)
{

ztimer_sleep(ZTIMER_MSEC, 5000);
(void) puts(rshell_logo);

char line_buf[SHELL_DEFAULT_BUFSIZE];
shell_run(NULL, line_buf, SHELL_DEFAULT_BUFSIZE);
while (true) {

Check failure on line 75 in sys/rshell/main.c

View workflow job for this annotation

GitHub Actions / static-tests

trailing whitespace.
}
}
AUTO_INIT(rshell, 9999);
23 changes: 23 additions & 0 deletions sys/rshell/neofetch.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
#include <stdio.h>
#include <inttypes.h>
#include <walltime.h>
extern const char* riot_logo;
extern const char* riot_version;
extern const char* rshell_version;
extern const char* cpu;
extern const uint32_t ram;
extern const char* board;
int infofetch(int argc, char **argv)
{
(void)argc;
(void)argv;
puts(riot_logo);
puts(riot_version);
puts(rshell_version);
puts(cpu);
printf("\e[0mram: \e[1m%" PRIu32 " KiB\n", ram/1024);
puts(board);
printf("\e[0muptime: \e[1m%" PRIu32 " s\e[0m\n", walltime_uptime(true));

return 0;
}
2 changes: 2 additions & 0 deletions sys/rshell/neofetch.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
#pragma once
int infofetch(int argc, char **arargvgv);
28 changes: 28 additions & 0 deletions sys/rshell/vars.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

const char* riot_logo = "\n\
\e[31m ######## \e[32m \e[0m\n\
\e[31m ############ \e[32m \e[0m\n\
\e[31m ###### ##### \e[32m \e[0m\n\
\e[31m ##### #### \e[32m \e[0m\n\
\e[31m #### #### \e[32m \e[0m\n\
\e[31m #### ##### \e[32m \e[0m\n\
\e[31m #### ###### \e[32m \e[0m\n\
\e[31m #### ######## \e[32m ++ ++++++ +++++++++\e[0m\n\
\e[31m *##### #### ###### \e[32m ++ +++ =+++ +++ \e[0m\n\
\e[31m ######## #### \e[32m ++ +++ ++ +++ \e[0m\n\
\e[31m #### ### \e[32m ++ +++ ++ +++ \e[0m\n\
\e[31m#### ### #### \e[32m ++ +++ ++ +++ \e[0m\n\
\e[31m### ### #### \e[32m ++ +++ ++ +++ \e[0m\n\
\e[31m#### #### #### \e[32m ++ +++ ++ +++ \e[0m\n\
\e[31m##### ##### #### \e[32m ++ +++ +++ +++ \e[0m\n\
\e[31m ############# #### \e[32m ++ ++++++ +++ \e[0m\n\
\e[31m ######### \e[0m\n\
\n\
\e[0m";
#include <stdint.h>
#include <walltime.h>
const char* riot_version = "RIOTos: \e[1m" RIOT_VERSION;
const char* rshell_version = "\e[0mRshell: \e[1m 26.001.001";
const char* cpu = "\e[0mcpu: \e[1m" RIOT_CPU;
const uint32_t ram = CPU_RAM_SIZE;
const char* board = "\e[0mboard: \e[1m" RIOT_BOARD "\e[0m";
Loading