MCPcopy Create free account
hub / github.com/Moddable-OpenSource/moddable / fx_putpi

Function fx_putpi

xs/platforms/esp/xsPlatform.c:177–207  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

175}
176
177void fx_putpi(txMachine *the, char separator, txBoolean trailingcrlf)
178{
179 static const char *xsbugHeaderStart = "\r\n<?xs";
180 static const char *xsbugHeaderEnd = "?>";
181 static const char *gHex = "0123456789ABCDEF";
182 char hex[10];
183 signed char i;
184 const char *cp = xsbugHeaderStart;
185 while (true) {
186 char c = c_read8(cp++);
187 if (!c) break;
188 ESP_putc(c);
189 }
190
191 ESP_putc(separator);
192
193 for (i = 7; i >= 0; i--)
194 ESP_putc(c_read8(gHex + ((((uintptr_t)the) >> (i << 2)) & 0x0F)));
195
196 cp = xsbugHeaderEnd;
197 while (true) {
198 char c = c_read8(cp++);
199 if (!c) break;
200 ESP_putc(c);
201 }
202
203 if (trailingcrlf) {
204 ESP_putc('\r');
205 ESP_putc('\n');
206 }
207}
208
209void fxAbort(txMachine* the, int status)
210{

Callers 3

fx_putcFunction · 0.70
fxDisconnectFunction · 0.70
fxSendFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected