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

Function xs_digital_static_write

modules/pins/digital/digital.c:164–175  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

162}
163
164void xs_digital_static_write(xsMachine *the)
165{
166 int pin = xsmcToInteger(xsArg(0));
167 int value = xsmcToInteger(xsArg(1));
168 modGPIOConfigurationRecord config;
169
170 if (modGPIOInit(&config, NULL, pin, kModGPIOOutput))
171 xsUnknownError("can't init pin");
172
173 modGPIOWrite(&config, value ? 1 : 0);
174 modGPIOUninit(&config);
175}
176
177void wakeableDigitalDeliver(void *the, void *refcon, uint8_t *message, uint16_t messageLength)
178{

Callers

nothing calls this directly

Calls 3

modGPIOInitFunction · 0.50
modGPIOWriteFunction · 0.50
modGPIOUninitFunction · 0.50

Tested by

no test coverage detected