Skip to content

Commit

Permalink
Merge pull request #20 from glassboard-dev/develop
Browse files Browse the repository at this point in the history
Removing unnecessary goto statements
  • Loading branch information
stephendpmurphy authored Apr 28, 2021
2 parents 1955a54 + 4077d4c commit 19e8209
Showing 1 changed file with 0 additions and 3 deletions.
3 changes: 0 additions & 3 deletions src/mcp342x.c
Original file line number Diff line number Diff line change
Expand Up @@ -36,12 +36,10 @@ mcp342x_return_code_t mcp342x_sampleChannel(mcp342x_dev_t *dev, const mcp342x_ch

if( (NULL == dev) || (NULL == dev->intf.read) || (NULL == dev->intf.write) || (NULL == dev->intf.delay_us) ) {
ret = MCP342x_RET_NULL_PTR;
goto EXIT;
}
else if( ch >= MCP342x_CH__MAX__ )
{
ret = MCP342x_RET_INV_PARAM;
goto EXIT;
}

if( MCP342x_RET_OK == ret ) {
Expand Down Expand Up @@ -96,7 +94,6 @@ mcp342x_return_code_t mcp342x_sampleChannel(mcp342x_dev_t *dev, const mcp342x_ch
dev->results[ch].voltage = dev->results[ch].outputCode * MCP342x_LSB_VAL;
}

EXIT:
// Return our return code from retrieving a channel sample
return ret;
}

0 comments on commit 19e8209

Please sign in to comment.