aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.c16
1 files changed, 2 insertions, 14 deletions
diff --git a/src/main.c b/src/main.c
index 4a4b15d..26e79ba 100644
--- a/src/main.c
+++ b/src/main.c
@@ -79,12 +79,7 @@ void print_help(void) {
printf ("Version: v%1.2f, build: [%s] (gcc %s) \n\n",VERSION,_BUILD_TIME_,__VERSION__);
}
-/*
-void bus_err(int ern){
- printf("I2C communication(rd) error. errno: %d\n",errno);
- //fprintf (stderr, "Internal error %d at %s, line %d. (function: %s/%s)\n", ern, __FILE__, __LINE__, __func__, __FUNCTION__);
-}
-*/
+
__uint8_t *xchg_data (__uint8_t *buf, __uint16_t wrlen, __uint16_t waitlen, __uint16_t rdlen){ //# [buf] = 32 byte
@@ -150,17 +145,10 @@ int main( int argc, char *argv[] ){
char filename[256];
int i, file1;
-/* for( i = 0; i < strlen(argv[2]); i++){ //# Test on bus address, for error detection.
- if(!isdigit(argv[2][i])){
- printf("\n\tThe BUS Address must be an integer!\n\n");
- exit(EXIT_FAILURE);
- }
- }
-*/
snprintf(filename, 256, "/dev/i2c-%s", argv[2]);
devicef = open(filename, O_RDWR); //# Open the i2c bus
if (devicef < 0){
- printf("\n\tCan't open i2c BUS. Have you any permission?\n\n");
+ printf("\n\tCan't open \"%s\" BUS. (Have you any permission?)\n\n", filename);
exit(EXIT_FAILURE);
}