Skip to content

Commit 9b0989b

Browse files
committed
tweaks for fix microbit/emscripten builds
1 parent 43943b5 commit 9b0989b

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

src/jsdevices.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -589,7 +589,7 @@ IOEventFlags jshPopIOEvent(uint8_t *data, unsigned int *length) {
589589
return evt;
590590
}
591591

592-
// pop an IO event of type eventType, returns true on success
592+
// pop an IO event of type eventType, returns event type on success,EV_NONE on failure. data must be IOEVENT_MAX_LEN bytes
593593
IOEventFlags jshPopIOEventOfType(IOEventFlags eventType, uint8_t *data, unsigned int *length) {
594594
IOBufferIdx i = ioTail;
595595
while (ioHead!=i) {

src/jsinteractive.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3021,9 +3021,10 @@ void jsiDebuggerLine(JsVar *line) {
30213021
/** This is called from the parser if EXEC_RUN_INTERRUPT_JS is set.
30223022
It executes JavaScript code that was pushed to the queue by require("timer").add({type:"EXEC", fn:myFunction... */
30233023
void jsiRunInterruptingJS() {
3024-
uint8_t data[8];
3024+
uint8_t data[IOEVENT_MAX_LEN];
30253025
memset(data, 0, sizeof(data));
3026-
if (jshPopIOEventOfType(EV_RUN_INTERRUPT_JS, data, sizeof(data)))
3026+
unsigned int len = sizeof(data)
3027+
if (jshPopIOEventOfType(EV_RUN_INTERRUPT_JS, data, &len))
30273028
jsiOnRunInterruptJSEvent(data, sizeof(data));
30283029
}
30293030

src/jstimer.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,8 @@ typedef enum {
5252
#define UET_IS_BUFFER_WRITE_EVENT(T) (\
5353
((T)==UET_WRITE_BYTE) || \
5454
((T)==UET_WRITE_SHORT))
55+
#else
56+
#define UET_IS_BUFFER_EVENT(T) false
5557
#endif
5658

5759
#define UTILTIMERTASK_PIN_COUNT (8)

0 commit comments

Comments
 (0)