diff --git a/org.fortiss.af3.platform.raspberry/trunk/lib/Makedefs b/org.fortiss.af3.platform.raspberry/trunk/lib/Makedefs index 3d4f565c469ee73008123dcce56c8bc72622110e..30b33f53e6879dfb3c901b93552a261b7bd41bb1 100644 --- a/org.fortiss.af3.platform.raspberry/trunk/lib/Makedefs +++ b/org.fortiss.af3.platform.raspberry/trunk/lib/Makedefs @@ -19,8 +19,8 @@ ifndef CROSSLD endif # The flags which are passed to the compiler and the linker. -CCFLAGS+=-std=gnu99 -Wall -pthread -pedantic -c ${patsubst %,-I%,${subst :, ,${IPATH}}} -LDFLAGS+=-std=gnu99 -Wall -pthread -lpthread -pedantic +CCFLAGS+=-std=gnu99 -Wall -pthread -lwiringPi -pedantic -c ${patsubst %,-I%,${subst :, ,${IPATH}}} +LDFLAGS+=-std=gnu99 -Wall -pthread -lpthread -lwiringPi -pedantic # The default rules, i.e. the entry point. all: ${BPATH} diff --git a/org.fortiss.af3.platform.raspberry/trunk/lib/inc/GPIO.h b/org.fortiss.af3.platform.raspberry/trunk/lib/inc/GPIO.h index c2d81c8e51dbc82f7b13fe24ede124ea810df1fd..b725758a005747a1bf4f55705a51edf34f1ac46e 100644 --- a/org.fortiss.af3.platform.raspberry/trunk/lib/inc/GPIO.h +++ b/org.fortiss.af3.platform.raspberry/trunk/lib/inc/GPIO.h @@ -1,6 +1,7 @@ #ifndef __GPIO_H #define __GPIO_H +#include <stdio.h> #include <wiringPi.h> #include "inc-gen/data_dictionary.h" diff --git a/org.fortiss.af3.platform.raspberry/trunk/lib/src/GPIO.c b/org.fortiss.af3.platform.raspberry/trunk/lib/src/GPIO.c index a04192d7ccea68cecfbf6aa4d0b7b4702189e910..355932588b7fa1ae52cbd22965478b961988b4ea 100644 --- a/org.fortiss.af3.platform.raspberry/trunk/lib/src/GPIO.c +++ b/org.fortiss.af3.platform.raspberry/trunk/lib/src/GPIO.c @@ -18,13 +18,13 @@ void gpio_init(GPIO_PIN_T pin) { void gpio_init_in(GPIO_PIN_T pin) { gpio_init(pin); - + pinMode(pin, INPUT); } void gpio_init_out(GPIO_PIN_T pin) { gpio_init(pin); - + pinMode(pin, OUTPUT); } diff --git a/org.fortiss.af3.platform.raspberry/trunk/lib/src/LaserRangeFinder.c b/org.fortiss.af3.platform.raspberry/trunk/lib/src/LaserRangeFinder.c index 89bd8fb636edc159a813f2cccae10c7cf3cfba0b..ec34b3b0c9598db3b7847c67a46226a077a666f8 100644 --- a/org.fortiss.af3.platform.raspberry/trunk/lib/src/LaserRangeFinder.c +++ b/org.fortiss.af3.platform.raspberry/trunk/lib/src/LaserRangeFinder.c @@ -7,7 +7,7 @@ void lrf_init() { char port[100]; //FILE* fp = popen("dmesg | grep -A 3 \"Arduino Uno\" | grep -o \"ttyACM.\" | tail -n 1","r"); - FILE* fp = popen("ls -d /dev/serial/by-id/* | grep \"Arduino\" | tr -d \"\n"\"", "r"); + FILE* fp = popen("ls -d /dev/serial/by-id/* | grep \"Arduino\" | tr -d \"\n\"", "r"); //fgets(port+5, sizeof(port)-6, fp); fgets(port, sizeof(port), fp); printf("lrf port=%s\n", port); diff --git a/org.fortiss.af3.platform.raspberry/trunk/lib/src/PWM.c b/org.fortiss.af3.platform.raspberry/trunk/lib/src/PWM.c index 12e5e112ccef5ef9159d68de29d2852b8af45069..d50d6985252aeb07bfbafdba0ad67b5c811ab127 100644 --- a/org.fortiss.af3.platform.raspberry/trunk/lib/src/PWM.c +++ b/org.fortiss.af3.platform.raspberry/trunk/lib/src/PWM.c @@ -55,6 +55,10 @@ void pwm_init(PWM_CHANNEL_T channel) { pwm_channel_values = calloc(sizeof(GEN_TYPE_int), PWM_MAX_NO_CHANNELS); pwm_channel_enabled = calloc(sizeof(GEN_TYPE_boolean), PWM_MAX_NO_CHANNELS); + // start a pwm thread + //pthread_t pt_pwm; + //pthread_create(&pt_pwm, NULL, pwm_worker, NULL); + pwm_initialized = true; } diff --git a/org.fortiss.af3.platform.raspberry/trunk/lib/src/main.c b/org.fortiss.af3.platform.raspberry/trunk/lib/src/main.c index 1f21b16ceafc5784d74030f0997c39f48f8a8119..f39feb8986786440fb76b996c8ae3071bcd72555 100644 --- a/org.fortiss.af3.platform.raspberry/trunk/lib/src/main.c +++ b/org.fortiss.af3.platform.raspberry/trunk/lib/src/main.c @@ -18,7 +18,7 @@ int main(int argc, char* argv[]) { pthread_t pt_gamepad; pthread_create(&pt_gamepad, NULL, gp_worker, NULL); - // start a rover thread + // start a pwm thread pthread_t pt_pwm; pthread_create(&pt_pwm, NULL, pwm_worker, NULL);