From 553c550ac791feda7cfbf599be6d9dd84aafc2ff Mon Sep 17 00:00:00 2001 From: Geoffrey Frogeye Date: Mon, 30 Apr 2018 16:15:47 +0200 Subject: [PATCH] IHM --- Connexions.md | 6 + chef/lcdOff.sh | 2 + chef/run.sh | 3 + chef/src/ihm.c | 301 ++++++++++++++++++ chef/src/ihm.h | 27 ++ chef/src/lcd.c | 17 +- chef/src/lcd.h | 4 + chef/src/local.c | 48 +-- chef/src/movement.c | 10 +- chef/src/movement.h | 14 +- chef/src/parcours.c | 137 ++++++++ chef/src/parcours.h | 15 + chef/src/points.c | 31 ++ chef/src/points.h | 10 + chef/src/premier.c | 99 ++---- .../rootfs_overlay/etc/init.d/S30hardware | 1 + raspberrypi/package/robotech/chef/chef.mk | 2 +- 17 files changed, 618 insertions(+), 109 deletions(-) create mode 100755 chef/lcdOff.sh create mode 100644 chef/src/ihm.c create mode 100644 chef/src/ihm.h create mode 100644 chef/src/parcours.c create mode 100644 chef/src/parcours.h create mode 100644 chef/src/points.c create mode 100644 chef/src/points.h diff --git a/Connexions.md b/Connexions.md index 2f44dbb..d89fa67 100644 --- a/Connexions.md +++ b/Connexions.md @@ -13,3 +13,9 @@ Ce document a pour but de recenser les connexions entre les différents composan ## Connexions de puissance ## Connexions d'information + +- BCM 2 (SDA), BCM 3 (SCL) : liaison I2C (LCD, IMU, SRF08) +- BCM 14 (TXD), BCM 15 (RXD) : liaison série (PC debug) +- BCM 12 (PWM0), BCM 13 (PWM1) : contrôleur moteur +- BCM 17, BCM 27 : bouton rouge, bouton jaune +- BCM 22 : tirette diff --git a/chef/lcdOff.sh b/chef/lcdOff.sh new file mode 100755 index 0000000..dbaa270 --- /dev/null +++ b/chef/lcdOff.sh @@ -0,0 +1,2 @@ +#!/bin/sh +/usr/sbin/i2cset -y 1 0x27 0x00 diff --git a/chef/run.sh b/chef/run.sh index ea9dcbd..cd06716 100644 --- a/chef/run.sh +++ b/chef/run.sh @@ -1,5 +1,6 @@ #!/bin/sh +cd "$( dirname "${BASH_SOURCE[0]}" )" EXEC=bin/premier LOGFILE="${2:=run.log}" @@ -7,3 +8,5 @@ LOGFILE="${2:=run.log}" "$EXEC" 2>&1 | while read line; do echo "$(cat /proc/uptime | cut -d ' ' -f 1) $line" >> "$LOGFILE" done + +sh lcdOff.sh diff --git a/chef/src/ihm.c b/chef/src/ihm.c new file mode 100644 index 0000000..0a3b069 --- /dev/null +++ b/chef/src/ihm.c @@ -0,0 +1,301 @@ +#include +#include +#include +#include +#include +#include + +#include "ihm.h" +#include "movement.h" +#include "parcours.h" +#include "points.h" + +// Globales +pthread_t tIHM; + +// Fonctions +void configureIHM() +{ + initLCD(); + gotoLCD(LCD_LINE_1); + printLCD("Demarrage..."); +} + +void startIHM() +{ + pinMode(IHM_PIN_ROUGE, INPUT); + pullUpDnControl(IHM_PIN_ROUGE, PUD_UP); + pinMode(IHM_PIN_JAUNE, INPUT); + pullUpDnControl(IHM_PIN_JAUNE, PUD_UP); + pinMode(IHM_PIN_TIRETTE, INPUT); + pullUpDnControl(IHM_PIN_TIRETTE, PUD_UP); + + pthread_create(&tIHM, NULL, TaskIHM, NULL); + pthread_join(tIHM, NULL); +} + +// t1 - t2 +void diffTimespec(const struct timespec* t1, const struct timespec* t2, struct timespec* td) +{ + if ((t1->tv_nsec - t2->tv_nsec) < 0) { + td->tv_sec = t1->tv_sec - t2->tv_sec - 1; + td->tv_nsec = t1->tv_nsec - t2->tv_nsec + 1000000000UL; + } else { + td->tv_sec = t1->tv_sec - t2->tv_sec; + td->tv_nsec = t1->tv_nsec - t2->tv_nsec; + } +} + +bool debunkButtonIHM(int pin) +{ + int t; + // Press (cancel if wrong) + for (t = IHM_DEBUNK_TIME / 2; t > 0; t--) { + if (digitalRead(pin) != LOW) { + return false; + } + delay(1); + } + // Release (re-wait if wrong) + for (t = IHM_DEBUNK_TIME / 2; t > 0; t--) { + if (digitalRead(pin) != HIGH) { + t = IHM_DEBUNK_TIME / 2; + } + delay(1); + } + return true; +} + +enum boutons pressedIHM(int timeout) +{ + bool block = timeout < 0; + while (timeout > 0 || block) { + + if (debunkButtonIHM(IHM_PIN_JAUNE)) { + return jaune; + } + + if (debunkButtonIHM(IHM_PIN_ROUGE)) { + return rouge; + } + + delay(IHM_POLLING_INTERVAL); + timeout -= IHM_POLLING_INTERVAL; + } + return none; +} + +bool tirettePresente() +{ + int etat, newEtat; + int t; + for (t = 0; t < IHM_DEBUNK_TIME; t++) { + newEtat = digitalRead(IHM_PIN_TIRETTE); + if (etat != newEtat) { + t = 0; + etat = newEtat; + } + delay(1); + } + return etat == LOW; +} + +char tempLine[16]; +bool isDebug = false; +bool isOrange = true; +bool annuler = false; +clock_t lastCalibrage = 0; +clock_t parcoursStart = 0; +pthread_t tParcours; + +void printCouleur() +{ + if (isOrange) { + printLCD("Orange"); + } else { + printLCD("Vert"); + } +} + +void* TaskIHM(void* pdata) +{ + (void)pdata; + + gotoLCD(LCD_LINE_1 + 1); + printLCD("Niuh"); + + enum boutons bout; + for (;;) { + + // Debug + for (;;) { + clearLCD(); + gotoLCD(LCD_LINE_1); + printLCD("Debug : "); + if (isDebug) { + printLCD("On"); + gotoLCD(LCD_LINE_2); + printLCD("192.168.0.0 TODO"); + } else { + printLCD("Off"); + } + bout = pressedIHM(IHM_REFRESH_INTERVAL); + + if (bout == rouge) { + isDebug = !isDebug; + } else if (bout == jaune) { + break; + } + } + + // Couleur + for (;;) { + clearLCD(); + gotoLCD(LCD_LINE_1); + printLCD("Couleur : "); + printCouleur(); + bout = pressedIHM(IHM_BLOCK); + + if (bout == rouge) { + isOrange = !isOrange; + } else if (bout == jaune) { + break; + } + } + + // Calibrage + for (;;) { + clearLCD(); + gotoLCD(LCD_LINE_1); + if (lastCalibrage != 0) { + printLCD("Calibre il y a"); + gotoLCD(LCD_LINE_2); + sprintf(tempLine, "%ld secondes", (clock() - lastCalibrage) / CLOCKS_PER_SEC); + printLCD(tempLine); + } else { + printLCD("Calibrer"); + gotoLCD(LCD_LINE_2); + printLCD("("); + printCouleur(); + printLCD(")"); + } + bout = pressedIHM(IHM_REFRESH_INTERVAL); + + if (bout == rouge) { + clearLCD(); + gotoLCD(LCD_LINE_1); + printLCD("Calibrage..."); + delay(3000); // TODO + lastCalibrage = clock(); + } else if (bout == jaune) { + break; + } + } + + // Diagnostics + for (;;) { + clearLCD(); + gotoLCD(LCD_LINE_1); + printLCD("Diagnostiquer"); + bout = pressedIHM(IHM_BLOCK); + + if (bout == rouge) { + clearLCD(); + gotoLCD(LCD_LINE_1); + printLCD("Diagnostics..."); + delay(3000); // TODO + } else if (bout == jaune) { + break; + } + } + + // Parcours + for (;;) { + clearLCD(); + gotoLCD(LCD_LINE_1); + printLCD("Lancer parcours"); + gotoLCD(LCD_LINE_2); + printLCD("("); + printCouleur(); + printLCD(")"); + bout = pressedIHM(IHM_BLOCK); + if (bout == rouge) { + // No tirette + annuler = false; + while (!tirettePresente()) { + clearLCD(); + gotoLCD(LCD_LINE_1); + printLCD("Inserez tirette"); + gotoLCD(LCD_LINE_2); + printLCD("(ROUGE: ignorer)"); + bout = pressedIHM(IHM_REFRESH_INTERVAL); + if (bout == rouge) { + break; + } else if (bout == jaune) { + annuler = true; + break; + } + } + + if (annuler) { + continue; + } + + // Go! + + prepareParcours(isOrange); + while (tirettePresente()) { + bout = pressedIHM(IHM_POLLING_INTERVAL); + if (bout == jaune) { + annuler = true; + break; + } + } + + if (annuler) { + continue; + } + + startParcours(); // TODO On a different thread + + int toWait; + while ((toWait = updateParcours()) >= 0) { + if (pressedIHM(toWait) != none) { + break; + } + } + stopParcours(); + + pressedIHM(IHM_BLOCK); // Nécessite 3 appuis pour éviter d'enlever le score par inadvertance + pressedIHM(IHM_BLOCK); + pressedIHM(IHM_BLOCK); + } else if (bout == jaune) { + break; + } + } + + // RàZ + for (;;) { + clearLCD(); + gotoLCD(LCD_LINE_1); + printLCD("Remettre a zero"); + bout = pressedIHM(IHM_BLOCK); + + if (bout == rouge) { + clearLCD(); + gotoLCD(LCD_LINE_1); + printLCD("Remise a zero..."); + delay(3000); // TODO + } else if (bout == jaune) { + break; + } + } + } +} + +void deconfigureIHM() +{ + clearLCD(); + gotoLCD(LCD_LINE_1); + printLCD("Bye bye!"); +} diff --git a/chef/src/ihm.h b/chef/src/ihm.h new file mode 100644 index 0000000..d021f24 --- /dev/null +++ b/chef/src/ihm.h @@ -0,0 +1,27 @@ +#ifndef __IHM_H_ +#define __IHM_H_ + +#include "lcd.h" + +#define IHM_PIN_ROUGE 0 +#define IHM_PIN_JAUNE 2 +#define IHM_PIN_TIRETTE 3 + +// ms +#define IHM_BLOCK -1 +#define IHM_POLLING_INTERVAL 50 +#define IHM_DEBUNK_TIME 50 +#define IHM_REFRESH_INTERVAL 1000 + +enum boutons {none, jaune, rouge}; + +// Public +void configureIHM(); +void startIHM(); +void deconfigureIHM(); + +// Private +void* TaskIHM(void *pdata); +enum boutons pressedIHM(int timeout); // timeout: ms or -1 + +#endif diff --git a/chef/src/lcd.c b/chef/src/lcd.c index a852866..65d5a48 100644 --- a/chef/src/lcd.c +++ b/chef/src/lcd.c @@ -1,9 +1,11 @@ -#include "lcd.h" -#include "i2c.h" +#include #include #include +#include "lcd.h" + int lcdFd; +pthread_mutex_t sLCD; void initLCD() { @@ -43,7 +45,6 @@ void printLCD(char* s) } } - void sendLCD(uint8_t bits, uint8_t mode) { lockI2C(); @@ -66,3 +67,13 @@ void toggleEnableLCD(uint8_t bits) wiringPiI2CReadReg8(lcdFd, (bits & ~LCD_MASK_ENABLE)); delayMicroseconds(50); } + +void lockLCD() +{ + pthread_mutex_lock(&sLCD); +} + +void unlockLCD() +{ + pthread_mutex_unlock(&sLCD); +} diff --git a/chef/src/lcd.h b/chef/src/lcd.h index 27073a8..949d6eb 100644 --- a/chef/src/lcd.h +++ b/chef/src/lcd.h @@ -2,6 +2,7 @@ #define __LCD_H_ #include "stdint.h" +#include "i2c.h" #define LCD_ADDR 0x27 @@ -23,6 +24,9 @@ void clearLCD(); void gotoLCD(uint8_t line); void charLCD(char c); void printLCD(char* s); +// Not necessary, but should be used when different threads use the display +void lockLCD(); +void unlockLCD(); // Private void sendLCD(uint8_t bits, uint8_t mode); diff --git a/chef/src/local.c b/chef/src/local.c index fe4ec74..df9a56c 100644 --- a/chef/src/local.c +++ b/chef/src/local.c @@ -1,36 +1,36 @@ -#include -#include #include +#include +#include +#include #include // sleep -#include "debug.h" +#define TEMPS_PARCOURS 10 -unsigned long int canard = 42; -double banane = 63; -char* artichaut = "Torticoli"; +// t1 - t2 +void diffTimespec(const struct timespec* t1, const struct timespec* t2, struct timespec* td) +{ + if ((t1->tv_nsec - t2->tv_nsec) < 0) { + td->tv_sec = t1->tv_sec - t2->tv_sec - 1; + td->tv_nsec = t1->tv_nsec - t2->tv_nsec + 1000000000UL; + } else { + td->tv_sec = t1->tv_sec - t2->tv_sec; + td->tv_nsec = t1->tv_nsec - t2->tv_nsec; + } +} int main() { + struct timespec start, now, diff; + clock_gettime(CLOCK_REALTIME, &start); - printf("Démarrage...\n"); - srand(time(NULL)); - - configureDebug(); - registerDebugVar("canard", ld, &canard); - registerDebugVar("banane", lf, &banane); - registerDebugVar("artichaut", s, &artichaut); - startDebug(); - - for (int i = 0; i < 2; i++) { - printf("21 %d\n", i); - canard += 3; - banane /= 2; - sleep(1); + for (;;) { + clock_gettime(CLOCK_REALTIME, &now); + diffTimespec(&now, &start, &diff); + if (diff.tv_sec > TEMPS_PARCOURS) { + break; + } + printf("32 %ld %ld\n", diff.tv_sec, diff.tv_nsec); } - deconfigureDebug(); - - return EXIT_SUCCESS; } - diff --git a/chef/src/movement.c b/chef/src/movement.c index a2166f6..e9402c0 100644 --- a/chef/src/movement.c +++ b/chef/src/movement.c @@ -6,10 +6,6 @@ void configureMovement() { - if (wiringPiSetup() == -1) { - fprintf(stderr, "Impossible d'initialiser WiringPi\n"); - exit(EXIT_FAILURE); - } pinMode(ENA, PWM_OUTPUT); pinMode(ENB, PWM_OUTPUT); } @@ -90,3 +86,9 @@ void deconfigureMovement() { } + +int stop() +{ + brake(); + // TODO +} diff --git a/chef/src/movement.h b/chef/src/movement.h index f5fbe63..7e5554d 100644 --- a/chef/src/movement.h +++ b/chef/src/movement.h @@ -8,19 +8,31 @@ #include "position.h" #include - #define PWM_MAX 1023 #define PWM_MAX_V 3.3 + +// #define TESTINATOR +#define TLE5206 + +#ifdef TESTINATOR #define MOT_MIN_V 0.1 #define MOT_MAX_V 2.0 +#endif + +#ifdef TLE5206 +#define MOT_MIN_V 0.1 +#define MOT_MAX_V 2.5 +#endif // Pins definition +// Left // Physical 32 #define ENA 26 #define IN1 2 #define IN2 3 // Physical 33 +// Right #define ENB 23 #define IN3 4 #define IN4 5 diff --git a/chef/src/parcours.c b/chef/src/parcours.c new file mode 100644 index 0000000..049cf54 --- /dev/null +++ b/chef/src/parcours.c @@ -0,0 +1,137 @@ +#include +#include +#include + +#include "parcours.h" +#include "movement.h" +#include "position.h" +#include "points.h" +#include "lcd.h" + +pthread_t tParcours; +bool isOrange; +char tempLine[16]; +struct timespec tempsStart; +struct timespec tempsNow; +struct timespec tempsEcoule; + +void prepareParcours(bool orange) +{ + isOrange = orange; + clearLCD(); + gotoLCD(LCD_LINE_1); + sprintf(tempLine, "--:--/%2d:%02d", TEMPS_PARCOURS / 60, TEMPS_PARCOURS % 60); + printLCD(tempLine); + gotoLCD(LCD_LINE_1 + 16 - 3); + printLCD("ATT"); + + resetPoints(); + showPoints(); + gotoLCD(LCD_LINE_2 + 16 - 3); + printLCD(isOrange ? "Org" : "Vrt"); +} + +void startParcours() +{ + clock_gettime(CLOCK_REALTIME, &tempsStart); + pthread_create(&tParcours, NULL, TaskParcours, NULL); // TODO Start on mutex unlock + lockLCD(); + gotoLCD(LCD_LINE_1 + 16 - 3); + printLCD(" "); + unlockLCD(); +} + +void updateTimeDisplay() +{ + lockLCD(); + gotoLCD(LCD_LINE_1); + sprintf(tempLine, "%2ld:%02ld", tempsEcoule.tv_sec / 60, tempsEcoule.tv_sec % 60); + printLCD(tempLine); + unlockLCD(); +} + +int updateParcours() +{ + clock_gettime(CLOCK_REALTIME, &tempsNow); + if ((tempsNow.tv_nsec - tempsStart.tv_nsec) < 0) { + tempsEcoule.tv_sec = tempsNow.tv_sec - tempsStart.tv_sec - 1; + tempsEcoule.tv_nsec = tempsNow.tv_nsec - tempsStart.tv_nsec + 1000000000UL; + } else { + tempsEcoule.tv_sec = tempsNow.tv_sec - tempsStart.tv_sec; + tempsEcoule.tv_nsec = tempsNow.tv_nsec - tempsStart.tv_nsec; + } + + if (tempsEcoule.tv_sec >= TEMPS_PARCOURS) { + return -1; + } + + updateTimeDisplay(); + + return (1000000000UL - tempsEcoule.tv_nsec) / 1000000UL; +} + +void stopParcours() +{ + pthread_cancel(tParcours); + stop(); + + updateTimeDisplay(); + gotoLCD(LCD_LINE_1 + 16 - 3); + printLCD("FIN"); + showPoints(); +} + +void* TaskParcours(void* pdata) +{ + (void)pdata; + + for (;;) { + delay(250); + addPoints(1); + } +} + +void* TaskParcours2(void* pdata) +{ + (void)pdata; + + /* struct position pos; */ + /* for (;;) { */ + /* pos.x = (int) (rand()*200.0/RAND_MAX); */ + /* pos.y = (int) (rand()*100.0/RAND_MAX); */ + /* pos.o = (int) (rand()*360.0/RAND_MAX); */ + /* aller(&pos); */ + /* sleep(1); */ + /* brake(); */ + /* sleep(2); */ + /* } */ + + struct timespec tim; // 10 ms + tim.tv_sec = 0; + tim.tv_nsec = 10000000L; + +#define RAMP_TIME 100 +#define MAX_VIT MOT_MAX_V + + /* for (;;) { */ + // ↗ + for (int i = 0; i < RAMP_TIME; i++) { + float p = (float)i / (float)RAMP_TIME; + changerMoteurs(p * MOT_MAX_V, p * MOT_MAX_V); + nanosleep(&tim, NULL); + } + changerMoteurs(MOT_MAX_V, MOT_MAX_V); + // ↑ + sleep(2); + /* // ↘ */ + /* for (int i = 0; i < RAMP_TIME; i++) { */ + /* float p = (float) i / (float) RAMP_TIME; */ + /* p = 1 - p; */ + /* changerMoteurs(p * MOT_MAX_V, p * MOT_MAX_V); */ + /* nanosleep(&tim, NULL); */ + /* } */ + /* sleep(5); */ + /* } */ + + return NULL; +} diff --git a/chef/src/parcours.h b/chef/src/parcours.h new file mode 100644 index 0000000..0573836 --- /dev/null +++ b/chef/src/parcours.h @@ -0,0 +1,15 @@ +#ifndef __PARCOURS_H__ +#define __PARCOURS_H__ + +#include + +#define TEMPS_PARCOURS 100 + +void prepareParcours(bool orange); +void startParcours(); +// Returns : -1 if parcours ended, N ms for the next time it should be checked +int updateParcours(); +void stopParcours(); +void* TaskParcours(void* pdata); + +#endif diff --git a/chef/src/points.c b/chef/src/points.c new file mode 100644 index 0000000..c735552 --- /dev/null +++ b/chef/src/points.c @@ -0,0 +1,31 @@ +#include + +#include "lcd.h" + +int points; +char tempLine[16]; + +void resetPoints() +{ + points = 0; +} + +int getPoints() +{ + return points; +} + +void showPoints() +{ + sprintf(tempLine, "%d points", getPoints()); + lockLCD(); + gotoLCD(LCD_LINE_2); + printLCD(tempLine); + unlockLCD(); +} + +void addPoints(int pts) +{ + points += pts; + showPoints(); +} diff --git a/chef/src/points.h b/chef/src/points.h new file mode 100644 index 0000000..43bf40d --- /dev/null +++ b/chef/src/points.h @@ -0,0 +1,10 @@ +#ifndef __POINTS_H__ +#define __POINTS_H__ + +// Public +void resetPoints(); +int getPoints(); +void addPoints(int points); +void showPoints(); + +#endif diff --git a/chef/src/premier.c b/chef/src/premier.c index 8f4c9e2..4bd1c52 100644 --- a/chef/src/premier.c +++ b/chef/src/premier.c @@ -1,93 +1,40 @@ -#include -#include -#include // random seed #include +#include +#include +#include // random seed #include // sleep +#include #include "CF.h" +#include "debug.h" +#include "ihm.h" #include "movement.h" #include "position.h" -#include "debug.h" - -#define TEMPSMAX 60 - -void* TaskParcours(void *pdata) -{ - (void) pdata; - - /* struct position pos; */ - /* for (;;) { */ - /* pos.x = (int) (rand()*200.0/RAND_MAX); */ - /* pos.y = (int) (rand()*100.0/RAND_MAX); */ - /* pos.o = (int) (rand()*360.0/RAND_MAX); */ - /* aller(&pos); */ - /* sleep(1); */ - /* brake(); */ - /* sleep(2); */ - /* } */ - - struct timespec tim; // 10 ms - tim.tv_sec = 0; - tim.tv_nsec = 10000000L; - -#define RAMP_TIME 100 -#define MAX_VIT MOT_MAX_V - - /* for (;;) { */ - // ↗ - for (int i = 0; i < RAMP_TIME; i++) { - float p = (float) i / (float) RAMP_TIME; - changerMoteurs(p * MOT_MAX_V, p * MOT_MAX_V); - nanosleep(&tim, NULL); - } - changerMoteurs(MOT_MAX_V, MOT_MAX_V); - // ↑ - sleep(2); - /* // ↘ */ - /* for (int i = 0; i < RAMP_TIME; i++) { */ - /* float p = (float) i / (float) RAMP_TIME; */ - /* p = 1 - p; */ - /* changerMoteurs(p * MOT_MAX_V, p * MOT_MAX_V); */ - /* nanosleep(&tim, NULL); */ - /* } */ - /* sleep(5); */ - /* } */ - - printf("Fin du parcours\n"); - return NULL; -} int main() { printf("Démarrage...\n"); - configureDebug(); - configureCF(); - configureMovement(); - configurePosition(); - startDebug(); - srand(time(NULL)); - - /* printf("En attente de la tirette...\n"); // TODO */ - printf("C'est parti !\n"); - - pthread_t tParcours; - pthread_create(&tParcours, NULL, TaskParcours, NULL); - - sleep(TEMPSMAX); - - printf("Fin des %d secondes\n", TEMPSMAX); - /* pthread_cancel(tParcours); */ - - for (;;) { - + if (wiringPiSetup() < 0) { + fprintf(stderr, "Impossible d'initialiser WiringPi\n"); + exit(EXIT_FAILURE); } + initI2C(); + configureIHM(); - /* stop(); */ + srand(time(NULL)); + configureDebug(); + /* configureCF(); */ + /* configureMovement(); */ + /* configurePosition(); */ + startDebug(); - deconfigureMovement(); - deconfigurePosition(); - deconfigureCF(); + startIHM(); + + /* deconfigureMovement(); */ + /* deconfigurePosition(); */ + /* deconfigureCF(); */ + deconfigureIHM(); deconfigureDebug(); return EXIT_SUCCESS; } diff --git a/raspberrypi/board/robotech/cdfprincipal/rootfs_overlay/etc/init.d/S30hardware b/raspberrypi/board/robotech/cdfprincipal/rootfs_overlay/etc/init.d/S30hardware index dfecd05..a97fd4a 100755 --- a/raspberrypi/board/robotech/cdfprincipal/rootfs_overlay/etc/init.d/S30hardware +++ b/raspberrypi/board/robotech/cdfprincipal/rootfs_overlay/etc/init.d/S30hardware @@ -8,6 +8,7 @@ start() { modprobe pl2303 # USB↔Serial cable modprobe i2c-bcm2708 # I2C modprobe i2c-dev # I2C + /opt/chef/i2cOff.sh echo "OK" } diff --git a/raspberrypi/package/robotech/chef/chef.mk b/raspberrypi/package/robotech/chef/chef.mk index 8f8404e..b944376 100644 --- a/raspberrypi/package/robotech/chef/chef.mk +++ b/raspberrypi/package/robotech/chef/chef.mk @@ -18,7 +18,7 @@ define CHEF_INSTALL_TARGET_CMDS $(INSTALL) -d -m 0755 $(TARGET_DIR)/opt/chef/com $(INSTALL) -d -m 0755 $(TARGET_DIR)/opt/chef/log $(INSTALL) -D -m 0755 $(@D)/bin/* $(TARGET_DIR)/opt/chef/bin - $(INSTALL) -D -m 0755 $(@D)/run.sh $(TARGET_DIR)/opt/chef + $(INSTALL) -D -m 0755 $(@D)/*.sh $(TARGET_DIR)/opt/chef endef $(eval $(generic-package))