From ffd9f3119e837ca5a95bf7d7d2157919364d2b7b Mon Sep 17 00:00:00 2001 From: Zilog80 Date: Mon, 3 Oct 2016 18:05:43 +0200 Subject: [PATCH] RS41: clean-up --- rs41/rs41.c | 8 ++++---- rs41/rs41ecc.c | 10 +++++----- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/rs41/rs41.c b/rs41/rs41.c index 42ad5d2..bcb204a 100644 --- a/rs41/rs41.c +++ b/rs41/rs41.c @@ -380,7 +380,7 @@ void Gps2Date(long GpsWeek, long GpsSeconds, int *Year, int *Month, int *Day) { #define HEAD_aux 0x7E00 // LEN variable -int crc16x(ui8_t bytes[], int start, int len) { +int crc16x(int start, int len) { int crc16poly = 0x1021; int rem = 0xFFFF, i, j; int xbyte; @@ -543,7 +543,7 @@ int get_GPStime() { // xorbyte(crcpos) == (HEAD_tow>>8) & 0xFF ? crclen = xorbyte(crcpos+1); crcdat = xorbyte(crcpos+2+crclen) | (xorbyte(crcpos+2+crclen+1)<<8); - if ( crcdat != crc16x(frame, crcpos+2, crclen) ) { + if ( crcdat != crc16x(crcpos+2, crclen) ) { return -2; // CRC error } } @@ -620,7 +620,7 @@ int get_GPSkoord() { // xorbyte(crcpos) == (HEAD_koord>>8) & 0xFF ? crclen = xorbyte(crcpos+1); crcdat = xorbyte(crcpos+2+crclen) | (xorbyte(crcpos+2+crclen+1)<<8); - if ( crcdat != crc16x(frame, crcpos+2, crclen) ) { + if ( crcdat != crc16x(crcpos+2, crclen) ) { return -2; // CRC error } } @@ -713,7 +713,7 @@ int get_Aux() { if (count7E == 0) fprintf(stdout, "\n # xdata = "); else fprintf(stdout, " # "); - if ( auxcrc == crc16x(frame, pos_Haux+2, auxlen) ) { + if ( auxcrc == crc16x(pos_Haux+2, auxlen) ) { //fprintf(stdout, " # %02x : ", xorbyte(pos_Haux+2)); for (i = 1; i < auxlen; i++) { fprintf(stdout, "%c", xorbyte(pos_Haux+2+i)); diff --git a/rs41/rs41ecc.c b/rs41/rs41ecc.c index 17193cd..204bea6 100644 --- a/rs41/rs41ecc.c +++ b/rs41/rs41ecc.c @@ -414,7 +414,7 @@ void Gps2Date(long GpsWeek, long GpsSeconds, int *Year, int *Month, int *Day) { #define HEAD_aux 0x7E00 // LEN variable /* -int crc16x(ui8_t bytes[], int start, int len) { +int crc16x(int start, int len) { int crc16poly = 0x1021; int rem = 0xFFFF, i, j; int xbyte; @@ -437,7 +437,7 @@ int crc16x(ui8_t bytes[], int start, int len) { return rem; } */ -int crc16(ui8_t bytes[], int start, int len) { +int crc16(int start, int len) { int crc16poly = 0x1021; int rem = 0xFFFF, i, j; int byte; @@ -532,7 +532,7 @@ int get_GPStime() { if ( option_crc ) { crclen = framebyte(crcpos+1); crcdat = framebyte(crcpos+2+crclen) | (framebyte(crcpos+2+crclen+1)<<8); - if ( crcdat != crc16(frame, crcpos+2, crclen) ) { + if ( crcdat != crc16(crcpos+2, crclen) ) { return -2; // CRC error } } @@ -608,7 +608,7 @@ int get_GPSkoord() { if ( option_crc ) { crclen = framebyte(crcpos+1); crcdat = framebyte(crcpos+2+crclen) | (framebyte(crcpos+2+crclen+1)<<8); - if ( crcdat != crc16(frame, crcpos+2, crclen) ) { + if ( crcdat != crc16(crcpos+2, crclen) ) { return -2; // CRC error } } @@ -681,7 +681,7 @@ int get_Aux() { if (count7E == 0) fprintf(stdout, "\n # xdata = "); else fprintf(stdout, " # "); - if ( auxcrc == crc16(frame, pos_Haux+2, auxlen) ) { + if ( auxcrc == crc16(pos_Haux+2, auxlen) ) { //fprintf(stdout, " # %02x : ", framebyte(pos_Haux+2)); for (i = 1; i < auxlen; i++) { fprintf(stdout, "%c", framebyte(pos_Haux+2+i));