moved wrong pclose

pull/98/head
alanbjohnston 5 years ago committed by GitHub
parent 8efc44ff31
commit 78e19fdcb6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -271,8 +271,7 @@ int main(int argc, char * argv[]) {
// Check for SPI and AX-5043 Digital Transceiver Board // Check for SPI and AX-5043 Digital Transceiver Board
FILE * file = popen("sudo raspi-config nonint get_spi", "r"); FILE * file = popen("sudo raspi-config nonint get_spi", "r");
pclose(file); // printf("getc: %c \n", fgetc(file));
printf("getc: %c \n", fgetc(file));
if (fgetc(file) == 48) { if (fgetc(file) == 48) {
printf("SPI is enabled!\n"); printf("SPI is enabled!\n");
@ -282,7 +281,7 @@ int main(int argc, char * argv[]) {
if (fgetc(file2) != 'l') { if (fgetc(file2) != 'l') {
printf("SPI devices present!\n"); printf("SPI devices present!\n");
// } // }
pclose(file2);
setSpiChannel(SPI_CHANNEL); setSpiChannel(SPI_CHANNEL);
setSpiSpeed(SPI_SPEED); setSpiSpeed(SPI_SPEED);
initializeSpi(); initializeSpi();
@ -299,7 +298,9 @@ int main(int argc, char * argv[]) {
transmit = TRUE; transmit = TRUE;
} else } else
printf("AX5043 not present!\n"); printf("AX5043 not present!\n");
pclose(file2);
} }
pclose(file);
} }
// else // else
// { // {

Loading…
Cancel
Save

Powered by TurnKey Linux.