summaryrefslogtreecommitdiffstats
path: root/movement
diff options
context:
space:
mode:
authorJoey Castillo <joeycastillo@utexas.edu>2022-05-09 13:01:12 -0400
committerJoey Castillo <joeycastillo@utexas.edu>2022-05-09 13:05:37 -0400
commite71a70d23100c178e7300f1c0bddccfc51d99eb7 (patch)
tree8788e5454860e725dd5ba02c89c69d3834be6a2f /movement
parent22b1ac0283a6aed800ea86960305284199747cdc (diff)
downloadSensor-Watch-e71a70d23100c178e7300f1c0bddccfc51d99eb7.tar.gz
Sensor-Watch-e71a70d23100c178e7300f1c0bddccfc51d99eb7.tar.bz2
Sensor-Watch-e71a70d23100c178e7300f1c0bddccfc51d99eb7.zip
add file browser to movement, remove old app
Diffstat (limited to 'movement')
-rw-r--r--movement/filesystem.c2
-rw-r--r--movement/movement.c4
2 files changed, 5 insertions, 1 deletions
diff --git a/movement/filesystem.c b/movement/filesystem.c
index 2a1319fb..559bd53d 100644
--- a/movement/filesystem.c
+++ b/movement/filesystem.c
@@ -117,9 +117,11 @@ bool filesystem_init(void) {
// reformat if we can't mount the filesystem
// this should only happen on the first boot
if (err) {
+ printf("Ignore that error! Formatting filesystem...\n");
err = lfs_format(&lfs, &cfg);
if (err) return false;
err = lfs_mount(&lfs, &cfg) == LFS_ERR_OK;
+ printf("Filesystem mounted with %d bytes free.\n", filesystem_get_free_space());
}
return err == LFS_ERR_OK;
diff --git a/movement/movement.c b/movement/movement.c
index 72c087e9..3444a378 100644
--- a/movement/movement.c
+++ b/movement/movement.c
@@ -254,6 +254,8 @@ void app_init(void) {
movement_state.next_available_backup_register = 4;
_movement_reset_inactivity_countdown();
+ filesystem_init();
+
#if __EMSCRIPTEN__
int32_t time_zone_offset = EM_ASM_INT({
return -new Date().getTimezoneOffset();
@@ -450,7 +452,7 @@ bool app_loop(void) {
#else
read(0, line, 256);
#endif
- if (strlen(line)) printf(line);
+ if (strlen(line)) filesystem_process_command(line);
}
event.subsecond = 0;