lancaster-university / microbit-dal

http://lancaster-university.github.io/microbit-docs
Other
256 stars 130 forks source link

printChar does not block #463

Open pelikhan opened 4 years ago

pelikhan commented 4 years ago

This code in MakeCode leads to a blank screen because X is erased immediately by clearScreen

input.onButtonPressed(Button.A, function () {
    basic.showString("X")
    basic.clearScreen()
})

The showString function in PXT calls into printChar.

https://github.com/microsoft/pxt-microbit/blame/50ec105c4faeaca8bf1ac8636b5b5021afd937ba/libs/core/basic.cpp#L37

Could this be related to the new fibers?

pelikhan commented 4 years ago

pxt bug: https://github.com/microsoft/pxt-microbit/issues/2821

pelikhan commented 4 years ago

@finneyj @jamesadevine

finneyj commented 4 years ago

@pelikhan

Thanks - Fixed in v2.2.0-rc4

I went through the while print() family of methods and tested/unified behaviour, so hopefully we won't see any more regressions in MicroBitDisplay.

pelikhan commented 4 years ago

The print method now clears the screen after executing. This is a breaking change from the previous behavior. Can we revert to leaving the screen as is?

https://github.com/lancaster-university/microbit-dal/releases/tag/v2.2.0-rc4

finneyj commented 4 years ago

unintentional - apologies @pelikhan

fixed in https://github.com/lancaster-university/microbit-dal/commit/673228f89a3fbe86eedd48b8d64eaea4bc2a937c

v2.2.0-rc5

pelikhan commented 4 years ago

All bugs are features by now :)