Skip to content

Commit 30729a8

Browse files
committed
Cleanup
1 parent c071693 commit 30729a8

File tree

4 files changed

+6
-35
lines changed

4 files changed

+6
-35
lines changed

examples/Wasm_Blink/Wasm_Blink.ino

+1-15
Original file line numberDiff line numberDiff line change
@@ -132,11 +132,6 @@ m3ApiRawFunction(m3_arduino_print)
132132
m3ApiSuccess();
133133
}
134134

135-
m3ApiRawFunction(m3_dummy)
136-
{
137-
m3ApiSuccess();
138-
}
139-
140135
M3Result LinkArduino (IM3Runtime runtime)
141136
{
142137
IM3Module module = runtime->modules;
@@ -151,9 +146,6 @@ M3Result LinkArduino (IM3Runtime runtime)
151146
m3_LinkRawFunction (module, arduino, "getPinLED", "i()", &m3_arduino_getPinLED);
152147
m3_LinkRawFunction (module, arduino, "print", "v(*i)", &m3_arduino_print);
153148

154-
// Dummy (for TinyGo)
155-
m3_LinkRawFunction (module, "env", "io_get_stdout", "i()", &m3_dummy);
156-
157149
return m3Err_none;
158150
}
159151

@@ -188,13 +180,7 @@ void wasm_task(void*)
188180
if (result) FATAL("LinkArduino", result);
189181

190182
IM3Function f;
191-
// Check for TinyGo entry function first
192-
// See https://github.com/tinygo-org/tinygo/issues/866
193-
result = m3_FindFunction (&f, runtime, "cwa_main");
194-
if (result) {
195-
result = m3_FindFunction (&f, runtime, "_start");
196-
}
197-
183+
result = m3_FindFunction (&f, runtime, "_start");
198184
if (result) FATAL("FindFunction", result);
199185

200186
Serial.println("Running WebAssembly...");

examples/Wasm_Dino_ESP32_TDisplay/Wasm_Dino_ESP32_TDisplay.ino

+1-1
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ void display_info()
129129
tft.setCursor(0, 5);
130130
tft.println(" Wasm3 v" M3_VERSION " (ESP32)");
131131
tft.println(" Dino game");
132-
tft.println(" by Ben Smith (binji)");
132+
tft.println(" by Ben Smith (binji)");
133133
}
134134

135135
void setup()

examples_pio/Wasm_Advanced/wasm_vm/wasm_vm.ino

+2-17
Original file line numberDiff line numberDiff line change
@@ -125,11 +125,6 @@ m3ApiRawFunction(m3_arduino_getGreeting)
125125
m3ApiSuccess();
126126
}
127127

128-
m3ApiRawFunction(m3_dummy)
129-
{
130-
m3ApiSuccess();
131-
}
132-
133128
M3Result LinkArduino (IM3Runtime runtime)
134129
{
135130
IM3Module module = runtime->modules;
@@ -145,9 +140,6 @@ M3Result LinkArduino (IM3Runtime runtime)
145140
m3_LinkRawFunction (module, arduino, "getGreeting", "v(*i)", &m3_arduino_getGreeting);
146141
m3_LinkRawFunction (module, arduino, "print", "v(*i)", &m3_arduino_print);
147142

148-
// Dummy (for TinyGo)
149-
m3_LinkRawFunction (module, "env", "io_get_stdout", "i()", &m3_dummy);
150-
151143
return m3Err_none;
152144
}
153145

@@ -182,19 +174,12 @@ void wasm_task(void*)
182174
if (result) FATAL("LinkArduino", result);
183175

184176
IM3Function f;
185-
// Check for TinyGo entry function first
186-
// See https://github.com/tinygo-org/tinygo/issues/866
187-
result = m3_FindFunction (&f, runtime, "cwa_main");
188-
if (result) {
189-
result = m3_FindFunction (&f, runtime, "_start");
190-
}
191-
177+
result = m3_FindFunction (&f, runtime, "_start");
192178
if (result) FATAL("FindFunction", result);
193179

194180
Serial.println("Running WebAssembly...");
195181

196-
const char* i_argv[1] = { NULL };
197-
result = m3_CallWithArgs (f, 0, i_argv);
182+
result = m3_CallV (f);
198183

199184
// Should not arrive here
200185

wasm_apps/README.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,8 @@ To rebuild, use `npm run build`.
2424

2525
## TinyGo app
2626

27-
To rebuild, use `build.sh`.
28-
When using TinyGo, be sure to change the main function from `_start` to `cwa_main`.
27+
To rebuild, use `build.sh`.
2928

29+
___
3030

3131
**Note:** for all examples, the resulting `wasm` binary is converted to a C header using `xxd`.

0 commit comments

Comments
 (0)