diff --git a/core/MyLeds.cpp b/core/MyLeds.cpp index 0da6628..3138be3 100644 --- a/core/MyLeds.cpp +++ b/core/MyLeds.cpp @@ -34,16 +34,16 @@ inline void ledsInit() countRx = 0; countTx = 0; countErr = 0; - + // Setup led pins #if defined(MY_DEFAULT_RX_LED_PIN) - pinMode(MY_DEFAULT_RX_LED_PIN, OUTPUT); + hwPinMode(MY_DEFAULT_RX_LED_PIN, OUTPUT); #endif #if defined(MY_DEFAULT_TX_LED_PIN) - pinMode(MY_DEFAULT_TX_LED_PIN, OUTPUT); + hwPinMode(MY_DEFAULT_TX_LED_PIN, OUTPUT); #endif #if defined(MY_DEFAULT_ERR_LED_PIN) - pinMode(MY_DEFAULT_ERR_LED_PIN, OUTPUT); + hwPinMode(MY_DEFAULT_ERR_LED_PIN, OUTPUT); #endif prevTime = hwMillis() - LED_PROCESS_INTERVAL_MS; // Substract some, to make sure leds gets updated on first run. ledsProcess(); diff --git a/core/MySensorsCore.cpp b/core/MySensorsCore.cpp index 0c87a84..80c32e3 100644 --- a/core/MySensorsCore.cpp +++ b/core/MySensorsCore.cpp @@ -115,20 +115,20 @@ void _begin(void) { // Check if node has been locked down if (hwReadConfig(EEPROM_NODE_LOCK_COUNTER) == 0) { // Node is locked, check if unlock pin is asserted, else hang the node - pinMode(MY_NODE_UNLOCK_PIN, INPUT_PULLUP); + hwPinMode(MY_NODE_UNLOCK_PIN, INPUT_PULLUP); // Make a short delay so we are sure any large external nets are fully pulled unsigned long enter = hwMillis(); while (hwMillis() - enter < 2) {} - if (digitalRead(MY_NODE_UNLOCK_PIN) == 0) { + if (hwDigitalRead(MY_NODE_UNLOCK_PIN) == 0) { // Pin is grounded, reset lock counter hwWriteConfig(EEPROM_NODE_LOCK_COUNTER, MY_NODE_LOCK_COUNTER_MAX); // Disable pullup - pinMode(MY_NODE_UNLOCK_PIN, INPUT); + hwPinMode(MY_NODE_UNLOCK_PIN, INPUT); setIndication(INDICATION_ERR_LOCKED); debug(PSTR("MCO:BGN:NODE UNLOCKED\n")); } else { // Disable pullup - pinMode(MY_NODE_UNLOCK_PIN, INPUT); + hwPinMode(MY_NODE_UNLOCK_PIN, INPUT); nodeLock("LDB"); //Locked during boot } } else if (hwReadConfig(EEPROM_NODE_LOCK_COUNTER) == 0xFF) {