-/* uLisp AVR Version 2.6 - www.ulisp.com
-   David Johnson-Davies - www.technoblogy.com - 9th April 2019
+/* uLisp AVR Version 2.6a - www.ulisp.com
+   David Johnson-Davies - www.technoblogy.com - 19th April 2019
 
    Licensed under the MIT license: https://opensource.org/licenses/MIT
 */

  else supersub(form, lm + PPINDENT, 1, pfun);
}

const int ppspecials = 14;
const char ppspecial[ppspecials] PROGMEM = 
  { DOTIMES, DOLIST, IF, SETQ, TEE, LET, LETSTAR, LAMBDA, WHEN, UNLESS, WITHI2C, WITHSERIAL, WITHSPI, WITHSDCARD };

void supersub (object *form, int lm, int super, pfun_t pfun) {
  int special = 0, separate = 1;

object *fn_pinmode (object *args, object *env) {
  (void) env;
  int pin = integer(first(args));
  int pm = INPUT;
  object *mode = second(args);
  if (integerp(mode)) {
    int nmode = integer(mode);
    if (nmode == 1) pm = OUTPUT; else if (nmode == 2) pm = INPUT_PULLUP;
    #if defined(INPUT_PULLDOWN)
    else if (nmode == 4) pm = INPUT_PULLDOWN;
    #endif
  } else if (mode != nil) pm = OUTPUT;
  pinMode(pin, pm);
  return nil;
}

