X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=server%2Fbbb_pin.c;h=199706f6e7f5577e6af54b85ca4b2adc8ffa8c98;hb=3521cee9644bd955fd053c5b4ea173efd1e78fe8;hp=7d500dd0e44537e74d5e742adf872cfe3b26ddf0;hpb=0bcd433fc420fa29bfaaca732acf689c9603e59d;p=matches%2FMCTX3420.git diff --git a/server/bbb_pin.c b/server/bbb_pin.c index 7d500dd..199706f 100644 --- a/server/bbb_pin.c +++ b/server/bbb_pin.c @@ -1,6 +1,7 @@ /** * @file bbb_pin.c - * @purpose Implementation of BBB pin control functions and structures + * @brief Implementation of BBB pin control functions and structures + * On non-beaglebone (actually non-arm) platforms, this code is disabled. * THIS CODE IS NOT THREADSAFE */ @@ -333,6 +334,7 @@ void ADC_Unexport(int pin) /** * Set a GPIO pin * @param pin - The pin to set. MUST have been exported before calling this function. + * @param value - The value to set the GPIO pin to. */ bool GPIO_Set(int pin, bool value) { @@ -500,7 +502,8 @@ bool ADC_Read(int id, int *value) if (pread(g_adc[id].fd_value, adc_str, ADC_DIGITS-1, 0) == -1) { - AbortBool("ADC %d read failed: %s", id, strerror(errno)); + //AbortBool("ADC %d read failed: %s", id, strerror(errno)); + return false; } *value = strtol(adc_str, NULL, 10); @@ -509,7 +512,7 @@ bool ADC_Read(int id, int *value) #ifndef _BBB //For running on systems that are not the BBB -bool True_Stub(void *arg, ...) { return true; } +bool True_Stub(int arg, ...) { return true; } bool ADC_Read_Stub(int *val, ...) { *val = 0; return true; } bool GPIO_Read_Stub(bool *val, ...) { *val = false; return true; } #endif