27 #if defined(__AVR__) && !defined(ARDUINO) 29 void delay(
unsigned long ms)
37 #if defined(__AVR_ATtiny25__) || defined(__AVR_ATtiny45__) || defined(__AVR_ATtiny85__) 44 #elif defined(__AVR_ATmega328P__) 52 static uint8_t s_stub;
54 #define G0_PORT s_stub 56 #define G1_PORT s_stub 58 #define G2_PORT s_stub 61 void digitalWrite(
int pin,
int level)
63 uint8_t mask = (1<<(pin & 0x7));
66 if (level == HIGH) G0_PORT |= mask;
else G0_PORT &= ~mask;
70 if (level == HIGH) G1_PORT |= mask;
else G1_PORT &= ~mask;
74 if (level == HIGH) G2_PORT |= mask;
else G2_PORT &= ~mask;
78 void pinMode(
int pin,
int mode)
80 uint8_t mask = (1<<(pin & 0x7));
83 if (mode == OUTPUT) G0_DIR |= mask;
else G0_DIR &= ~mask;
87 if (mode == OUTPUT) G1_DIR |= mask;
else G1_DIR &= ~mask;
91 if (mode == OUTPUT) G2_DIR |= mask;
else G2_DIR &= ~mask;