Skip to content

Commit

Permalink
Merge pull request #2473 from brendena/patch-2
Browse files Browse the repository at this point in the history
Building EMSCRIPTEN boards on the latest EMCC
  • Loading branch information
gfwilliams authored Mar 1, 2024
2 parents 6be243d + 3218bcc commit e5ffc93
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
2 changes: 1 addition & 1 deletion make/family/EMSCRIPTEN.make
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ targets/emscripten/jshardware.c
LIBS += -lc
#LIBS += -lstdc++
CFLAGS += -Wno-unused-function -Wno-switch
LDFLAGS += -s EXPORTED_FUNCTIONS='["_jsInit","_jsIdle","_jsKill","_jshPushIOCharEvent","_jsSendPinWatchEvent","_jsSendTouchEvent","_jshGetDeviceToTransmit","_jshGetCharToTransmit","_jsGfxChanged","_jsGfxGetPtr"]' -s EXTRA_EXPORTED_RUNTIME_METHODS='["ccall"]' -s WASM=0 -s ASSERTIONS=1 --memory-init-file 0 -Oz
LDFLAGS += -s EXPORTED_FUNCTIONS='["_jsInit","_jsIdle","_jsKill","_jshPushIOCharEvent","_jsSendPinWatchEvent","_jsSendTouchEvent","_jshGetDeviceToTransmit","_jshGetCharToTransmit","_jsGfxChanged","_jsGfxGetPtr"]' -s EXPORTED_RUNTIME_METHODS='["ccall"]' -s WASM=0 -s ASSERTIONS=1 --memory-init-file 0 -Oz

8 changes: 8 additions & 0 deletions targets/emscripten/jshardware.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,14 @@

#define FLASH_UNITARY_WRITE_SIZE 4
#define FAKE_FLASH_BLOCKSIZE 4096

// ----------------------------------------------------------------------------
/*Reason - Needed for latest build of EMCC(3.1.55). Else undefined symbol*/
EM_JS(void, emscripten_memcpy_js, (uint8_t* dest, uint8_t* src, size_t numBytes), {
var destHeap = new Uint8Array(Module.HEAPU8.buffer, dest, numBytes);
var srcHeap = new Uint8Array(Module.HEAPU8.buffer, src, numBytes);
destHeap.set(srcHeap);
});
// ----------------------------------------------------------------------------

Pin eventFlagsToPin[16];
Expand Down

0 comments on commit e5ffc93

Please sign in to comment.