diff options
author | Brijeshcr | 2017-07-06 15:24:41 +0530 |
---|---|---|
committer | GitHub | 2017-07-06 15:24:41 +0530 |
commit | a7eeecce4c7c39ea52a2d434815c574a2c42730d (patch) | |
tree | 9968264546fd54f9eaa6ad80ee7db47e366f8601 /2.3-1/src/c/hardware/rasberrypi/Interrupt | |
parent | 3308ea7a973e2c1e1c8bea99ac7cc783ce8e8b06 (diff) | |
parent | 115efeb443a7e6da44f628537811b69a01553ab2 (diff) | |
download | Scilab2C-a7eeecce4c7c39ea52a2d434815c574a2c42730d.tar.gz Scilab2C-a7eeecce4c7c39ea52a2d434815c574a2c42730d.tar.bz2 Scilab2C-a7eeecce4c7c39ea52a2d434815c574a2c42730d.zip |
Merge pull request #3 from sandeepgupta007/master
LinearAlgebra Function Added
Diffstat (limited to '2.3-1/src/c/hardware/rasberrypi/Interrupt')
-rw-r--r-- | 2.3-1/src/c/hardware/rasberrypi/Interrupt/u8RPI_waitForInterrupts.c | 44 |
1 files changed, 0 insertions, 44 deletions
diff --git a/2.3-1/src/c/hardware/rasberrypi/Interrupt/u8RPI_waitForInterrupts.c b/2.3-1/src/c/hardware/rasberrypi/Interrupt/u8RPI_waitForInterrupts.c deleted file mode 100644 index ab15b8de..00000000 --- a/2.3-1/src/c/hardware/rasberrypi/Interrupt/u8RPI_waitForInterrupts.c +++ /dev/null @@ -1,44 +0,0 @@ -/* Copyright (C) 2017 - IIT Bombay - FOSSEE - - This file must be used under the terms of the CeCILL. - This source file is licensed as described in the file COPYING, which - you should have received as part of this distribution. The terms - are also available at - http://www.cecill.info/licences/Licence_CeCILL_V2-en.txt - Author: Jorawar Singh, Siddhesh Wani - Organization: FOSSEE, IIT Bombay - Email: toolbox@scilab.in -*/ - -#include "RPIPeripheralInterrupt.h" -#include "RPI_wfi.h" -#include <sys/time.h> -#include <math.h> -#include <stdlib.h> - -int8 u8RPI_waitForInterrupts(uint8 pin,int16 time){ - __RPI_wfi=0; - if (wiringPiISR(pin,3,&RPI_wfi)<0){ - return -1; - } - if (time==-1){ - while (__RPI_wfi==0){;} - return 1; - } - else{ - struct timeval time1,time2; - int nDigits; - double t1,t2; - gettimeofday(&time1, NULL); - nDigits=floor(log10(abs(time1.tv_usec)))+1; - t1=time1.tv_sec+time1.tv_usec/nDigits; - t2=t1; - while (__RPI_wfi==0 && t2-t1<time){ - gettimeofday(&time2,NULL); - nDigits=floor(log10(abs(time2.tv_usec)))+1; - t2=time2.tv_sec+time2.tv_usec/nDigits; - } - if (__RPI_wfi==0){return 0;} - else{return 1;} - } -} |