This commit is contained in:
Peli de Halleux 2016-02-08 17:53:28 -08:00
Родитель f277dc8adc
Коммит 88da53e583
7 изменённых файлов: 12 добавлений и 48 удалений

1
.vscode/settings.json поставляемый
Просмотреть файл

@ -1,5 +1,6 @@
// Place your settings in this file to overwrite default and user settings.
{
"files.autoSave": "afterDelay",
"editor.formatOnType": true,
"search.exclude": {
"yotta_modules/**":true,

Просмотреть файл

@ -565,26 +565,12 @@
"args": 1,
"full": "bitvm::bitvm_micro_bit::createReadOnlyImage"
},
{
"proto": "StringData* micro_bit::datagramReceive (); ",
"name": "micro_bit::datagramReceive",
"type": "F",
"args": 0,
"full": "bitvm::bitvm_micro_bit::datagramReceive"
},
{
"proto": "int micro_bit::datagramReceiveNumber (); ",
"name": "micro_bit::datagramReceiveNumber",
"type": "F",
"args": 0
},
{
"proto": "void micro_bit::datagramSend (StringData* msg); ",
"name": "micro_bit::datagramSend",
"type": "P",
"args": 1,
"full": "bitvm::bitvm_micro_bit::datagramSend"
},
{
"proto": "void micro_bit::datagramSendNumber (int value); ",
"name": "micro_bit::datagramSendNumber",
@ -1607,8 +1593,10 @@
"MICROBIT_ID_THERMOMETER": 28,
"MICROBIT_ID_RADIO": 29,
"MICROBIT_ID_RADIO_DATA_READY": 30,
"MICROBIT_ID_NOTIFY": 1023,
"MICROBIT_ID_MULTIBUTTON_ATTACH": 31,
"MICROBIT_ID_MESSAGE_BUS_LISTENER": 1021,
"MICROBIT_ID_NOTIFY_ONE": 1022,
"MICROBIT_ID_NOTIFY": 1023,
"MICROBIT_STACK_SIZE": 2048,
"MICROBIT_HEAP_BLOCK_SIZE": 4,
"MICROBIT_HEAP_REUSE_SD": 1,
@ -1619,6 +1607,7 @@
"MICROBIT_BLE_ENABLED": 1,
"MICROBIT_BLE_PAIRING_MODE": 1,
"MICROBIT_BLE_PRIVATE_ADDRESSES": 0,
"MICROBIT_BLE_OPEN": 0,
"MICROBIT_BLE_WHITELIST": 1,
"MICROBIT_BLE_ADVERTISING_TIMEOUT": 0,
"MICROBIT_BLE_DEFAULT_TX_POWER": 0,

Просмотреть файл

@ -83,9 +83,7 @@
(uint32_t)(void*)::bitvm::bitvm_micro_bit::createImage, // F1 over {shim:micro_bit::createImage}
(uint32_t)(void*)::bitvm::bitvm_micro_bit::createImageFromString, // F1 over {shim:micro_bit::createImageFromString}
(uint32_t)(void*)::bitvm::bitvm_micro_bit::createReadOnlyImage, // F1 over {shim:micro_bit::createReadOnlyImage}
(uint32_t)(void*)::bitvm::bitvm_micro_bit::datagramReceive, // F0 over {shim:micro_bit::datagramReceive}
(uint32_t)(void*)::touch_develop::micro_bit::datagramReceiveNumber, // F0 {shim:micro_bit::datagramReceiveNumber}
(uint32_t)(void*)::bitvm::bitvm_micro_bit::datagramSend, // P1 over {shim:micro_bit::datagramSend}
(uint32_t)(void*)::touch_develop::micro_bit::datagramSendNumber, // P1 {shim:micro_bit::datagramSendNumber}
(uint32_t)(void*)::touch_develop::micro_bit::datagramSendNumbers, // P4 {shim:micro_bit::datagramSendNumbers}
(uint32_t)(void*)::touch_develop::micro_bit::devices::alert, // P1 {shim:micro_bit::devices::alert}

Просмотреть файл

@ -340,11 +340,6 @@ namespace touch_develop {
void broadcastMessage(int message);
void onBroadcastMessageReceived(int message, function<void()> f);
void datagramSend(ManagedString msg);
ManagedString datagramReceive();
// -------------------------------------------------------------------------
// Buttons
// -------------------------------------------------------------------------
@ -475,8 +470,6 @@ namespace touch_develop {
void datagramSendNumber(int value);
void datagramSendNumbers(int value0, int value1, int value2, int value3);
int datagramReceiveNumber();
void datagramSend(ManagedString s);
ManagedString datagramReceive();
void onDatagramReceived(function<void()> f);
namespace devices {

Просмотреть файл

@ -16,7 +16,7 @@
}
],
"dependencies": {
"microbit-dal": "lancaster-university/microbit-dal#v1.4.14"
"microbit-dal": "lancaster-university/microbit-dal#v1.4.15"
},
"targetDependencies": { },
"bin": "./source",

Просмотреть файл

@ -282,18 +282,6 @@ namespace touch_develop {
return datagramBuf[0];
}
void datagramSend(ManagedString msg) {
if (radioEnable() != MICROBIT_OK) return;
uBit.radio.datagram.send(msg);
}
ManagedString datagramReceive() {
if (radioEnable() != MICROBIT_OK) return ManagedString("");
return uBit.radio.datagram.recv();
}
void onDatagramReceived(function<void()> f) {
if (radioEnable() != MICROBIT_OK) return;

Просмотреть файл

@ -537,14 +537,6 @@ namespace bitvm {
registerWithDal(MES_BROADCAST_GENERAL_ID, message, f);
}
void datagramSend(StringData* msg) {
::touch_develop::micro_bit::datagramSend(ManagedString(msg));
}
StringData* datagramReceive() {
return ::touch_develop::micro_bit::datagramReceive().leakData();
}
void onDatagramReceived(Action f) {
if (f != 0 && ::touch_develop::micro_bit::radioEnable() == MICROBIT_OK) {
registerWithDal(MICROBIT_ID_RADIO, MICROBIT_RADIO_EVT_DATAGRAM, f);
@ -813,9 +805,12 @@ namespace bitvm {
// properly prepends a call to [internal_main].
// ::touch_develop::internal_main();
//
// unique group for radio based on source hash
::touch_develop::micro_bit::radioDefaultGroup = programHash();
// repeat error 4 times and restart as needed
uBit.display.setErrorTimeout(4);
uint32_t ver = *pc++;
checkStr(ver == 0x4207, ":( Bad runtime version");
numGlobals = *pc++;