We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 90bb9d4 commit a84f15fCopy full SHA for a84f15f
src/Primitives/emulated.cpp
@@ -385,7 +385,7 @@ def_prim(http_post, tenToOneU32) {
385
return true;
386
}
387
388
-#define NUM_DIGITAL_PINS 19
+#define NUM_DIGITAL_PINS 25
389
uint32_t PINS[NUM_DIGITAL_PINS] = {};
390
uint8_t MODES[NUM_DIGITAL_PINS] = {};
391
@@ -404,11 +404,12 @@ def_prim(chip_digital_write, twoToNoneU32) {
404
uint8_t pin = arg1.uint32;
405
uint8_t val = arg0.uint32;
406
debug("EMU: chip_digital_write(%u,%u) \n", pin, val);
407
- if (pin < NUM_DIGITAL_PINS && MODES[pin] == 0x01) {
+ bool writable = pin < NUM_DIGITAL_PINS && MODES[pin] == 0x02;
408
+ if (writable) {
409
PINS[pin] = val;
410
411
pop_args(2);
- return pin < NUM_DIGITAL_PINS;
412
+ return writable;
413
414
415
def_prim_reverse(chip_digital_write) {
0 commit comments