From 87f8437b87872deb1fa5c75183f076556dfaf157 Mon Sep 17 00:00:00 2001 From: Gerolf Ziegenhain Date: Sat, 3 Jan 2015 22:58:48 +0100 Subject: [PATCH] modified for wheezy - without sound.c --- Makefile | 6 +++--- irmc.c | 26 ++++---------------------- 2 files changed, 7 insertions(+), 25 deletions(-) diff --git a/Makefile b/Makefile index e717214..0b7e124 100644 --- a/Makefile +++ b/Makefile @@ -1,7 +1,7 @@ -SRC = irmc.c sound.c +SRC = irmc.c OBJ = ${SRC:.c=.o} -LDFLAGS = -lm -lossaudio -CFLAGS = -Wall +LDFLAGS = -L/usr/local/lib -lm -lmorse +CFLAGS = -I/usr/local/include -Wall INSTALLDIR = ${HOME}/bin all: options irmc diff --git a/irmc.c b/irmc.c index 2888809..1c8c3dd 100644 --- a/irmc.c +++ b/irmc.c @@ -11,13 +11,14 @@ #include #include #include -#ifdef __MACH__ #include +#ifdef __MACH__ #define LIBOSS_INTERNAL #include //will not be used for audio any more #else -#include -#include "sound.h" +#include +#include +#include #endif #include #include @@ -252,15 +253,10 @@ commandmode(void) if((strncmp(cmd, "aon", 3)) == 0){ audio_status = 1; -#ifdef __MACH__ -#else - fd_speaker = open_audio_device(soundcard, O_WRONLY); -#endif return 0; } if((strncmp(cmd, "aoff", 3)) == 0){ audio_status = 0; - close(fd_speaker); return 0; } printf("?\n"); @@ -387,11 +383,7 @@ int main(int argc, char *argv[]) inet_ntop(p->ai_family, get_in_addr((struct sockaddr *)p->ai_addr), s, sizeof s); printf("irmc: connected to %s\n", s); -#ifdef __MACH__ beep_init(); -#else - fd_speaker = open_audio_device(soundcard, O_WRONLY); -#endif fd_serial = open(serialport, O_RDWR | O_NOCTTY | O_NDELAY); if(fd_serial == -1) { printf("irmc: unable to open serial port.\n"); @@ -399,9 +391,6 @@ int main(int argc, char *argv[]) freeaddrinfo(servinfo); /* all done with this structure */ key_release_t1 = fastclock(); -#ifndef __MACH__ - init_sound(); // TODO rename to init sinus! -#endif identifyclient(); /* Main Loop */ @@ -438,7 +427,6 @@ int main(int argc, char *argv[]) default: if(audio_status == 1) { -#ifdef __MACH__ int length = rx_data_packet.code[i]; if(length == 0 || abs(length) > 2000) { @@ -453,9 +441,6 @@ else beep(1000.0, length/1000.); } } -#else - play_code_element (rx_data_packet.code[i]); -#endif } break; } @@ -500,9 +485,6 @@ beep(1000.0, length/1000.); send(fd_socket, &disconnect_packet, sizeof(disconnect_packet), 0); close(fd_socket); - close(fd_speaker); -#ifdef __MACH__ -#endif close(fd_serial); exit(0);