Fix IO/HAL calls
This commit is contained in:
+3
-3
@@ -37,13 +37,13 @@ inline void ledsInit()
|
|||||||
|
|
||||||
// Setup led pins
|
// Setup led pins
|
||||||
#if defined(MY_DEFAULT_RX_LED_PIN)
|
#if defined(MY_DEFAULT_RX_LED_PIN)
|
||||||
pinMode(MY_DEFAULT_RX_LED_PIN, OUTPUT);
|
hwPinMode(MY_DEFAULT_RX_LED_PIN, OUTPUT);
|
||||||
#endif
|
#endif
|
||||||
#if defined(MY_DEFAULT_TX_LED_PIN)
|
#if defined(MY_DEFAULT_TX_LED_PIN)
|
||||||
pinMode(MY_DEFAULT_TX_LED_PIN, OUTPUT);
|
hwPinMode(MY_DEFAULT_TX_LED_PIN, OUTPUT);
|
||||||
#endif
|
#endif
|
||||||
#if defined(MY_DEFAULT_ERR_LED_PIN)
|
#if defined(MY_DEFAULT_ERR_LED_PIN)
|
||||||
pinMode(MY_DEFAULT_ERR_LED_PIN, OUTPUT);
|
hwPinMode(MY_DEFAULT_ERR_LED_PIN, OUTPUT);
|
||||||
#endif
|
#endif
|
||||||
prevTime = hwMillis() - LED_PROCESS_INTERVAL_MS; // Substract some, to make sure leds gets updated on first run.
|
prevTime = hwMillis() - LED_PROCESS_INTERVAL_MS; // Substract some, to make sure leds gets updated on first run.
|
||||||
ledsProcess();
|
ledsProcess();
|
||||||
|
|||||||
@@ -115,20 +115,20 @@ void _begin(void) {
|
|||||||
// Check if node has been locked down
|
// Check if node has been locked down
|
||||||
if (hwReadConfig(EEPROM_NODE_LOCK_COUNTER) == 0) {
|
if (hwReadConfig(EEPROM_NODE_LOCK_COUNTER) == 0) {
|
||||||
// Node is locked, check if unlock pin is asserted, else hang the node
|
// 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
|
// Make a short delay so we are sure any large external nets are fully pulled
|
||||||
unsigned long enter = hwMillis();
|
unsigned long enter = hwMillis();
|
||||||
while (hwMillis() - enter < 2) {}
|
while (hwMillis() - enter < 2) {}
|
||||||
if (digitalRead(MY_NODE_UNLOCK_PIN) == 0) {
|
if (hwDigitalRead(MY_NODE_UNLOCK_PIN) == 0) {
|
||||||
// Pin is grounded, reset lock counter
|
// Pin is grounded, reset lock counter
|
||||||
hwWriteConfig(EEPROM_NODE_LOCK_COUNTER, MY_NODE_LOCK_COUNTER_MAX);
|
hwWriteConfig(EEPROM_NODE_LOCK_COUNTER, MY_NODE_LOCK_COUNTER_MAX);
|
||||||
// Disable pullup
|
// Disable pullup
|
||||||
pinMode(MY_NODE_UNLOCK_PIN, INPUT);
|
hwPinMode(MY_NODE_UNLOCK_PIN, INPUT);
|
||||||
setIndication(INDICATION_ERR_LOCKED);
|
setIndication(INDICATION_ERR_LOCKED);
|
||||||
debug(PSTR("MCO:BGN:NODE UNLOCKED\n"));
|
debug(PSTR("MCO:BGN:NODE UNLOCKED\n"));
|
||||||
} else {
|
} else {
|
||||||
// Disable pullup
|
// Disable pullup
|
||||||
pinMode(MY_NODE_UNLOCK_PIN, INPUT);
|
hwPinMode(MY_NODE_UNLOCK_PIN, INPUT);
|
||||||
nodeLock("LDB"); //Locked during boot
|
nodeLock("LDB"); //Locked during boot
|
||||||
}
|
}
|
||||||
} else if (hwReadConfig(EEPROM_NODE_LOCK_COUNTER) == 0xFF) {
|
} else if (hwReadConfig(EEPROM_NODE_LOCK_COUNTER) == 0xFF) {
|
||||||
|
|||||||
Reference in New Issue
Block a user