mirror of
https://github.com/apache/nuttx-apps.git
synced 2025-10-17 15:32:21 +08:00
When boardctl() fails, need to print errno not the returned value which will always be -1.
This commit is contained in:
@@ -252,9 +252,9 @@ int adc_main(int argc, char *argv[])
|
||||
|
||||
printf("adc_main: Initializing external ADC device\n");
|
||||
ret = boardctl(BOARDIOC_ADCTEST_SETUP, 0);
|
||||
if (ret != OK)
|
||||
if (ret < 0)
|
||||
{
|
||||
printf("adc_main: boardctl failed: %d\n", ret);
|
||||
printf("adc_main: boardctl failed: %d\n", errno);
|
||||
errval = 1;
|
||||
goto errout;
|
||||
}
|
||||
|
Reference in New Issue
Block a user