Skip to content

Commit 38425e6

Browse files
committed
examples: tests: app_loader: clean up
1 parent e99a76f commit 38425e6

File tree

9 files changed

+46
-1132
lines changed

9 files changed

+46
-1132
lines changed

examples/tests/app_loader/abort-test/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ When Button 1 (Default user button on boards) is pressed, the app tried to load
88

99
When Button 2 is pressed, the app tries to load in the `adc` app.
1010

11-
When button 3 is pressed, the app requests kernel to abort - the kernel deallocates
12-
resources for the app. The userland app then waits for another button press from the
11+
When button 3 is pressed, the app requests kernel to abort.
12+
The userland app then waits for another button press from the
1313
user.
1414

1515
Not pressing button 3 will write and load an app.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#include <app_binaries.h>
1+
#include "app_binaries.h"
22

33
// Tock Application Binary to be flashed.
44
uint8_t blink[] = {0x2, 0x0, 0x34, 0x0, 0x0, 0x8, 0x0, 0x0, 0x1, 0x0, 0x0, 0x0, 0xD7, 0x75, 0x50, 0x6E,

examples/tests/app_loader/abort-test/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include <stdio.h>
1111
#include <string.h>
1212

13-
#include <examples/tests/app_loader/button-press-loading/pre-compiled-binaries/app_binaries.h>
13+
#include "app_binaries.h"
1414
#include <libtock-sync/services/alarm.h>
1515
#include <libtock/interface/button.h>
1616
#include <libtock/kernel/app_loader.h>
@@ -61,7 +61,7 @@ static void app_finalize_done_callback(__attribute__((unused)) int arg0,
6161
finalize_done = true;
6262
}
6363

64-
static void app_load_done_callback(__attribute__((unused)) int arg0,
64+
static void app_load_done_callback(int arg0,
6565
__attribute__((unused)) int arg1,
6666
__attribute__((unused)) int arg2,
6767
__attribute__((unused)) void* ud) {

examples/tests/app_loader/button-press-loading/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,3 +9,4 @@ C_SRCS := $(wildcard *.c)
99
# Include userland master makefile. Contains rules and flags for actually
1010
# building the application.
1111
include $(TOCK_USERLAND_BASE_DIR)/AppMakefile.mk
12+
ELF2TAB_ARGS += --sha256

examples/tests/app_loader/abort-test/pre-compiled-binaries/app_binaries.c renamed to examples/tests/app_loader/button-press-loading/app_binaries.c

Lines changed: 3 additions & 626 deletions
Large diffs are not rendered by default.

examples/tests/app_loader/button-press-loading/main.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
#include <stdio.h>
1111
#include <string.h>
1212

13-
#include <examples/tests/app_loader/button-press-loading/pre-compiled-binaries/app_binaries.h>
13+
#include "app_binaries.h"
1414
#include <libtock-sync/services/alarm.h>
1515
#include <libtock/interface/button.h>
1616
#include <libtock/kernel/app_loader.h>
@@ -22,7 +22,7 @@
2222

2323
static bool setup_done = false; // to check if setup is done
2424
static bool write_done = false; // to check if writing to flash is done
25-
static bool finalize_done = false; // to check if the kernel is done finalizing the process binary
25+
static bool finalize_done = false; // to check if the kernel is done finalizing the process binary
2626
static bool load_done = false; // to check if the process was loaded successfully
2727
static bool button_press = false;
2828

@@ -88,7 +88,7 @@ static void button_callback(__attribute__ ((unused)) returncode_t retval, int bt
8888
if (pressed == 1) {
8989
const char* app_name = NULL;
9090
unsigned char* app_data = NULL;
91-
double app_size = 0;
91+
size_t app_size = 0;
9292

9393
switch (btn_num) {
9494
case BUTTON1:
@@ -106,6 +106,7 @@ static void button_callback(__attribute__ ((unused)) returncode_t retval, int bt
106106
return;
107107
}
108108
printf("[Event] Button for %s Pressed!\n", app_name);
109+
printf("size: %d\n", app_size);
109110

110111
int ret = libtock_app_loader_setup(app_size);
111112
if (ret != RETURNCODE_SUCCESS) {

examples/tests/app_loader/tock-welcomes-dpl/main.c

Lines changed: 33 additions & 498 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)