Compare commits

..

4 Commits

Author SHA1 Message Date
Michal Moskal
1c37bea54a Make settings compile 2019-10-09 08:53:48 -07:00
Peli de Halleux
b653e54917 support for settings package 2019-10-09 08:12:22 -07:00
Peli de Halleux
fb5776ec41 1.4.2 2019-10-08 22:19:50 -07:00
Peli de Halleux
d852fd961b fix python build 2019-10-08 22:19:34 -07:00
7 changed files with 19 additions and 5 deletions

View File

@@ -208,12 +208,14 @@ namespace sensors.internal {
} }
} }
export function getBatteryInfo(): { export interface BatteryInfo {
level: number; level: number;
Ibatt: number, Ibatt: number,
Vbatt: number, Vbatt: number,
Imotor: number Imotor: number
} { }
export function getBatteryInfo(): BatteryInfo {
init(); init();
if (!batteryInfo) updateBatteryInfo(); if (!batteryInfo) updateBatteryInfo();
const CinCnt = batteryInfo.CinCnt; const CinCnt = batteryInfo.CinCnt;

View File

@@ -1,6 +1,9 @@
#include "pxt.h" #include "pxt.h"
#include "ev3const.h" #include "ev3const.h"
#include <sys/stat.h>
#include <sys/types.h>
namespace output { namespace output {
/** /**
@@ -17,6 +20,7 @@ Buffer createBuffer(int size) {
namespace pxt { namespace pxt {
void target_init() { void target_init() {
mkdir(SETTINGSDIR, 0777);
} }
} }

View File

@@ -1,3 +1,5 @@
#define PXT_GC_THREAD_LIST 1 #define PXT_GC_THREAD_LIST 1
#define PXT_IN_ISR() false #define PXT_IN_ISR() false
#define SETTINGSDIR "/mnt/ramdisk/settings"

View File

@@ -23,7 +23,8 @@
"touch-sensor": "file:../touch-sensor", "touch-sensor": "file:../touch-sensor",
"ultrasonic-sensor": "file:../ultrasonic-sensor", "ultrasonic-sensor": "file:../ultrasonic-sensor",
"gyro-sensor": "file:../gyro-sensor", "gyro-sensor": "file:../gyro-sensor",
"infrared-sensor": "file:../infrared-sensor" "infrared-sensor": "file:../infrared-sensor",
"settings": "file:../settings"
}, },
"palette": [ "palette": [
"#ffffff", "#ffffff",

4
libs/settings/pxt.json Normal file
View File

@@ -0,0 +1,4 @@
{
"name": "settings",
"additionalFilePath": "../../node_modules/pxt-common-packages/libs/settings---files"
}

View File

@@ -1,6 +1,6 @@
{ {
"name": "pxt-ev3", "name": "pxt-ev3",
"version": "1.4.1", "version": "1.4.2",
"description": "LEGO MINDSTORMS EV3 for Microsoft MakeCode", "description": "LEGO MINDSTORMS EV3 for Microsoft MakeCode",
"private": false, "private": false,
"keywords": [ "keywords": [

View File

@@ -18,7 +18,8 @@
"libs/screen", "libs/screen",
"libs/ev3", "libs/ev3",
"libs/storage", "libs/storage",
"libs/broadcast" "libs/broadcast",
"libs/settings"
], ],
"simulator": { "simulator": {
"autoRun": true, "autoRun": true,