From 9729b0a5bec7ddc33593259ab783249423ef1736 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 21 Dec 2020 18:10:25 -0500 Subject: [PATCH 01/17] removed pedantic --- Makefile | 70 ++++++++++++++++++++++++++++---------------------------- 1 file changed, 35 insertions(+), 35 deletions(-) diff --git a/Makefile b/Makefile index 147c4e26..d5742a62 100644 --- a/Makefile +++ b/Makefile @@ -54,57 +54,57 @@ radiochat: chat/chat_main.o radiopiglatin: libax5043.a radiopiglatin: piglatin/piglatin_main.o - gcc -std=gnu99 $(DEBUG_BEHAVIOR) -o radiopiglatin -pedantic -Wall -Wextra -L./ piglatin/piglatin_main.o -lwiringPi -lax5043 + gcc -std=gnu99 $(DEBUG_BEHAVIOR) -o radiopiglatin -Wall -Wextra -L./ piglatin/piglatin_main.o -lwiringPi -lax5043 testax5043tx: libax5043.a testax5043tx: transmit/transmit_main.o - gcc -std=gnu99 $(DEBUG_BEHAVIOR) -o testax5043tx -pedantic -Wall -Wextra -L./ transmit/transmit_main.o -lwiringPi -lax5043 + gcc -std=gnu99 $(DEBUG_BEHAVIOR) -o testax5043tx -Wall -Wextra -L./ transmit/transmit_main.o -lwiringPi -lax5043 testax5043rx: libax5043.a testax5043rx: receive/receive_main.o - gcc -std=gnu99 $(DEBUG_BEHAVIOR) -o testax5043rx -pedantic -Wall -Wextra -L./ receive/receive_main.o -lwiringPi -lax5043 + gcc -std=gnu99 $(DEBUG_BEHAVIOR) -o testax5043rx -Wall -Wextra -L./ receive/receive_main.o -lwiringPi -lax5043 testax5043init: libax5043.a testax5043init: init/init_main.o - gcc -std=gnu99 $(DEBUG_BEHAVIOR) -o testax5043init -pedantic -Wall -Wextra -L./ init/init_main.o -lwiringPi -lax5043 + gcc -std=gnu99 $(DEBUG_BEHAVIOR) -o testax5043init -Wall -Wextra -L./ init/init_main.o -lwiringPi -lax5043 testax50432freq: libax5043.a testax50432freq: transmit2freq/transmit2freq_main.o - gcc -std=gnu99 $(DEBUG_BEHAVIOR) -o testax50432freq -pedantic -Wall -Wextra -L./ transmit2freq/transmit2freq_main.o -lwiringPi -lax5043 + gcc -std=gnu99 $(DEBUG_BEHAVIOR) -o testax50432freq -Wall -Wextra -L./ transmit2freq/transmit2freq_main.o -lwiringPi -lax5043 testafsktx: libax5043.a testafsktx: afsktx/ax25.o testafsktx: afsktx/ax5043.o testafsktx: afsktx/main.o - gcc -std=gnu99 $(DEBUG_BEHAVIOR) -o testafsktx -pedantic -Wall -Wextra -L./ afsktx/ax25.o afsktx/ax5043.o afsktx/main.o -lwiringPi -lax5043 + gcc -std=gnu99 $(DEBUG_BEHAVIOR) -o testafsktx -Wall -Wextra -L./ afsktx/ax25.o afsktx/ax5043.o afsktx/main.o -lwiringPi -lax5043 radioafsk: libax5043.a radioafsk: afsk/ax25.o radioafsk: afsk/ax5043.o radioafsk: afsk/main.o - gcc -std=gnu99 $(DEBUG_BEHAVIOR) -o radioafsk -pedantic -Wall -Wextra -L./ afsk/ax25.o afsk/ax5043.o afsk/main.o -lwiringPi -lax5043 -lm + gcc -std=gnu99 $(DEBUG_BEHAVIOR) -o radioafsk -Wall -Wextra -L./ afsk/ax25.o afsk/ax5043.o afsk/main.o -lwiringPi -lax5043 -lm telem: afsk/telem.o - gcc -std=gnu99 $(DEBUG_BEHAVIOR) -o telem -pedantic -Wall -Wextra -L./ afsk/telem.o -lwiringPi + gcc -std=gnu99 $(DEBUG_BEHAVIOR) -o telem -Wall -Wextra -L./ afsk/telem.o -lwiringPi ax5043/generated/configcommon.o: ax5043/generated/configcommon.c ax5043/generated/configcommon.o: ax5043/generated/configrx.h ax5043/generated/configcommon.o: ax5043/generated/configtx.h ax5043/generated/configcommon.o: ax5043/axradio/axradioinit.h ax5043/generated/configcommon.o: ax5043/axradio/axradioinit_p.h - cd ax5043/generated; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -pedantic -Wall -Wextra -c configcommon.c + cd ax5043/generated; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -Wall -Wextra -c configcommon.c ax5043/generated/configrx.o: ax5043/generated/configrx.c ax5043/generated/configrx.o: ax5043/generated/configrx.h ax5043/generated/configrx.o: ax5043/axradio/axradioinit.h ax5043/generated/configrx.o: ax5043/axradio/axradioinit_p.h - cd ax5043/generated; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -pedantic -Wall -Wextra -c configrx.c + cd ax5043/generated; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -Wall -Wextra -c configrx.c ax5043/generated/configtx.o: ax5043/generated/configtx.c ax5043/generated/configtx.o: ax5043/generated/configtx.h ax5043/generated/configtx.o: ax5043/axradio/axradioinit.h ax5043/generated/configtx.o: ax5043/axradio/axradioinit_p.h - cd ax5043/generated; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -pedantic -Wall -Wextra -c configtx.c + cd ax5043/generated; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -Wall -Wextra -c configtx.c ax5043/generated/config.o: ax5043/generated/config.c ax5043/generated/config.o: ax5043/generated/config.h @@ -113,12 +113,12 @@ ax5043/generated/config.o: ax5043/axradio/axradioinit_p.h ax5043/generated/config.o: ax5043/spi/ax5043spi.h ax5043/generated/config.o: ax5043/spi/ax5043spi_p.h ax5043/generated/config.o: ax5043/crc/crc.h - cd ax5043/generated; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -pedantic -Wall -Wextra -c config.c + cd ax5043/generated; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -Wall -Wextra -c config.c ax5043/spi/ax5043spi.o: ax5043/spi/ax5043spi.c ax5043/spi/ax5043spi.o: ax5043/spi/ax5043spi.h ax5043/spi/ax5043spi.o: ax5043/spi/ax5043spi_p.h - cd ax5043/spi; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -pedantic -Wall -Wextra -c ax5043spi.c + cd ax5043/spi; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -Wall -Wextra -c ax5043spi.c ax5043/ax5043support/ax5043init.o: ax5043/ax5043support/ax5043init.c ax5043/ax5043support/ax5043init.o: ax5043/ax5043support/ax5043init.h @@ -126,7 +126,7 @@ ax5043/ax5043support/ax5043init.o: ax5043/axradio/axradioinit.h ax5043/ax5043support/ax5043init.o: ax5043/axradio/axradioinit_p.h ax5043/ax5043support/ax5043init.o: ax5043/spi/ax5043spi.h ax5043/ax5043support/ax5043init.o: ax5043/spi/ax5043spi_p.h - cd ax5043/ax5043support; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -pedantic -Wall -Wextra -c ax5043init.c + cd ax5043/ax5043support; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -Wall -Wextra -c ax5043init.c ax5043/ax5043support/ax5043rx.o: ax5043/ax5043support/ax5043rx.c ax5043/ax5043support/ax5043rx.o: ax5043/ax5043support/ax5043rx.h @@ -134,7 +134,7 @@ ax5043/ax5043support/ax5043rx.o: ax5043/axradio/axradioinit.h ax5043/ax5043support/ax5043rx.o: ax5043/axradio/axradioinit_p.h ax5043/ax5043support/ax5043rx.o: ax5043/spi/ax5043spi.h ax5043/ax5043support/ax5043rx.o: ax5043/spi/ax5043spi_p.h - cd ax5043/ax5043support; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -pedantic -Wall -Wextra -c ax5043rx.c + cd ax5043/ax5043support; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -Wall -Wextra -c ax5043rx.c ax5043/ax5043support/ax5043tx.o: ax5043/ax5043support/ax5043tx.c ax5043/ax5043support/ax5043tx.o: ax5043/ax5043support/ax5043tx.h @@ -142,7 +142,7 @@ ax5043/ax5043support/ax5043tx.o: ax5043/axradio/axradioinit.h ax5043/ax5043support/ax5043tx.o: ax5043/axradio/axradioinit_p.h ax5043/ax5043support/ax5043tx.o: ax5043/spi/ax5043spi.h ax5043/ax5043support/ax5043tx.o: ax5043/spi/ax5043spi_p.h - cd ax5043/ax5043support; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -pedantic -Wall -Wextra -c ax5043tx.c + cd ax5043/ax5043support; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -Wall -Wextra -c ax5043tx.c ax5043/axradio/axradioinit.o: ax5043/axradio/axradioinit.c ax5043/axradio/axradioinit.o: ax5043/axradio/axradioinit.h @@ -152,7 +152,7 @@ ax5043/axradio/axradioinit.o: ax5043/spi/ax5043spi.h ax5043/axradio/axradioinit.o: ax5043/spi/ax5043spi_p.h ax5043/axradio/axradioinit.o: ax5043/generated/config.h ax5043/axradio/axradioinit.o: ax5043/crc/crc.h - cd ax5043/axradio; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -pedantic -Wall -Wextra -c axradioinit.c + cd ax5043/axradio; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -Wall -Wextra -c axradioinit.c ax5043/axradio/axradiomode.o: ax5043/axradio/axradiomode.c ax5043/axradio/axradiomode.o: ax5043/axradio/axradiomode.h @@ -162,7 +162,7 @@ ax5043/axradio/axradiomode.o: ax5043/axradio/axradioinit_p.h ax5043/axradio/axradiomode.o: ax5043/spi/ax5043spi.h ax5043/axradio/axradiomode.o: ax5043/spi/ax5043spi_p.h ax5043/axradio/axradiomode.o: ax5043/generated/config.h - cd ax5043/axradio; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -pedantic -Wall -Wextra -c axradiomode.c + cd ax5043/axradio; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -Wall -Wextra -c axradiomode.c ax5043/axradio/axradiorx.o: ax5043/axradio/axradiorx.c ax5043/axradio/axradiorx.o: ax5043/axradio/axradiorx.h @@ -172,7 +172,7 @@ ax5043/axradio/axradiorx.o: ax5043/axradio/axradioinit.h ax5043/axradio/axradiorx.o: ax5043/axradio/axradioinit_p.h ax5043/axradio/axradiorx.o: ax5043/spi/ax5043spi.h ax5043/axradio/axradiorx.o: ax5043/spi/ax5043spi_p.h - cd ax5043/axradio; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -pedantic -Wall -Wextra -c axradiorx.c + cd ax5043/axradio; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -Wall -Wextra -c axradiorx.c ax5043/axradio/axradiotx.o: ax5043/axradio/axradiotx.c ax5043/axradio/axradiotx.o: ax5043/axradio/axradiotx.h @@ -186,11 +186,11 @@ ax5043/axradio/axradiotx.o: ax5043/generated/config.h ax5043/axradio/axradiotx.o: ax5043/axradio/axradiomode.h ax5043/axradio/axradiotx.o: ax5043/axradio/axradiomode_p.h ax5043/axradio/axradiotx.o: ax5043/crc/crc.h - cd ax5043/axradio; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -pedantic -Wall -Wextra -c axradiotx.c + cd ax5043/axradio; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -Wall -Wextra -c axradiotx.c ax5043/crc/crc.o: ax5043/crc/crc.c ax5043/crc/crc.o: ax5043/crc/crc.h - cd ax5043/crc; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -pedantic -Wall -Wextra -c crc.c + cd ax5043/crc; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -Wall -Wextra -c crc.c chat/chat_main.o: chat/chat_main.c chat/chat_main.o: ax5043/spi/ax5043spi.h @@ -204,13 +204,13 @@ chat/chat_main.o: ax5043/axradio/axradiorx_p.h chat/chat_main.o: ax5043/axradio/axradiotx.h chat/chat_main.o: ax5043/axradio/axradiotx_p.h chat/chat_main.o: ax5043/generated/configtx.h - cd chat; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I../ax5043 -pedantic -Wconversion -Wall -Wextra -c chat_main.c; cd .. + cd chat; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I../ax5043 -Wconversion -Wall -Wextra -c chat_main.c; cd .. afsk/ax25.o: afsk/ax25.c afsk/ax25.o: afsk/ax25.h afsk/ax25.o: afsk/ax5043.h afsk/ax25.o: afsk/status.h - cd afsk; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -pedantic -Wconversion -Wall -Wextra -c ax25.c; cd .. + cd afsk; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -Wconversion -Wall -Wextra -c ax25.c; cd .. afsk/ax5043.o: afsk/ax5043.c afsk/ax5043.o: afsk/ax25.h @@ -219,17 +219,17 @@ afsk/ax5043.o: afsk/status.h afsk/ax5043.o: afsk/utils.h afsk/ax5043.o: afsk/main.c afsk/ax5043.o: ax5043/spi/ax5043spi.h - cd afsk; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -pedantic -Wconversion -Wall -Wextra -c ax5043.c; cd .. + cd afsk; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -Wconversion -Wall -Wextra -c ax5043.c; cd .. afsk/main.o: afsk/main.c afsk/main.o: afsk/status.h afsk/main.o: afsk/ax5043.h afsk/main.o: afsk/ax25.h afsk/main.o: ax5043/spi/ax5043spi.h - cd afsk; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -pedantic -Wconversion -Wall -Wextra -c main.c; cd .. + cd afsk; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -Wconversion -Wall -Wextra -c main.c; cd .. afsk/telem.o: afsk/telem.c - cd afsk; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -pedantic -Wconversion -Wall -Wextra -c telem.c; cd .. + cd afsk; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -Wconversion -Wall -Wextra -c telem.c; cd .. cw/cw_main.o: cw/cw_main.c cw/cw_main.o: ax5043/spi/ax5043spi.h @@ -243,7 +243,7 @@ cw/cw_main.o: ax5043/axradio/axradiorx_p.h cw/cw_main.o: ax5043/axradio/axradiotx.h cw/cw_main.o: ax5043/axradio/axradiotx_p.h cw/cw_main.o: ax5043/generated/configtx.h - cd cw; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I../ax5043 -pedantic -Wconversion -Wall -Wextra -c cw_main.c; cd .. + cd cw; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I../ax5043 -Wconversion -Wall -Wextra -c cw_main.c; cd .. piglatin/piglatin_main.o: piglatin/piglatin_main.c piglatin/piglatin_main.o: ax5043/spi/ax5043spi.h @@ -257,7 +257,7 @@ piglatin/piglatin_main.o: ax5043/axradio/axradiorx_p.h piglatin/piglatin_main.o: ax5043/axradio/axradiotx.h piglatin/piglatin_main.o: ax5043/axradio/axradiotx_p.h piglatin/piglatin_main.o: ax5043/generated/configtx.h - cd piglatin; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -pedantic -Wconversion -Wall -Wextra -c piglatin_main.c; cd .. + cd piglatin; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -Wconversion -Wall -Wextra -c piglatin_main.c; cd .. receive/receive_main.o: receive/receive_main.c receive/receive_main.o: ax5043/axradio/axradioinit.h @@ -269,7 +269,7 @@ receive/receive_main.o: ax5043/axradio/axradiomode_p.h receive/receive_main.o: ax5043/axradio/axradiorx.h receive/receive_main.o: ax5043/axradio/axradiorx_p.h receive/receive_main.o: ax5043/generated/configrx.h - cd receive; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -pedantic -Wconversion -Wall -Wextra -c receive_main.c; cd .. + cd receive; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -Wconversion -Wall -Wextra -c receive_main.c; cd .. transmit/transmit_main.o: transmit/transmit_main.c transmit/transmit_main.o: ax5043/axradio/axradioinit.h @@ -281,7 +281,7 @@ transmit/transmit_main.o: ax5043/axradio/axradiomode_p.h transmit/transmit_main.o: ax5043/axradio/axradiotx.h transmit/transmit_main.o: ax5043/axradio/axradiotx_p.h transmit/transmit_main.o: ax5043/generated/configtx.h - cd transmit; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -pedantic -Wconversion -Wall -Wextra -c transmit_main.c; cd .. + cd transmit; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -Wconversion -Wall -Wextra -c transmit_main.c; cd .. transmit2freq/transmit2freq_main.o: transmit2freq/transmit2freq_main.c transmit2freq/transmit2freq_main.o: ax5043/axradio/axradioinit.h @@ -293,20 +293,20 @@ transmit2freq/transmit2freq_main.o: ax5043/axradio/axradiomode_p.h transmit2freq/transmit2freq_main.o: ax5043/axradio/axradiotx.h transmit2freq/transmit2freq_main.o: ax5043/axradio/axradiotx_p.h transmit2freq/transmit2freq_main.o: ax5043/generated/configtx.h - cd transmit2freq; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -pedantic -Wconversion -Wall -Wextra -c transmit2freq_main.c; cd .. + cd transmit2freq; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -Wconversion -Wall -Wextra -c transmit2freq_main.c; cd .. init/init_main.o: init/init_main.c init/init_main.o: ax5043/axradio/axradioinit.h init/init_main.o: ax5043/axradio/axradioinit_p.h init/init_main.o: ax5043/spi/ax5043spi.h init/init_main.o: ax5043/spi/ax5043spi_p.h - cd init; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -pedantic -Wconversion -Wall -Wextra -c init_main.c; cd .. + cd init; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -Wconversion -Wall -Wextra -c init_main.c; cd .. afsktx/ax25.o: afsktx/ax25.c afsktx/ax25.o: afsktx/ax25.h afsktx/ax25.o: afsktx/ax5043.h afsktx/ax25.o: afsktx/status.h - cd afsktx; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -pedantic -Wconversion -Wall -Wextra -c ax25.c; cd .. + cd afsktx; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -Wconversion -Wall -Wextra -c ax25.c; cd .. afsktx/ax5043.o: afsktx/ax5043.c afsktx/ax5043.o: afsktx/ax25.h @@ -314,11 +314,11 @@ afsktx/ax5043.o: afsktx/ax5043.h afsktx/ax5043.o: afsktx/status.h afsktx/ax5043.o: afsktx/utils.h afsktx/ax5043.o: ax5043/spi/ax5043spi.h - cd afsktx; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -pedantic -Wconversion -Wall -Wextra -c ax5043.c; cd .. + cd afsktx; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -Wconversion -Wall -Wextra -c ax5043.c; cd .. afsktx/main.o: afsktx/main.c afsktx/main.o: afsktx/status.h afsktx/main.o: afsktx/ax5043.h afsktx/main.o: afsktx/ax25.h afsktx/main.o: ax5043/spi/ax5043spi.h - cd afsktx; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -pedantic -Wconversion -Wall -Wextra -c main.c; cd .. + cd afsktx; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -Wconversion -Wall -Wextra -c main.c; cd .. From 82431f14600c646d4b9a23b23371f6aaf43ee7c9 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 21 Dec 2020 18:23:06 -0500 Subject: [PATCH 02/17] start of cleanup of compiler warnings --- afsk/main.c | 46 +++++++++++++++++++++++----------------------- 1 file changed, 23 insertions(+), 23 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 42dd18d5..6853fc65 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -138,7 +138,7 @@ int sampleTime = 0, frames_sent = 0; int cw_id = ON; int vB4 = FALSE, vB5 = FALSE, vB3 = FALSE, ax5043 = FALSE, transmit = FALSE, onLed, onLedOn, onLedOff, txLed, txLedOn, txLedOff, payload = OFF; float batteryThreshold = 3.0, batteryVoltage; -float latitude = 39.027702, longitude = -77.078064; +float latitude = 39.027702f, longitude = -77.078064f; float lat_file, long_file; float axis[3], angle[3], volts_max[3], amps_max[3], batt, speed, period, tempS, temp_max, temp_min; @@ -199,7 +199,7 @@ int main(int argc, char * argv[]) { config_file = fopen("/home/pi/CubeSatSim/sim.cfg", "r"); } - char * cfg_buf[100]; +// char * cfg_buf[100]; fscanf(config_file, "%s %d %f %f", call, & reset_count, & lat_file, & long_file); fclose(config_file); printf("Config file /home/pi/CubeSatSim/sim.cfg contains %s %d %f %f\n", call, reset_count, lat_file, long_file); @@ -356,11 +356,11 @@ int main(int argc, char * argv[]) { if ((uart_fd = serialOpen("/dev/ttyAMA0", 9600)) >= 0) { char c; - int charss = serialDataAvail(uart_fd); + int charss = (char) serialDataAvail(uart_fd); if (charss != 0) printf("Clearing buffer of %d chars \n", charss); while ((charss--> 0)) - c = serialGetchar(uart_fd); // clear buffer + c = (char) serialGetchar(uart_fd); // clear buffer unsigned int waitTime; int i; @@ -401,9 +401,9 @@ int main(int argc, char * argv[]) { FILE * file4 = popen("vcgencmd get_camera", "r"); fgets(cmdbuffer1, 1000, file4); char camera_present[] = "supported=1 detected=1"; - printf("strstr: %s \n", strstr( & cmdbuffer1, camera_present)); + // printf("strstr: %s \n", strstr( & cmdbuffer1, camera_present)); camera = (strstr( & cmdbuffer1, camera_present) != NULL) ? ON : OFF; - printf("Camera result:%s camera: %d \n", & cmdbuffer1, camera); + // printf("Camera result:%s camera: %d \n", & cmdbuffer1, camera); pclose(file4); #ifdef DEBUG_LOGGING @@ -416,7 +416,7 @@ int main(int argc, char * argv[]) { printf("Simulated telemetry mode!\n"); - srand(time(0)); + srand((unsigned int)time(0)); axis[0] = rnd_float(-0.2, 0.2); if (axis[0] == 0) @@ -452,14 +452,14 @@ int main(int argc, char * argv[]) { printf("batt: %f speed: %f eclipse_time: %f eclipse: %d period: %f temp: %f max: %f min: %f\n", batt, speed, eclipse_time, eclipse, period, tempS, temp_max, temp_min); #endif - time_start = millis(); + time_start = (long int) millis(); - eclipse_time = millis() / 1000.0; + eclipse_time = (long int)(millis() / 1000.0); if (eclipse == 0) eclipse_time -= period / 2; // if starting in eclipse, shorten interval } - int ret; + //int ret; //uint8_t data[1024]; tx_freq_hz -= tx_channel * 50000; @@ -527,8 +527,8 @@ int main(int argc, char * argv[]) { samples = S_RATE / bitRate; bufLen = (frameCnt * (syncBits + 10 * (headerLen + rsFrames * (rsFrameLen + parityLen))) * samples); - samplePeriod = ((float)((syncBits + 10 * (headerLen + rsFrames * (rsFrameLen + parityLen)))) / (float) bitRate) * 1000 - 500; - sleepTime = 0.1; + samplePeriod = (int) (((float)((syncBits + 10 * (headerLen + rsFrames * (rsFrameLen + parityLen)))) / (float) bitRate) * 1000 - 500); + sleepTime = 0.1f; printf("\n FSK Mode, %d bits per frame, %d bits per second, %d ms sample period\n", bufLen / (samples * frameCnt), bitRate, samplePeriod); @@ -550,7 +550,7 @@ int main(int argc, char * argv[]) { // samplePeriod = 3000; // sleepTime = 3.0; samplePeriod = 2200; // reduce dut to python and sensor querying delays - sleepTime = 2.2; + sleepTime = 2.2f; printf("\n BPSK Mode, bufLen: %d, %d bits per frame, %d bits per second, %d seconds per frame %d ms sample period\n", bufLen, bufLen / (samples * frameCnt), bitRate, bufLen / (samples * frameCnt * bitRate), samplePeriod); @@ -580,7 +580,7 @@ int main(int argc, char * argv[]) { printf("Tx LED On\n"); #endif printf("Sleeping to allow BPSK transmission to finish.\n"); - sleep(loop_count * 5); + sleep((int)(loop_count * 5)); printf("Done sleeping\n"); digitalWrite(txLed, txLedOff); #ifdef DEBUG_LOGGING @@ -588,7 +588,7 @@ int main(int argc, char * argv[]) { #endif } else if (mode == FSK) { printf("Sleeping to allow FSK transmission to finish.\n"); - sleep(loop_count); + sleep((int)loop_count); printf("Done sleeping\n"); } @@ -667,15 +667,15 @@ int get_tlm(void) { for (count1 = 0; count1 < 8; count1++) { if (token != NULL) { - voltage[count1] = atof(token); + voltage[count1] = (float) atof(token); #ifdef DEBUG_LOGGING // printf("voltage: %f ", voltage[count1]); #endif token = strtok(NULL, space); if (token != NULL) { - current[count1] = atof(token); + current[count1] = (float) atof(token); if ((current[count1] < 0) && (current[count1] > -0.5)) - current[count1] *= (-1.0); + current[count1] *= (-1); #ifdef DEBUG_LOGGING // printf("current: %f\n", current[count1]); #endif @@ -703,7 +703,7 @@ int get_tlm(void) { if (sim_mode) { // simulated telemetry - double time = (millis() - time_start) / 1000.0; + double time = ((long int) millis() - time_start) / 1000.0; if ((time - eclipse_time) > period) { eclipse = (eclipse == 1) ? 0 : 1; @@ -1071,13 +1071,13 @@ int get_tlm_fox() { for (count1 = 0; count1 < 8; count1++) { if (token != NULL) { - voltage[count1] = atof(token); + voltage[count1] = (float) atof(token); #ifdef DEBUG_LOGGING // printf("voltage: %f ", voltage[count1]); #endif token = strtok(NULL, space); if (token != NULL) { - current[count1] = atof(token); + current[count1] = (float) atof(token); if ((current[count1] < 0) && (current[count1] > -0.5)) current[count1] *= (-1.0); #ifdef DEBUG_LOGGING @@ -1165,7 +1165,7 @@ int get_tlm_fox() { token = strtok(sensor_payload, space); for (count1 = 0; count1 < 17; count1++) { if (token != NULL) { - sensor[count1] = atof(token); + sensor[count1] = (float) atof(token); #ifdef DEBUG_LOGGING printf("sensor: %f ", sensor[count1]); #endif @@ -1181,7 +1181,7 @@ int get_tlm_fox() { if (sim_mode) { // simulated telemetry - double time = (millis() - time_start) / 1000.0; + double time = ((long int)millis() - time_start) / 1000.0; if ((time - eclipse_time) > period) { eclipse = (eclipse == 1) ? 0 : 1; From 8685cf1c186968c62f04f7bfbf1a74abee271cd0 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 21 Dec 2020 21:13:16 -0500 Subject: [PATCH 03/17] more fixing of warnings --- afsk/main.c | 48 ++++++++++++++++++++++++++++-------------------- 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 6853fc65..7a02295e 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -86,8 +86,8 @@ ax25_conf_t hax25; int twosToInt(int val, int len); float rnd_float(double min, double max); -int get_tlm(void); -int get_tlm_fox(); +void get_tlm(); +void get_tlm_fox(); int encodeA(short int * b, int index, int val); int encodeB(short int * b, int index, int val); void config_x25(); @@ -141,8 +141,8 @@ float batteryThreshold = 3.0, batteryVoltage; float latitude = 39.027702f, longitude = -77.078064f; float lat_file, long_file; -float axis[3], angle[3], volts_max[3], amps_max[3], batt, speed, period, tempS, temp_max, temp_min; -int eclipse, i2c_bus0 = OFF, i2c_bus1 = OFF, i2c_bus3 = OFF, camera = OFF, sim_mode = FALSE, rxAntennaDeployed = 0, txAntennaDeployed = 0; +float axis[3], angle[3], volts_max[3], amps_max[3], batt, speed, period, tempS, temp_max, temp_min, eclipse; +int i2c_bus0 = OFF, i2c_bus1 = OFF, i2c_bus3 = OFF, camera = OFF, sim_mode = FALSE, rxAntennaDeployed = 0, txAntennaDeployed = 0; double eclipse_time; int test_i2c_bus(int bus); @@ -370,10 +370,10 @@ int main(int argc, char * argv[]) { waitTime = millis() + 500; while ((millis() < waitTime) && (payload != ON)) { if (serialDataAvail(uart_fd)) { - printf("%c", c = serialGetchar(uart_fd)); + printf("%c", c = (char) serialGetchar(uart_fd)); fflush(stdout); if (c == 'O') { - printf("%c", c = serialGetchar(uart_fd)); + printf("%c", c = (char) serialGetchar(uart_fd)); fflush(stdout); if (c == 'K') payload = ON; @@ -440,7 +440,7 @@ int main(int argc, char * argv[]) { batt = rnd_float(3.8, 4.3); speed = rnd_float(1.0, 2.5); - eclipse = (rnd_float(-1, +4) > 0) ? 1 : 0; + eclipse = (rnd_float(-1, +4) > 0) ? 1.0 : 0.0; period = rnd_float(150, 300); tempS = rnd_float(20, 55); temp_max = rnd_float(50, 70); @@ -449,13 +449,13 @@ int main(int argc, char * argv[]) { #ifdef DEBUG_LOGGING for (int i = 0; i < 3; i++) printf("axis: %f angle: %f v: %f i: %f \n", axis[i], angle[i], volts_max[i], amps_max[i]); - printf("batt: %f speed: %f eclipse_time: %f eclipse: %d period: %f temp: %f max: %f min: %f\n", batt, speed, eclipse_time, eclipse, period, tempS, temp_max, temp_min); + printf("batt: %f speed: %f eclipse_time: %f eclipse: %f period: %f temp: %f max: %f min: %f\n", batt, speed, eclipse_time, eclipse, period, tempS, temp_max, temp_min); #endif time_start = (long int) millis(); eclipse_time = (long int)(millis() / 1000.0); - if (eclipse == 0) + if (eclipse == 0.0) eclipse_time -= period / 2; // if starting in eclipse, shorten interval } @@ -580,7 +580,7 @@ int main(int argc, char * argv[]) { printf("Tx LED On\n"); #endif printf("Sleeping to allow BPSK transmission to finish.\n"); - sleep((int)(loop_count * 5)); + sleep((unsigned int)(loop_count * 5)); printf("Done sleeping\n"); digitalWrite(txLed, txLedOff); #ifdef DEBUG_LOGGING @@ -588,7 +588,7 @@ int main(int argc, char * argv[]) { #endif } else if (mode == FSK) { printf("Sleeping to allow FSK transmission to finish.\n"); - sleep((int)loop_count); + sleep((unsigned int)loop_count); printf("Done sleeping\n"); } @@ -634,7 +634,7 @@ static int init_rf() { return (1); } -int get_tlm(void) { +void get_tlm(void) { FILE * txResult; @@ -642,7 +642,6 @@ int get_tlm(void) { digitalWrite(txLed, txLedOn); #ifdef DEBUG_LOGGING printf("Tx LED On\n"); - #endif int tlm[7][5]; memset(tlm, 0, sizeof tlm); @@ -706,7 +705,7 @@ int get_tlm(void) { double time = ((long int) millis() - time_start) / 1000.0; if ((time - eclipse_time) > period) { - eclipse = (eclipse == 1) ? 0 : 1; + eclipse = (eclipse == 1) ? 0.0 : 1.0; eclipse_time = time; printf("\n\nSwitching eclipse mode! \n\n"); } @@ -716,6 +715,7 @@ int get_tlm(void) { double Yi = eclipse * amps_max[1] * sin((2.0 * 3.14 * time / (46.0 * speed)) + (3.14/2.0)) * fabs(sin((2.0 * 3.14 * time / (46.0 * speed)) + (3.14/2.0))) + rnd_float(-2, 2); double Zi = eclipse * amps_max[2] * sin((2.0 * 3.14 * time / (46.0 * speed)) + 3.14 + angle[2]) * fabs(sin((2.0 * 3.14 * time / (46.0 * speed)) + 3.14 + angle[2])) + rnd_float(-2, 2); */ +/* double Xi = eclipse * amps_max[0] * sin(2.0 * 3.14 * time / (46.0 * speed)) + rnd_float(-2, 2); double Yi = eclipse * amps_max[1] * sin((2.0 * 3.14 * time / (46.0 * speed)) + (3.14 / 2.0)) + rnd_float(-2, 2); double Zi = eclipse * amps_max[2] * sin((2.0 * 3.14 * time / (46.0 * speed)) + 3.14 + angle[2]) + rnd_float(-2, 2); @@ -723,6 +723,14 @@ int get_tlm(void) { double Xv = eclipse * volts_max[0] * sin(2.0 * 3.14 * time / (46.0 * speed)) + rnd_float(-0.2, 0.2); double Yv = eclipse * volts_max[1] * sin((2.0 * 3.14 * time / (46.0 * speed)) + (3.14 / 2.0)) + rnd_float(-0.2, 0.2); double Zv = 2.0 * eclipse * volts_max[2] * sin((2.0 * 3.14 * time / (46.0 * speed)) + 3.14 + angle[2]) + rnd_float(-0.2, 0.2); +*/ + float Xi = eclipse * amps_max[0] * sin(2.0 * 3.14 * time / (46.0 * speed)) + rnd_float(-2, 2); + float Yi = eclipse * amps_max[1] * sin((2.0 * 3.14 * time / (46.0 * speed)) + (3.14 / 2.0)) + rnd_float(-2, 2); + float Zi = eclipse * amps_max[2] * sin((2.0 * 3.14 * time / (46.0 * speed)) + 3.14 + angle[2]) + rnd_float(-2, 2); + + float Xv = eclipse * volts_max[0] * sin(2.0 * 3.14 * time / (46.0 * speed)) + rnd_float(-0.2, 0.2); + float Yv = eclipse * volts_max[1] * sin((2.0 * 3.14 * time / (46.0 * speed)) + (3.14 / 2.0)) + rnd_float(-0.2, 0.2); + float Zv = 2.0 * eclipse * volts_max[2] * sin((2.0 * 3.14 * time / (46.0 * speed)) + 3.14 + angle[2]) + rnd_float(-0.2, 0.2); // printf("Yi: %f Zi: %f %f %f Zv: %f \n", Yi, Zi, amps_max[2], angle[2], Zv); @@ -864,11 +872,11 @@ int get_tlm(void) { if (payload == ON) { char c; - int charss = serialDataAvail(uart_fd); + int charss = (char) serialDataAvail(uart_fd); if (charss != 0) printf("Clearing buffer of %d chars \n", charss); while ((charss--> 0)) - c = serialGetchar(uart_fd); // clear buffer + c = (char) serialGetchar(uart_fd); // clear buffer unsigned int waitTime; int i = 0; @@ -878,9 +886,9 @@ int get_tlm(void) { waitTime = millis() + 500; int end = FALSE; while ((millis() < waitTime) && !end) { - int chars = serialDataAvail(uart_fd); + int chars = (char) serialDataAvail(uart_fd); while ((chars--> 0) && !end) { - c = serialGetchar(uart_fd); + c = (char) serialGetchar(uart_fd); // printf ("%c", c); // fflush(stdout); if (c != '\n') { @@ -968,7 +976,7 @@ int get_tlm(void) { return; } -int get_tlm_fox() { +void get_tlm_fox() { // Reading I2C voltage and current sensors @@ -1039,7 +1047,7 @@ int get_tlm_fox() { #endif while ((millis() - sampleTime) < samplePeriod) - sleep(sleepTime); + sleep((unsigned int)sleepTime); digitalWrite(txLed, txLedOff); #ifdef DEBUG_LOGGING From 02e259bf1110dbac18c3acca283db3922336b13f Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 21 Dec 2020 21:17:14 -0500 Subject: [PATCH 04/17] missing #endif --- afsk/main.c | 1 + 1 file changed, 1 insertion(+) diff --git a/afsk/main.c b/afsk/main.c index 7a02295e..01d415eb 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -642,6 +642,7 @@ void get_tlm(void) { digitalWrite(txLed, txLedOn); #ifdef DEBUG_LOGGING printf("Tx LED On\n"); + #endif int tlm[7][5]; memset(tlm, 0, sizeof tlm); From 86a2f7074815e22ad236b84844567b7830677564 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 21 Dec 2020 21:26:34 -0500 Subject: [PATCH 05/17] more --- afsk/main.c | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 01d415eb..411bbd6a 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -993,7 +993,7 @@ void get_tlm_fox() { // long int sync = SYNC_WORD; long int sync = syncWord; - smaller = S_RATE / (2 * freq_Hz); + smaller = (int) (S_RATE / (2 * freq_Hz)); // short int b[DATA_LEN]; short int b[dataLen]; @@ -1030,7 +1030,7 @@ void get_tlm_fox() { short int buffer_test[bufLen]; int buffSize; - buffSize = sizeof(buffer_test); + buffSize = (int) sizeof(buffer_test); if (mode == FSK) id = 7; @@ -1047,7 +1047,7 @@ void get_tlm_fox() { printf("Tx LED On\n"); #endif - while ((millis() - sampleTime) < samplePeriod) + while ((millis() - sampleTime) < (unsigned int)samplePeriod) sleep((unsigned int)sleepTime); digitalWrite(txLed, txLedOff); @@ -1055,8 +1055,8 @@ void get_tlm_fox() { printf("Tx LED Off\n"); #endif - printf("Sample period: %d\n", millis() - sampleTime); - sampleTime = millis(); + printf("Sample period: %d\n", millis() - (unsigned int)sampleTime); + sampleTime = (int) millis(); } else printf("first time - no sleep\n"); @@ -1128,11 +1128,11 @@ void get_tlm_fox() { STEMBoardFailure = 0; char c; - int charss = serialDataAvail(uart_fd); + int charss = (char) serialDataAvail(uart_fd); if (charss != 0) printf("Clearing buffer of %d chars \n", charss); while ((charss--> 0)) - c = serialGetchar(uart_fd); // clear buffer + c = (char) serialGetchar(uart_fd); // clear buffer unsigned int waitTime; int i = 0; @@ -1142,9 +1142,9 @@ void get_tlm_fox() { int end = FALSE; // int retry = FALSE; while ((millis() < waitTime) && !end) { - int chars = serialDataAvail(uart_fd); + int chars = (char) serialDataAvail(uart_fd); while ((chars--> 0) && !end) { - c = serialGetchar(uart_fd); + c = (char) serialGetchar(uart_fd); // printf ("%c", c); // fflush(stdout); if (c != '\n') { @@ -1332,20 +1332,20 @@ void get_tlm_fox() { fclose(uptime_file); printf("Reset Count: %d Uptime since Reset: %ld \n", reset_count, uptime); - h[0] = (h[0] & 0xf8) | (id & 0x07); // 3 bits + h[0] = (short int) ((h[0] & 0xf8) | (id & 0x07)); // 3 bits // printf("h[0] %x\n", h[0]); - h[0] = (h[0] & 0x07) | ((reset_count & 0x1f) << 3); + h[0] = (short int) ((h[0] & 0x07) | ((reset_count & 0x1f) << 3)); // printf("h[0] %x\n", h[0]); - h[1] = (reset_count >> 5) & 0xff; + h[1] = (short int) ((reset_count >> 5) & 0xff); // printf("h[1] %x\n", h[1]); - h[2] = (h[2] & 0xf8) | ((reset_count >> 13) & 0x07); + h[2] = (short int) ((h[2] & 0xf8) | ((reset_count >> 13) & 0x07)); // printf("h[2] %x\n", h[2]); - h[2] = (h[2] & 0x0e) | ((uptime & 0x1f) << 3); + h[2] = (short int) ((h[2] & 0x0e) | ((uptime & 0x1f) << 3)); // printf("h[2] %x\n", h[2]); - h[3] = (uptime >> 5) & 0xff; - h[4] = (uptime >> 13) & 0xff; - h[5] = (h[5] & 0xf0) | ((uptime >> 21) & 0x0f); - h[5] = (h[5] & 0x0f) | (frm_type << 4); + h[3] = (short int) ((uptime >> 5) & 0xff); + h[4] = (short int) ((uptime >> 13) & 0xff); + h[5] = (short int) ((h[5] & 0xf0) | ((uptime >> 21) & 0x0f)); + h[5] = (short int) ((h[5] & 0x0f) | (frm_type << 4)); if (mode == BPSK) h[6] = 99; From 63e95663a04bcec7a64480d69f79171cbd09f158 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Mon, 21 Dec 2020 21:33:20 -0500 Subject: [PATCH 06/17] even more --- afsk/main.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 411bbd6a..c7f68d8a 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1021,10 +1021,10 @@ void get_tlm_fox() { int head_offset = 0; // int xAngularVelocity = (-0.69)*(-10)*(-10) + 45.3 * (-10) + 2078, yAngularVelocity = (-0.69)*(-6)*(-6) + 45.3 * (-6) + 2078, zAngularVelocity = (-0.69)*(6)*(6) + 45.3 * (6) + 2078; // XAxisAngularVelocity // int xAngularVelocity = 2078, yAngularVelocity = 2078, zAngularVelocity = 2078; // XAxisAngularVelocity Y and Z set to 0 - int xAngularVelocity = 2048, yAngularVelocity = 2048, zAngularVelocity = 2048; // XAxisAngularVelocity Y and Z set to 0 + // int xAngularVelocity = 2048, yAngularVelocity = 2048, zAngularVelocity = 2048; // XAxisAngularVelocity Y and Z set to 0 int RXTemperature = 0, temp = 0, spin = 0;; - float xAccel = 0.0, yAccel = 0.0, zAccel = 0.0; - float BME280pressure = 0.0, BME280altitude = 0.0, BME280humidity = 0.0, BME280temperature = 0.0; + // float xAccel = 0.0, yAccel = 0.0, zAccel = 0.0; + // float BME280pressure = 0.0, BME280altitude = 0.0, BME280humidity = 0.0, BME280temperature = 0.0; float XSsensor1 = 0.0, XSsensor2 = 0.0, XSsensor3 = 0.0; int sensor1 = 0, sensor2 = 2048, sensor3 = 2048; @@ -1702,8 +1702,8 @@ void get_tlm_fox() { //static int encodeB(short int *b, int index, int val); //static int encodeA(short int *b, int index, int val); - static int NOT_FRAME = /* 0fa */ 0xfa & 0x3ff; - static int FRAME = /* 0fa */ ~0xfa & 0x3ff; +// static int NOT_FRAME = /* 0fa */ 0xfa & 0x3ff; +// static int FRAME = /* 0fa */ ~0xfa & 0x3ff; /* * TelemEncoding.c @@ -1892,13 +1892,13 @@ void write_wave(int i, short int *buffer) int encodeA(short int *b, int index, int val) { // printf("Encoding A\n"); b[index] = val & 0xff; - b[index + 1] = (b[index + 1] & 0xf0) | ((val >> 8) & 0x0f); + b[index + 1] = (short int) ((b[index + 1] & 0xf0) | ((val >> 8) & 0x0f)); return 0; } int encodeB(short int *b, int index, int val) { // printf("Encoding B\n"); - b[index] = (b[index] & 0x0f) | ((val << 4) & 0xf0); + b[index] = (short int) ((b[index] & 0x0f) | ((val << 4) & 0xf0)); b[index + 1] = (val >> 4 ) & 0xff; return 0; } From 031e66ad834304e96cacf0b5cf71f046eaac6983 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 22 Dec 2020 10:14:38 -0500 Subject: [PATCH 07/17] no MAX MIN for BPSK, added WOD field test --- afsk/main.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index c7f68d8a..f7b33cdc 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1294,6 +1294,7 @@ void get_tlm_fox() { printf("Other min %f max %f \n", other_min[count1], other_max[count1]); } + if (mode == FSK) { if (loop % 8 == 0) { printf("Sending MIN frame \n"); frm_type = 0x03; @@ -1322,7 +1323,7 @@ void get_tlm_fox() { sensor[count1] = sensor_max[count1]; } } - + } memset(rs_frame, 0, sizeof(rs_frame)); memset(parities, 0, sizeof(parities)); @@ -1474,6 +1475,11 @@ void get_tlm_fox() { txAntennaDeployed = 1; printf("TX Antenna Deployed!\n"); } + + if (mode == BPSK) { + encodeB(b, 60 + head_offset, 0xff); + encodeB(b, 66 + head_offset, 0xff); + } short int data10[headerLen + rsFrames * (rsFrameLen + parityLen)]; short int data8[headerLen + rsFrames * (rsFrameLen + parityLen)]; From d0fe751d10a72826df6afd0fab47defbeef209ac Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 22 Dec 2020 10:23:34 -0500 Subject: [PATCH 08/17] moving WOD fields --- afsk/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index f7b33cdc..bc22f3a9 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1476,9 +1476,9 @@ void get_tlm_fox() { printf("TX Antenna Deployed!\n"); } - if (mode == BPSK) { - encodeB(b, 60 + head_offset, 0xff); - encodeB(b, 66 + head_offset, 0xff); + if (mode == BPSK) { // WOD fields + encodeB(b, 70 + head_offset, 0xff); .. + encodeB(b, 76 + head_offset, 0xff); } short int data10[headerLen + rsFrames * (rsFrameLen + parityLen)]; short int data8[headerLen + rsFrames * (rsFrameLen + parityLen)]; From 99226a0f81c77a641947cdb7138eb6801918c12e Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 22 Dec 2020 10:24:58 -0500 Subject: [PATCH 09/17] typo --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index bc22f3a9..61e38132 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1477,7 +1477,7 @@ void get_tlm_fox() { } if (mode == BPSK) { // WOD fields - encodeB(b, 70 + head_offset, 0xff); .. + encodeB(b, 70 + head_offset, 0xff); encodeB(b, 76 + head_offset, 0xff); } short int data10[headerLen + rsFrames * (rsFrameLen + parityLen)]; From 7d7823869faacf906dd9caebd8b2ad79d90ea154 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 22 Dec 2020 11:25:37 -0500 Subject: [PATCH 10/17] end of WOD field experiments --- afsk/main.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 61e38132..6ea36767 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1476,9 +1476,9 @@ void get_tlm_fox() { printf("TX Antenna Deployed!\n"); } - if (mode == BPSK) { // WOD fields - encodeB(b, 70 + head_offset, 0xff); - encodeB(b, 76 + head_offset, 0xff); + if (mode == BPSK) { // WOD field experiments + encodeA(b, 63 + head_offset, 0xfff); + encodeB(b, 75 + head_offset, 0xfff); } short int data10[headerLen + rsFrames * (rsFrameLen + parityLen)]; short int data8[headerLen + rsFrames * (rsFrameLen + parityLen)]; From 0276a76c0d8a142c7632577cf9560c4e342ab8ed Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 22 Dec 2020 11:31:38 -0500 Subject: [PATCH 11/17] Update main.c --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index 6ea36767..327a720d 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1478,7 +1478,7 @@ void get_tlm_fox() { if (mode == BPSK) { // WOD field experiments encodeA(b, 63 + head_offset, 0xfff); - encodeB(b, 75 + head_offset, 0xfff); + encodeB(b, 75 + head_offset, 0xff); } short int data10[headerLen + rsFrames * (rsFrameLen + parityLen)]; short int data8[headerLen + rsFrames * (rsFrameLen + parityLen)]; From fb58b87a60d6adc61b253d1189ae5b8fbd84bad7 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Tue, 22 Dec 2020 11:35:50 -0500 Subject: [PATCH 12/17] WOD testing, not working yet --- afsk/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 327a720d..f54be6c5 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1477,8 +1477,8 @@ void get_tlm_fox() { } if (mode == BPSK) { // WOD field experiments - encodeA(b, 63 + head_offset, 0xfff); - encodeB(b, 75 + head_offset, 0xff); + encodeA(b, 63 + head_offset, 0xff); + encodeB(b, 74 + head_offset, 0xff); } short int data10[headerLen + rsFrames * (rsFrameLen + parityLen)]; short int data8[headerLen + rsFrames * (rsFrameLen + parityLen)]; From 0b46263f47a40b5018c265858d99c07fea13ad48 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 23 Dec 2020 11:27:19 -0500 Subject: [PATCH 13/17] more cleanup --- afsk/main.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index f54be6c5..775fa28f 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1012,7 +1012,7 @@ void get_tlm_fox() { short int rs_frame[rsFrames][223]; unsigned char parities[rsFrames][parityLen], inputByte; - int id, frm_type = 0x01, TxTemp = 0, IHUcpuTemp = 0, STEMBoardFailure = 1, NormalModeFailure = 0, groundCommandCount = 0; + int id, frm_type = 0x01, STEMBoardFailure = 1, NormalModeFailure = 0, groundCommandCount = 0; int PayloadFailure1 = 0, PayloadFailure2 = 0; int PSUVoltage = 0, PSUCurrent = 0, Resets = 0, Rssi = 2048; int batt_a_v = 0, batt_b_v = 0, batt_c_v = 0, battCurr = 0; @@ -1022,11 +1022,11 @@ void get_tlm_fox() { // int xAngularVelocity = (-0.69)*(-10)*(-10) + 45.3 * (-10) + 2078, yAngularVelocity = (-0.69)*(-6)*(-6) + 45.3 * (-6) + 2078, zAngularVelocity = (-0.69)*(6)*(6) + 45.3 * (6) + 2078; // XAxisAngularVelocity // int xAngularVelocity = 2078, yAngularVelocity = 2078, zAngularVelocity = 2078; // XAxisAngularVelocity Y and Z set to 0 // int xAngularVelocity = 2048, yAngularVelocity = 2048, zAngularVelocity = 2048; // XAxisAngularVelocity Y and Z set to 0 - int RXTemperature = 0, temp = 0, spin = 0;; + // int RXTemperature = 0, temp = 0, spin = 0;; // float xAccel = 0.0, yAccel = 0.0, zAccel = 0.0; // float BME280pressure = 0.0, BME280altitude = 0.0, BME280humidity = 0.0, BME280temperature = 0.0; - float XSsensor1 = 0.0, XSsensor2 = 0.0, XSsensor3 = 0.0; - int sensor1 = 0, sensor2 = 2048, sensor3 = 2048; + // float XSsensor1 = 0.0, XSsensor2 = 0.0, XSsensor3 = 0.0; + // int sensor1 = 0, sensor2 = 2048, sensor3 = 2048; short int buffer_test[bufLen]; int buffSize; @@ -1548,7 +1548,7 @@ void get_tlm_fox() { int data; int val; - int offset = 0; + //int offset = 0; #ifdef DEBUG_LOGGING // printf("\nAt start of buffer loop, syncBits %d samples %d ctr %d\n", syncBits, samples, ctr); @@ -1613,7 +1613,7 @@ void get_tlm_fox() { #endif int error = 0; - int count; + // int count; // for (count = 0; count < dataLen; count++) { // printf("%02X", b[count]); // } @@ -1623,8 +1623,8 @@ void get_tlm_fox() { if (!socket_open && transmit) { printf("Opening socket!\n"); - struct sockaddr_in address; - int valread; + // struct sockaddr_in address; + // int valread; struct sockaddr_in serv_addr; // char *hello = "Hello from client"; // char buffer[1024] = {0}; @@ -1657,10 +1657,10 @@ void get_tlm_fox() { if (!error && transmit) { // digitalWrite (0, LOW); - printf("Sending %d buffer bytes over socket after %d ms!\n", ctr, millis() - start); + printf("Sending %d buffer bytes over socket after %d ms!\n", ctr, (long unsigned int)millis() - start); start = millis(); - int sock_ret = send(sock, buffer, ctr * 2 + 2, 0); - printf("Millis5: %d Result of socket send: %d \n", millis() - start, sock_ret); + int sock_ret = send(sock, buffer, (unsigned int)(ctr * 2 + 2), 0); + printf("Millis5: %d Result of socket send: %d \n", (unsigned int)millis() - start, sock_ret); if (sock_ret < (ctr * 2 + 2)) { printf("Not resending\n"); @@ -1685,7 +1685,7 @@ void get_tlm_fox() { else if (frames_sent > 0) //5) firstTime = 0; - return 0; + return; } /* * TelemEncoding.h @@ -1880,9 +1880,9 @@ void write_wave(int i, short int *buffer) if (mode == FSK) { if ((ctr - flip_ctr) < smaller) - buffer[ctr++] = 0.1 * phase * (ctr - flip_ctr) / smaller; + buffer[ctr++] = (short int)(0.1 * phase * (ctr - flip_ctr) / smaller); else - buffer[ctr++] = 0.25 * amplitude * phase; + buffer[ctr++] = (short int)(0.25 * amplitude * phase); } else { From e508a3c118d3ac5805df7925da7e2c7ba104d047 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 23 Dec 2020 11:40:42 -0500 Subject: [PATCH 14/17] more cleanup --- afsk/main.c | 62 ++++++++++++++++++++++++++--------------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 775fa28f..7bfa7a43 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -725,33 +725,33 @@ void get_tlm(void) { double Yv = eclipse * volts_max[1] * sin((2.0 * 3.14 * time / (46.0 * speed)) + (3.14 / 2.0)) + rnd_float(-0.2, 0.2); double Zv = 2.0 * eclipse * volts_max[2] * sin((2.0 * 3.14 * time / (46.0 * speed)) + 3.14 + angle[2]) + rnd_float(-0.2, 0.2); */ - float Xi = eclipse * amps_max[0] * sin(2.0 * 3.14 * time / (46.0 * speed)) + rnd_float(-2, 2); - float Yi = eclipse * amps_max[1] * sin((2.0 * 3.14 * time / (46.0 * speed)) + (3.14 / 2.0)) + rnd_float(-2, 2); - float Zi = eclipse * amps_max[2] * sin((2.0 * 3.14 * time / (46.0 * speed)) + 3.14 + angle[2]) + rnd_float(-2, 2); + float Xi = eclipse * amps_max[0] * (float) sin(2.0 * 3.14 * time / (46.0 * speed)) + rnd_float(-2, 2); + float Yi = eclipse * amps_max[1] * (float) sin((2.0 * 3.14 * time / (46.0 * speed)) + (3.14 / 2.0)) + rnd_float(-2, 2); + float Zi = eclipse * amps_max[2] * (float) sin((2.0 * 3.14 * time / (46.0 * speed)) + 3.14 + angle[2]) + rnd_float(-2, 2); - float Xv = eclipse * volts_max[0] * sin(2.0 * 3.14 * time / (46.0 * speed)) + rnd_float(-0.2, 0.2); - float Yv = eclipse * volts_max[1] * sin((2.0 * 3.14 * time / (46.0 * speed)) + (3.14 / 2.0)) + rnd_float(-0.2, 0.2); - float Zv = 2.0 * eclipse * volts_max[2] * sin((2.0 * 3.14 * time / (46.0 * speed)) + 3.14 + angle[2]) + rnd_float(-0.2, 0.2); + float Xv = eclipse * volts_max[0] * (float) sin(2.0 * 3.14 * time / (46.0 * speed)) + rnd_float(-0.2, 0.2); + float Yv = eclipse * volts_max[1] * (float) sin((2.0 * 3.14 * time / (46.0 * speed)) + (3.14 / 2.0)) + rnd_float(-0.2, 0.2); + float Zv = 2.0 * eclipse * volts_max[2] * (float) sin((2.0 * 3.14 * time / (46.0 * speed)) + 3.14 + angle[2]) + rnd_float(-0.2, 0.2); // printf("Yi: %f Zi: %f %f %f Zv: %f \n", Yi, Zi, amps_max[2], angle[2], Zv); current[map[PLUS_X]] = (Xi >= 0) ? Xi : 0; - current[map[MINUS_X]] = (Xi >= 0) ? 0 : ((-1.0) * Xi); + current[map[MINUS_X]] = (Xi >= 0) ? 0 : ((-1.0f) * Xi); current[map[PLUS_Y]] = (Yi >= 0) ? Yi : 0; - current[map[MINUS_Y]] = (Yi >= 0) ? 0 : ((-1.0) * Yi); + current[map[MINUS_Y]] = (Yi >= 0) ? 0 : ((-1.0f) * Yi); current[map[PLUS_Z]] = (Zi >= 0) ? Zi : 0; - current[map[MINUS_Z]] = (Zi >= 0) ? 0 : ((-1.0) * Zi); + current[map[MINUS_Z]] = (Zi >= 0) ? 0 : ((-1.0f) * Zi); voltage[map[PLUS_X]] = (Xv >= 1) ? Xv : rnd_float(0.9, 1.1); - voltage[map[MINUS_X]] = (Xv <= -1) ? ((-1.0) * Xv) : rnd_float(0.9, 1.1); + voltage[map[MINUS_X]] = (Xv <= -1) ? ((-1.0f) * Xv) : rnd_float(0.9, 1.1); voltage[map[PLUS_Y]] = (Yv >= 1) ? Yv : rnd_float(0.9, 1.1); - voltage[map[MINUS_Y]] = (Yv <= -1) ? ((-1.0) * Yv) : rnd_float(0.9, 1.1); + voltage[map[MINUS_Y]] = (Yv <= -1) ? ((-1.0f) * Yv) : rnd_float(0.9, 1.1); voltage[map[PLUS_Z]] = (Zv >= 1) ? Zv : rnd_float(0.9, 1.1); - voltage[map[MINUS_Z]] = (Zv <= -1) ? ((-1.0) * Zv) : rnd_float(0.9, 1.1); + voltage[map[MINUS_Z]] = (Zv <= -1) ? ((-1.0f) * Zv) : rnd_float(0.9, 1.1); // printf("temp: %f Time: %f Eclipse: %d : %f %f | %f %f | %f %f\n",tempS, time, eclipse, voltage[map[PLUS_X]], voltage[map[MINUS_X]], voltage[map[PLUS_Y]], voltage[map[MINUS_Y]], current[map[PLUS_Z]], current[map[MINUS_Z]]); - tempS += (eclipse > 0) ? ((temp_max - tempS) / 50.0) : ((temp_min - tempS) / 50.0); + tempS += (eclipse > 0) ? ((temp_max - tempS) / 50.0) : ((temp_min - tempS) / 50.0f); cpuTemp = tempS + rnd_float(-1.0, 1.0); voltage[map[BUS]] = rnd_float(5.0, 5.005); @@ -760,7 +760,7 @@ void get_tlm(void) { // float charging = current[map[PLUS_X]] + current[map[MINUS_X]] + current[map[PLUS_Y]] + current[map[MINUS_Y]] + current[map[PLUS_Z]] + current[map[MINUS_Z]]; float charging = eclipse * (fabs(amps_max[0] * 0.707) + fabs(amps_max[1] * 0.707) + rnd_float(-4.0, 4.0)); - current[map[BAT]] = ((current[map[BUS]] * voltage[map[BUS]]) / (batt * 1.0)) - charging; + current[map[BAT]] = ((current[map[BUS]] * voltage[map[BUS]]) / batt) - charging; // printf("charging: %f bat curr: %f bus curr: %f bat volt: %f bus volt: %f \n",charging, current[map[BAT]], current[map[BUS]], batt, voltage[map[BUS]]); @@ -1088,7 +1088,7 @@ void get_tlm_fox() { if (token != NULL) { current[count1] = (float) atof(token); if ((current[count1] < 0) && (current[count1] > -0.5)) - current[count1] *= (-1.0); + current[count1] *= (-1.0f); #ifdef DEBUG_LOGGING // printf("current: %f\n", current[count1]); #endif @@ -1116,7 +1116,7 @@ void get_tlm_fox() { printf("CPU Temp Read: %6.1f\n", cpuTemp); #endif - other[IHU_TEMP] = cpuTemp; + other[IHU_TEMP] = (double)cpuTemp; // IHUcpuTemp = (int)((cpuTemp * 10.0) + 0.5); } @@ -1203,33 +1203,33 @@ void get_tlm_fox() { double Yi = eclipse * amps_max[1] * sin((2.0 * 3.14 * time / (46.0 * speed)) + (3.14/2.0)) * fabs(sin((2.0 * 3.14 * time / (46.0 * speed)) + (3.14/2.0))) + rnd_float(-2, 2); double Zi = eclipse * amps_max[2] * sin((2.0 * 3.14 * time / (46.0 * speed)) + 3.14 + angle[2]) * fabs(sin((2.0 * 3.14 * time / (46.0 * speed)) + 3.14 + angle[2])) + rnd_float(-2, 2); */ - double Xi = eclipse * amps_max[0] * sin(2.0 * 3.14 * time / (46.0 * speed)) + rnd_float(-2, 2); - double Yi = eclipse * amps_max[1] * sin((2.0 * 3.14 * time / (46.0 * speed)) + (3.14 / 2.0)) + rnd_float(-2, 2); - double Zi = eclipse * amps_max[2] * sin((2.0 * 3.14 * time / (46.0 * speed)) + 3.14 + angle[2]) + rnd_float(-2, 2); + double Xi = eclipse * amps_max[0] * (float) sin(2.0 * 3.14 * time / (46.0 * speed)) + rnd_float(-2, 2); + double Yi = eclipse * amps_max[1] * (float) sin((2.0 * 3.14 * time / (46.0 * speed)) + (3.14 / 2.0)) + rnd_float(-2, 2); + double Zi = eclipse * amps_max[2] * (float) sin((2.0 * 3.14 * time / (46.0 * speed)) + 3.14 + angle[2]) + rnd_float(-2, 2); - double Xv = eclipse * volts_max[0] * sin(2.0 * 3.14 * time / (46.0 * speed)) + rnd_float(-0.2, 0.2); - double Yv = eclipse * volts_max[1] * sin((2.0 * 3.14 * time / (46.0 * speed)) + (3.14 / 2.0)) + rnd_float(-0.2, 0.2); - double Zv = 2.0 * eclipse * volts_max[2] * sin((2.0 * 3.14 * time / (46.0 * speed)) + 3.14 + angle[2]) + rnd_float(-0.2, 0.2); + double Xv = eclipse * volts_max[0] * (float) sin(2.0 * 3.14 * time / (46.0 * speed)) + rnd_float(-0.2, 0.2); + double Yv = eclipse * volts_max[1] * (float) sin((2.0 * 3.14 * time / (46.0 * speed)) + (3.14 / 2.0)) + rnd_float(-0.2, 0.2); + double Zv = 2.0 * eclipse * volts_max[2] * (float) sin((2.0 * 3.14 * time / (46.0 * speed)) + 3.14 + angle[2]) + rnd_float(-0.2, 0.2); // printf("Yi: %f Zi: %f %f %f Zv: %f \n", Yi, Zi, amps_max[2], angle[2], Zv); current[map[PLUS_X]] = (Xi >= 0) ? Xi : 0; - current[map[MINUS_X]] = (Xi >= 0) ? 0 : ((-1.0) * Xi); + current[map[MINUS_X]] = (Xi >= 0) ? 0 : ((-1.0f) * Xi); current[map[PLUS_Y]] = (Yi >= 0) ? Yi : 0; - current[map[MINUS_Y]] = (Yi >= 0) ? 0 : ((-1.0) * Yi); + current[map[MINUS_Y]] = (Yi >= 0) ? 0 : ((-1.0f) * Yi); current[map[PLUS_Z]] = (Zi >= 0) ? Zi : 0; - current[map[MINUS_Z]] = (Zi >= 0) ? 0 : ((-1.0) * Zi); + current[map[MINUS_Z]] = (Zi >= 0) ? 0 : ((-1.0f) * Zi); voltage[map[PLUS_X]] = (Xv >= 1) ? Xv : rnd_float(0.9, 1.1); - voltage[map[MINUS_X]] = (Xv <= -1) ? ((-1.0) * Xv) : rnd_float(0.9, 1.1); + voltage[map[MINUS_X]] = (Xv <= -1) ? ((-1.0f) * Xv) : rnd_float(0.9, 1.1); voltage[map[PLUS_Y]] = (Yv >= 1) ? Yv : rnd_float(0.9, 1.1); - voltage[map[MINUS_Y]] = (Yv <= -1) ? ((-1.0) * Yv) : rnd_float(0.9, 1.1); + voltage[map[MINUS_Y]] = (Yv <= -1) ? ((-1.0f) * Yv) : rnd_float(0.9, 1.1); voltage[map[PLUS_Z]] = (Zv >= 1) ? Zv : rnd_float(0.9, 1.1); - voltage[map[MINUS_Z]] = (Zv <= -1) ? ((-1.0) * Zv) : rnd_float(0.9, 1.1); + voltage[map[MINUS_Z]] = (Zv <= -1) ? ((-1.0f) * Zv) : rnd_float(0.9, 1.1); // printf("temp: %f Time: %f Eclipse: %d : %f %f | %f %f | %f %f\n",tempS, time, eclipse, voltage[map[PLUS_X]], voltage[map[MINUS_X]], voltage[map[PLUS_Y]], voltage[map[MINUS_Y]], current[map[PLUS_Z]], current[map[MINUS_Z]]); - tempS += (eclipse > 0) ? ((temp_max - tempS) / 50.0) : ((temp_min - tempS) / 50.0); + tempS += (eclipse > 0) ? ((temp_max - tempS) / 50.0f) : ((temp_min - tempS) / 50.0f); tempS += +rnd_float(-1.0, 1.0); // IHUcpuTemp = (int)((tempS + rnd_float(-1.0, 1.0)) * 10 + 0.5); other[IHU_TEMP] = tempS; @@ -1240,7 +1240,7 @@ void get_tlm_fox() { // float charging = current[map[PLUS_X]] + current[map[MINUS_X]] + current[map[PLUS_Y]] + current[map[MINUS_Y]] + current[map[PLUS_Z]] + current[map[MINUS_Z]]; float charging = eclipse * (fabs(amps_max[0] * 0.707) + fabs(amps_max[1] * 0.707) + rnd_float(-4.0, 4.0)); - current[map[BAT]] = ((current[map[BUS]] * voltage[map[BUS]]) / (batt * 1.0)) - charging; + current[map[BAT]] = ((current[map[BUS]] * voltage[map[BUS]]) / batt) - charging; // printf("charging: %f bat curr: %f bus curr: %f bat volt: %f bus volt: %f \n",charging, current[map[BAT]], current[map[BUS]], batt, voltage[map[BUS]]); @@ -1429,7 +1429,7 @@ void get_tlm_fox() { encodeA(b, 30 + head_offset, PSUVoltage); // encodeB(b, 31 + head_offset,(spin * 10) + 2048); - encodeB(b, 31 + head_offset, (other[SPIN] * 10) + 2048); + encodeB(b, 31 + head_offset, ((int)(other[SPIN] * 10)) + 2048); // encodeA(b, 33 + head_offset,(int)(BME280pressure + 0.5)); // Pressure // encodeB(b, 34 + head_offset,(int)(BME280altitude + 0.5)); // Altitude From bf8da5412c7e1a43b7838575470cfd7b741570ce Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 23 Dec 2020 11:51:17 -0500 Subject: [PATCH 15/17] removed Wall Wconversion --- Makefile | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/Makefile b/Makefile index d5742a62..0f95bb8d 100644 --- a/Makefile +++ b/Makefile @@ -204,13 +204,13 @@ chat/chat_main.o: ax5043/axradio/axradiorx_p.h chat/chat_main.o: ax5043/axradio/axradiotx.h chat/chat_main.o: ax5043/axradio/axradiotx_p.h chat/chat_main.o: ax5043/generated/configtx.h - cd chat; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I../ax5043 -Wconversion -Wall -Wextra -c chat_main.c; cd .. + cd chat; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I../ax5043 -c chat_main.c; cd .. afsk/ax25.o: afsk/ax25.c afsk/ax25.o: afsk/ax25.h afsk/ax25.o: afsk/ax5043.h afsk/ax25.o: afsk/status.h - cd afsk; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -Wconversion -Wall -Wextra -c ax25.c; cd .. + cd afsk; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -c ax25.c; cd .. afsk/ax5043.o: afsk/ax5043.c afsk/ax5043.o: afsk/ax25.h @@ -219,17 +219,17 @@ afsk/ax5043.o: afsk/status.h afsk/ax5043.o: afsk/utils.h afsk/ax5043.o: afsk/main.c afsk/ax5043.o: ax5043/spi/ax5043spi.h - cd afsk; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -Wconversion -Wall -Wextra -c ax5043.c; cd .. + cd afsk; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -c ax5043.c; cd .. afsk/main.o: afsk/main.c afsk/main.o: afsk/status.h afsk/main.o: afsk/ax5043.h afsk/main.o: afsk/ax25.h afsk/main.o: ax5043/spi/ax5043spi.h - cd afsk; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -Wconversion -Wall -Wextra -c main.c; cd .. + cd afsk; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -c main.c; cd .. afsk/telem.o: afsk/telem.c - cd afsk; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -Wconversion -Wall -Wextra -c telem.c; cd .. + cd afsk; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -c telem.c; cd .. cw/cw_main.o: cw/cw_main.c cw/cw_main.o: ax5043/spi/ax5043spi.h @@ -243,7 +243,7 @@ cw/cw_main.o: ax5043/axradio/axradiorx_p.h cw/cw_main.o: ax5043/axradio/axradiotx.h cw/cw_main.o: ax5043/axradio/axradiotx_p.h cw/cw_main.o: ax5043/generated/configtx.h - cd cw; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I../ax5043 -Wconversion -Wall -Wextra -c cw_main.c; cd .. + cd cw; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I../ax5043 -c cw_main.c; cd .. piglatin/piglatin_main.o: piglatin/piglatin_main.c piglatin/piglatin_main.o: ax5043/spi/ax5043spi.h @@ -257,7 +257,7 @@ piglatin/piglatin_main.o: ax5043/axradio/axradiorx_p.h piglatin/piglatin_main.o: ax5043/axradio/axradiotx.h piglatin/piglatin_main.o: ax5043/axradio/axradiotx_p.h piglatin/piglatin_main.o: ax5043/generated/configtx.h - cd piglatin; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -Wconversion -Wall -Wextra -c piglatin_main.c; cd .. + cd piglatin; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -c piglatin_main.c; cd .. receive/receive_main.o: receive/receive_main.c receive/receive_main.o: ax5043/axradio/axradioinit.h @@ -269,7 +269,7 @@ receive/receive_main.o: ax5043/axradio/axradiomode_p.h receive/receive_main.o: ax5043/axradio/axradiorx.h receive/receive_main.o: ax5043/axradio/axradiorx_p.h receive/receive_main.o: ax5043/generated/configrx.h - cd receive; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -Wconversion -Wall -Wextra -c receive_main.c; cd .. + cd receive; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -c receive_main.c; cd .. transmit/transmit_main.o: transmit/transmit_main.c transmit/transmit_main.o: ax5043/axradio/axradioinit.h @@ -281,7 +281,7 @@ transmit/transmit_main.o: ax5043/axradio/axradiomode_p.h transmit/transmit_main.o: ax5043/axradio/axradiotx.h transmit/transmit_main.o: ax5043/axradio/axradiotx_p.h transmit/transmit_main.o: ax5043/generated/configtx.h - cd transmit; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -Wconversion -Wall -Wextra -c transmit_main.c; cd .. + cd transmit; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -c transmit_main.c; cd .. transmit2freq/transmit2freq_main.o: transmit2freq/transmit2freq_main.c transmit2freq/transmit2freq_main.o: ax5043/axradio/axradioinit.h @@ -293,20 +293,20 @@ transmit2freq/transmit2freq_main.o: ax5043/axradio/axradiomode_p.h transmit2freq/transmit2freq_main.o: ax5043/axradio/axradiotx.h transmit2freq/transmit2freq_main.o: ax5043/axradio/axradiotx_p.h transmit2freq/transmit2freq_main.o: ax5043/generated/configtx.h - cd transmit2freq; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -Wconversion -Wall -Wextra -c transmit2freq_main.c; cd .. + cd transmit2freq; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -c transmit2freq_main.c; cd .. init/init_main.o: init/init_main.c init/init_main.o: ax5043/axradio/axradioinit.h init/init_main.o: ax5043/axradio/axradioinit_p.h init/init_main.o: ax5043/spi/ax5043spi.h init/init_main.o: ax5043/spi/ax5043spi_p.h - cd init; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -Wconversion -Wall -Wextra -c init_main.c; cd .. + cd init; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -c init_main.c; cd .. afsktx/ax25.o: afsktx/ax25.c afsktx/ax25.o: afsktx/ax25.h afsktx/ax25.o: afsktx/ax5043.h afsktx/ax25.o: afsktx/status.h - cd afsktx; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -Wconversion -Wall -Wextra -c ax25.c; cd .. + cd afsktx; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -c ax25.c; cd .. afsktx/ax5043.o: afsktx/ax5043.c afsktx/ax5043.o: afsktx/ax25.h @@ -314,11 +314,11 @@ afsktx/ax5043.o: afsktx/ax5043.h afsktx/ax5043.o: afsktx/status.h afsktx/ax5043.o: afsktx/utils.h afsktx/ax5043.o: ax5043/spi/ax5043spi.h - cd afsktx; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -Wconversion -Wall -Wextra -c ax5043.c; cd .. + cd afsktx; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -c ax5043.c; cd .. afsktx/main.o: afsktx/main.c afsktx/main.o: afsktx/status.h afsktx/main.o: afsktx/ax5043.h afsktx/main.o: afsktx/ax25.h afsktx/main.o: ax5043/spi/ax5043spi.h - cd afsktx; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -Wconversion -Wall -Wextra -c main.c; cd .. + cd afsktx; gcc -std=gnu99 $(DEBUG_BEHAVIOR) -I ../ax5043 -c main.c; cd .. From 1df9a3036779edd6b67eec3875d61342892d5e57 Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 23 Dec 2020 11:52:50 -0500 Subject: [PATCH 16/17] Update main.c --- afsk/main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/afsk/main.c b/afsk/main.c index 7bfa7a43..147ec945 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -1887,9 +1887,9 @@ void write_wave(int i, short int *buffer) else { if ((ctr - flip_ctr) < smaller) - buffer[ctr++] = (int)(amplitude * 0.4 * phase * sin((float)(2*M_PI*i*freq_Hz/S_RATE))); + buffer[ctr++] = (short int)(amplitude * 0.4 * phase * sin((float)(2*M_PI*i*freq_Hz/S_RATE))); else - buffer[ctr++] = (int)(amplitude * phase * sin((float)(2*M_PI*i*freq_Hz/S_RATE))); + buffer[ctr++] = (short int)(amplitude * phase * sin((float)(2*M_PI*i*freq_Hz/S_RATE))); } // printf("%d %d \n", i, buffer[ctr - 1]); From bead52d20acce1120cf8e8cfc44d79ba33909cbb Mon Sep 17 00:00:00 2001 From: alanbjohnston Date: Wed, 23 Dec 2020 12:03:40 -0500 Subject: [PATCH 17/17] strstr warning --- afsk/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/afsk/main.c b/afsk/main.c index 147ec945..f4619065 100644 --- a/afsk/main.c +++ b/afsk/main.c @@ -402,7 +402,7 @@ int main(int argc, char * argv[]) { fgets(cmdbuffer1, 1000, file4); char camera_present[] = "supported=1 detected=1"; // printf("strstr: %s \n", strstr( & cmdbuffer1, camera_present)); - camera = (strstr( & cmdbuffer1, camera_present) != NULL) ? ON : OFF; + camera = (strstr( (const char *)& cmdbuffer1, camera_present) != NULL) ? ON : OFF; // printf("Camera result:%s camera: %d \n", & cmdbuffer1, camera); pclose(file4);