Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

support for settings package #942

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
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
4 changes: 4 additions & 0 deletions libs/core/output.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
#include "pxt.h"
#include "ev3const.h"

#include <sys/stat.h>
#include <sys/types.h>

namespace output {

/**
Expand All @@ -17,6 +20,7 @@ Buffer createBuffer(int size) {
namespace pxt {

void target_init() {
mkdir(SETTINGSDIR, 0777);
}

}
Expand Down
2 changes: 2 additions & 0 deletions libs/core/platform.h
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
#define PXT_GC_THREAD_LIST 1

#define PXT_IN_ISR() false

#define SETTINGSDIR "/mnt/ramdisk/settings"
3 changes: 2 additions & 1 deletion libs/ev3/pxt.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,8 @@
"touch-sensor": "file:../touch-sensor",
"ultrasonic-sensor": "file:../ultrasonic-sensor",
"gyro-sensor": "file:../gyro-sensor",
"infrared-sensor": "file:../infrared-sensor"
"infrared-sensor": "file:../infrared-sensor",
"settings": "file:../settings"
},
"palette": [
"#ffffff",
Expand Down
4 changes: 4 additions & 0 deletions libs/settings/pxt.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"name": "settings",
"additionalFilePath": "../../node_modules/pxt-common-packages/libs/settings---files"
}
3 changes: 2 additions & 1 deletion pxtarget.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@
"libs/screen",
"libs/ev3",
"libs/storage",
"libs/broadcast"
"libs/broadcast",
"libs/settings"
],
"simulator": {
"autoRun": true,
Expand Down