missing simulator function for serial

This commit is contained in:
Peli de Halleux 2016-05-19 14:50:02 -07:00
parent cc36bae97d
commit 44688ee5d5

View File

@ -430,6 +430,10 @@ namespace pxsim.serial {
return board().readSerial(); return board().readSerial();
} }
export function readLine(): string {
return board().readSerial();
}
export function onDataReceived(delimiters: string, handler: RefAction) { export function onDataReceived(delimiters: string, handler: RefAction) {
let b = board(); let b = board();
b.bus.listen(DAL.MICROBIT_ID_SERIAL, DAL.MICROBIT_SERIAL_EVT_DELIM_MATCH, handler); b.bus.listen(DAL.MICROBIT_ID_SERIAL, DAL.MICROBIT_SERIAL_EVT_DELIM_MATCH, handler);