Skip to content

Commit

Permalink
fix: hello world for readme
Browse files Browse the repository at this point in the history
  • Loading branch information
KRVPerera committed Nov 21, 2023
1 parent 18f6780 commit 4b6cdd7
Show file tree
Hide file tree
Showing 3 changed files with 26 additions and 33 deletions.
12 changes: 7 additions & 5 deletions hello_world_experiment.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,22 +6,24 @@ if [ -n "$IOT_LAB_FRONTEND_FQDN" ]; then
source /opt/riot.source
fi


build_firmware ${SENSE_HOME}/tutorials_riotos/hello-world
build_status=$?
if [ $build_status -ne 0 ]; then
exit $build_status
fi
echo tutorials_riotos/hello-world/bin/${ARCH}/hello-world.elf
NODE=361

exit 0
NODE=100

if [ -n "$IOT_LAB_FRONTEND_FQDN" ]; then
cp tutorials_riotos/hello-world/bin/${ARCH}/hello-world.elf ${SENSE_FIRMWARE_HOME}

n_json=$(iotlab-experiment submit -n hello_gp_12 -d 1 -l grenoble,m3,${NODE},${SENSE_FIRMWARE_HOME}/hello-world.elf)
n_json=$(iotlab-experiment submit -n hello_gp_12 -d 5 -l grenoble,m3,${NODE},${SENSE_FIRMWARE_HOME}/hello-world.elf)
n_node_job_id=$(echo $n_json | jq '.id')

create_stopper_script $n_node_job_id
wait_for_job "${n_node_job_id}"

echo "$ nc m3-${NODE} 20000"
echo "$ help"
echo "$ restart"
nc m3-${NODE} 20000
Expand Down
2 changes: 2 additions & 0 deletions tutorials_riotos/hello-world/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ RIOTBASE ?= ../../external/RIOT

USEMODULE += shell
USEMODULE += shell_cmds_default
USEMODULE += ps
USEMODULE += ztimer_msec

# Comment this out to disable code in RIOT that does safety checking
# which is not needed in a production environment but helps in the
Expand Down
45 changes: 17 additions & 28 deletions tutorials_riotos/hello-world/main.c
Original file line number Diff line number Diff line change
@@ -1,35 +1,24 @@
/*
* Copyright (C) 2014 Freie Universität Berlin
*
* 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 Hello World application
*
* @author Kaspar Schleiser <kaspar@schleiser.de>
* @author Ludwig Knüpfer <ludwig.knuepfer@fu-berlin.de>
*
* @}
*/

#include <stdio.h>
#include "ztimer.h"

int main(void)
{
puts("Hello World!");
puts("##########################################");
puts("####### This is group 12 talking #########");
puts("##########################################");
int sequence = 0;
while (1)
{
puts("");
puts("#-------------------------------------------------------#");
printf("#----- This is group 12 talking Hello world - (%4d) --#\n", sequence);
puts("#-------------------------------------------------------#\n");

printf("You are running RIOT on a(n) %s board.\n", RIOT_BOARD);
printf("This board features a(n) %s MCU.\n", RIOT_MCU);
sequence += 1;
if (sequence > 1000) {
sequence = 0;
}
ztimer_sleep(ZTIMER_MSEC, 1000);
}

printf("You are running RIOT on a(n) %s board.\n", RIOT_BOARD);
printf("This board features a(n) %s MCU.\n", RIOT_MCU);

return 0;
}

0 comments on commit 4b6cdd7

Please sign in to comment.