X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=server%2Fsensors%2Fstrain.c;h=64233e25666d4517c7a8c9071da6bef0d2a9fa9e;hb=1f6cc726ae4ec11ea0bf9c16f6f90cdb5d132cd6;hp=77a11a2a4c0d0a7547f92edfd9f42e64a044e7e8;hpb=3dfde391486e81a357e08a24ccb7903c8adfa5aa;p=matches%2FMCTX3420.git diff --git a/server/sensors/strain.c b/server/sensors/strain.c index 77a11a2..64233e2 100644 --- a/server/sensors/strain.c +++ b/server/sensors/strain.c @@ -7,7 +7,7 @@ #define STRAIN_ADC ADC0 // TODO: Choose this -#define STRAIN_GPIO 15 +#define STRAIN_GPIO 45 /** * Convert Strain gauge id number to a GPIO pin on the Mux @@ -25,13 +25,13 @@ static int Strain_To_GPIO(StrainID id) switch (id) { case STRAIN0: - return GPIO0_30; + return 44; case STRAIN1: - return GPIO1_28; + return 26; case STRAIN2: - return GPIO0_31; + return 46; case STRAIN3: - return GPIO1_16; + return 65; default: Fatal("Unknown StrainID %d", id); return -1; // Should never happen @@ -119,6 +119,9 @@ bool Strain_Read(int id, double * value) if (!GPIO_Set(gpio_num, false)) Fatal("Couldn't set GPIO%d for strain sensor %d to LOW (after reading)", gpio_num, id); + + usleep(200); + pthread_mutex_unlock(&mutex); return result;