Skip to content
Snippets Groups Projects
Commit 2ba90135 authored by schneider's avatar schneider
Browse files

refact(gpio): Use new style HW locks

parent ceaf1e4a
Branches
No related tags found
No related merge requests found
...@@ -137,8 +137,7 @@ int epic_gpio_read_pin(uint8_t pin) ...@@ -137,8 +137,7 @@ int epic_gpio_read_pin(uint8_t pin)
} else if (cfg->func == GPIO_FUNC_IN) { } else if (cfg->func == GPIO_FUNC_IN) {
return GPIO_InGet(cfg) != 0; return GPIO_InGet(cfg) != 0;
} else if (cfg->func == GPIO_FUNC_ALT1) { } else if (cfg->func == GPIO_FUNC_ALT1) {
int rc = hwlock_acquire_timeout(HWLOCK_ADC, portMAX_DELAY); hwlock_acquire(HWLOCK_ADC);
if (!rc) {
ADC_StartConvert(s_adc_channels[pin], 0, 0); ADC_StartConvert(s_adc_channels[pin], 0, 0);
uint16_t value; uint16_t value;
int rc = ADC_GetData(&value); int rc = ADC_GetData(&value);
...@@ -147,8 +146,6 @@ int epic_gpio_read_pin(uint8_t pin) ...@@ -147,8 +146,6 @@ int epic_gpio_read_pin(uint8_t pin)
return -EIO; return -EIO;
} }
return (int)value; return (int)value;
}
return rc;
} else { } else {
return -EINVAL; return -EINVAL;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment