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

Function xs_digital_read

modules/pins/digital/digital.c:127–137  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

125}
126
127void xs_digital_read(xsMachine *the)
128{
129 modGPIOConfiguration gpio = xsmcGetHostChunk(xsThis);
130 int value;
131
132 value = modGPIORead(gpio);
133 if (kModGPIOReadError == value)
134 xsUnknownError("can't read pin");
135
136 xsmcSetInteger(xsResult, value);
137}
138
139void xs_digital_write(xsMachine *the)
140{

Callers

nothing calls this directly

Calls 1

modGPIOReadFunction · 0.50

Tested by

no test coverage detected