Support latest PXT with GC (#1798)

* Enable gc and basic compilation fixes

* Add missing GC stuff

* Set microbit-dal version

* Disable jacdac in servo

* UTF fixes

* TS build fixes

* Auto-generated files update

* We only seem to have that much

* Fix for new new compiler

* Account for uninitialized scheduler

* Intialize memory allocator

* bump references

* updated package

* Set image tag, requires https://github.com/Microsoft/pxt/pull/5262

* updated project summaries

* Fixing block tests
This commit is contained in:
Michał Moskal
2019-02-21 15:41:32 -08:00
committed by GitHub
parent 040b699a27
commit 71d98822ae
26 changed files with 330 additions and 124 deletions

View File

@ -92,13 +92,13 @@ namespace radio {
}
uint8_t copyStringValue(uint8_t* buf, String data, uint8_t maxLength) {
uint8_t len = min_(maxLength, data->length);
uint8_t len = min_(maxLength, data->getUTF8Size());
// One byte for length of the string
buf[0] = len;
if (len > 0) {
memcpy(buf + 1, data->data, len);
memcpy(buf + 1, data->getUTF8Data(), len);
}
return len + 1;
}
@ -136,7 +136,7 @@ namespace radio {
uBit.serial.send(s);
if ((tp == PACKET_TYPE_STRING || tp == PACKET_TYPE_VALUE) && NULL != m) {
uBit.serial.send(",\"n\":\"");
uBit.serial.send((uint8_t*)m->data, m->length);
uBit.serial.send((uint8_t*)m->getUTF8Data(), m->getUTF8Size());
uBit.serial.send("\"");
}
if (tp == PACKET_TYPE_BUFFER && NULL != b) {
@ -152,7 +152,7 @@ namespace radio {
uBit.serial.send(",\"v\":");
TNumber td = fromDouble(dv);
String sd = numops::toString(td);
uBit.serial.send((uint8_t*)sd->data, sd->length);
uBit.serial.send((uint8_t*)sd->getUTF8Data(), sd->getUTF8Size());
decrRC(sd);
}
uBit.serial.send("}\r\n");