Segmentation fault with afsk/ax5043.o problem

pull/1/head
Alan Johnston 7 years ago
parent a4f91cfc2c
commit 62917ccd84

@ -51,7 +51,7 @@ radiocw: cw/cw_main.o
radiocw: afsk/ax25.o
radiocw: afsk/ax5043.o
radiocw: afsk/send_afsk.o
gcc -o radiocw -pthread -L./ afsk/ax25.o afsk/ax5043.o afsk/send_afsk.o cw/cw_main.o -lwiringPi -lax5043
gcc -o radiocw -L./ afsk/ax5043.o cw/cw_main.o -lwiringPi -lax5043
radiopiglatin: libax5043.a
radiopiglatin: piglatin/piglatin_main.o
@ -228,9 +228,9 @@ afsk/main.o: ax5043/spi/ax5043spi.h
afsk/send_afsk.o: afsk/send_afsk.c
afsk/send_afsk.o: afsk/send_afsk.h
afsktx/send_afsk.o: afsktx/status.h
afsktx/send_afsk.o: afsktx/ax5043.h
afsktx/send_afsk.o: afsktx/ax25.h
afsk/send_afsk.o: afsktx/status.h
afsk/send_afsk.o: afsktx/ax5043.h
afsk/send_afsk.o: afsktx/ax25.h
cd afsk; gcc -I ../ax5043 -pedantic -Wconversion -Wall -Wextra -c send_afsk.c; cd ..
cw/cw_main.o: cw/cw_main.c

@ -34,6 +34,7 @@ void config_x25();
void trans_x25();
int send_afsk(void) {
return 0;
setSpiChannel(SPI_CHANNEL);
setSpiSpeed(SPI_SPEED);
initializeSpi();
@ -46,7 +47,7 @@ int send_afsk(void) {
const char *str = "\x03\x0fhi hi 101 102 103 104 202 203 204 205 303 304 305 306 404 405 406 407 408 505 506 507 508 606 607 608 609\n";
/* Infinite loop */
for (;;) {
// for (;;) {
sleep(2);
// send X.25 packet
@ -76,7 +77,8 @@ int send_afsk(void) {
exit(EXIT_FAILURE);
}
}
// }
sleep(20);
return 0;
}

@ -0,0 +1 @@
int send_afsk();

@ -20,8 +20,8 @@
#include <axradio/axradiorx_p.h>
#include <axradio/axradiotx_p.h>
#include <generated/configtx.h>
#include <pthread.h>
#include <semaphore.h>
//#include <pthread.h>
//#include <semaphore.h>
#include <spi/ax5043spi_p.h>
#include <stdint.h>
#include <stdio.h>
@ -30,7 +30,7 @@
#include <unistd.h>
#include <errno.h>
#include <wiringPiI2C.h>
#include <../afsk/send_afsk.h>
//#include <../afsk/send_afsk.h>
#define MAX_MESSAGE_LENGTH (197)
@ -59,15 +59,18 @@ int main(void)
{
uint8_t retVal;
send_afsk();
// int res = send_afsk();
// printf("Result: %d \n",res);
// Configure SPI bus to AX5043
setSpiChannel(SPI_CHANNEL);
setSpiSpeed(SPI_SPEED);
initializeSpi();
printf("1\n");
// Initialize the AX5043
retVal = axradio_init();
printf("2\n");
if (retVal == AXRADIO_ERR_NOCHIP) {
fprintf(stderr, "ERROR: No AX5043 RF chip found\n");
exit(EXIT_FAILURE);

Loading…
Cancel
Save

Powered by TurnKey Linux.